38 lines
1.0 KiB
Diff
38 lines
1.0 KiB
Diff
From 99c018831379f23e65860ad4f3628a6d5f1a7d5a Mon Sep 17 00:00:00 2001
|
|
From: Mark McLoughlin <markmc@redhat.com>
|
|
Date: Fri, 3 Jul 2009 10:29:09 +0000
|
|
Subject: [PATCH] Skip labelling if no src path present
|
|
|
|
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.
|
|
|
|
(cherry picked from commit 67d0c6eb9410d5101f4820a7286deacb6398afde)
|
|
|
|
Fedora-patch: libvirt-0.6.2-fix-nosource-label.patch
|
|
---
|
|
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 95fa0a6..450fce2 100644
|
|
--- a/src/security_selinux.c
|
|
+++ b/src/security_selinux.c
|
|
@@ -338,6 +338,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
|
|
|