[libvirt] [PATCH 3/2] Skip labelling if no src path present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes startup of guest's with sourceless cdrom devices.

Patch originally posted here:

  https://bugzilla.redhat.com/499569

but never sent upstream.

Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx>
---
 src/security_selinux.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/security_selinux.c b/src/security_selinux.c
index 174dd57..80c1c85 100644
--- a/src/security_selinux.c
+++ b/src/security_selinux.c
@@ -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) {
-- 
1.6.2.5

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]