Mark McLoughlin dc0cb0
From 06f607a9c5cfd50433ae27cc7729c31f81d87f19 Mon Sep 17 00:00:00 2001
Mark McLoughlin dc0cb0
From: Cole Robinson <crobinso@redhat.com>
Mark McLoughlin dc0cb0
Date: Fri, 3 Jul 2009 10:40:55 +0100
Mark McLoughlin dc0cb0
Subject: [PATCH 3/3] Skip labelling if no src path present
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
Fixes startup of guest's with sourceless cdrom devices.
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
Patch originall posted here:
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
  https://bugzilla.redhat.com/499569
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
but never sent upstream.
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin dc0cb0
---
Mark McLoughlin dc0cb0
 src/security_selinux.c |    3 +++
Mark McLoughlin dc0cb0
 1 files changed, 3 insertions(+), 0 deletions(-)
Mark McLoughlin dc0cb0
Mark McLoughlin dc0cb0
diff --git a/src/security_selinux.c b/src/security_selinux.c
Mark McLoughlin dc0cb0
index c2015a1..eb8d308 100644
Mark McLoughlin dc0cb0
--- a/src/security_selinux.c
Mark McLoughlin dc0cb0
+++ b/src/security_selinux.c
Mark McLoughlin dc0cb0
@@ -342,6 +342,9 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn,
Mark McLoughlin dc0cb0
 {
Mark McLoughlin dc0cb0
     const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
Mark McLoughlin dc0cb0
 
Mark McLoughlin dc0cb0
+    if (!disk->src)
Mark McLoughlin dc0cb0
+        return 0;
Mark McLoughlin dc0cb0
+
Mark McLoughlin dc0cb0
     if (disk->shared) {
Mark McLoughlin dc0cb0
         return SELinuxSetFilecon(conn, disk->src, default_image_context);
Mark McLoughlin dc0cb0
     } else if (disk->readonly) {
Mark McLoughlin dc0cb0
-- 
Mark McLoughlin dc0cb0
1.6.2.5
Mark McLoughlin dc0cb0