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(a)redhat.com>
---
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