]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Skip labelling if no src path present
authorMark McLoughlin <markmc@redhat.com>
Fri, 3 Jul 2009 10:29:09 +0000 (10:29 +0000)
committerMark McLoughlin <markmc@redhat.com>
Fri, 3 Jul 2009 10:29:09 +0000 (10:29 +0000)
Fixes startup of guest's with sourceless cdrom devices.

Patch from Cole Robinson originally posted here:

  https://bugzilla.redhat.com/499569

but never sent upstream.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
ChangeLog
src/security_selinux.c

index 0de7884ec3be31aac8e74c92720ae352dabfc67d..cb1715426b26f0b772aba4cca2216706cbcc8d36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jul  3 11:27:14 GMT 2009 Mark McLoughlin <markmc@redhat.com>
+
+       Patch from Cole Robinson in https://bugzilla.redhat.com/499569
+
+       * src/security_selinux.c: Skip labelling if no src path
+       present
+
 Thu Jul  3 11:26:04 GMT 2009 Mark McLoughlin <markmc@redhat.com>
 
        Patch from Tim Waugh in https://bugzilla.redhat.com/507555
index 174dd57b72a09a4261a009714bf0ca147eda96e7..80c1c855b954d8c22dae2f2c85b08e287b07340e 100644 (file)
@@ -380,6 +380,9 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn,
 {
     const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
 
+    if (!disk->src)
+        return 0;
+
     if (disk->shared) {
         return SELinuxSetFilecon(conn, disk->src, default_image_context);
     } else if (disk->readonly) {