mirror of https://gitee.com/openkylin/libvirt.git
Fix crash in device hotplug cleanup code
* src/qemu/qemu_driver.c: Fix crash in scenario where XML parsing of hotplugged device failed & thus 'dev' is NULL
This commit is contained in:
parent
46da355022
commit
879cd8cc2b
|
@ -4880,7 +4880,7 @@ cleanup:
|
|||
if (cgroup)
|
||||
virCgroupFree(&cgroup);
|
||||
|
||||
if (ret < 0) {
|
||||
if (ret < 0 && dev != NULL) {
|
||||
if (qemuDomainSetDeviceOwnership(dom->conn, driver, dev, 1) < 0)
|
||||
VIR_WARN0("Fail to restore disk device ownership");
|
||||
virDomainDeviceDefFree(dev);
|
||||
|
|
Loading…
Reference in New Issue