File 28423019-qemu-attach-crash.patch of Package libvirt.openSUSE_12.1_Update
commit 284230199af915a90322d6cc4a6210aaa2a33b28
Author: Jim Fehlig <jfehlig@suse.com>
Date: Wed Dec 7 11:23:03 2011 -0700
Prevent crash of libvirtd when attaching to existing qemu process
With security_driver set to "none" in /etc/libvirt/qemu.conf,
libvirtd would crash when attempted to attach to an existing
qemu process. Only copy the security model if it actually exists.
Index: libvirt-0.9.6/src/qemu/qemu_process.c
===================================================================
--- libvirt-0.9.6.orig/src/qemu/qemu_process.c
+++ libvirt-0.9.6/src/qemu/qemu_process.c
@@ -3509,7 +3509,8 @@ int qemuProcessAttach(virConnectPtr conn
if (virSecurityManagerGetProcessLabel(driver->securityManager,
vm, seclabel) < 0)
goto cleanup;
- if (!(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model)))
+ if (driver->caps->host.secModel.model &&
+ !(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model)))
goto no_memory;
if (!(vm->def->seclabel.label = strdup(seclabel->label)))
goto no_memory;