[libvirt] [python PATCH] Fix crash in storage pool refresh callback
by Pavel Hrdina
Fixes copy-paste typo introduced by commit cb84e36c.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1354271
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
examples/event-test.py | 2 +-
libvirt-override.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/event-test.py b/examples/event-test.py
index f0341b5..1bcea07 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -580,7 +580,7 @@ def myStoragePoolEventLifecycleCallback(conn, pool, event, detail, opaque):
storageEventToString(event),
detail))
-def myStoragePoolEventRefreshCallback(conn, pool, event, detail, opaque):
+def myStoragePoolEventRefreshCallback(conn, pool, opaque):
print("myStoragePoolEventRefreshCallback: Storage pool %s" % pool.name())
##########################################################################
diff --git a/libvirt-override.c b/libvirt-override.c
index 8f21cfd..72b4b6b 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -8862,7 +8862,7 @@ libvirt_virConnectStoragePoolEventGenericCallback(virConnectPtr conn ATTRIBUTE_U
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
(char*)"_dispatchStoragePoolEventGenericCallback",
- (char*)"OiiO",
+ (char*)"OO",
pyobj_pool,
pyobj_cbData);
--
2.9.2
8 years, 5 months
[libvirt] [PATCH v2] qemuhotplugtest: Add tests for ccw devices
by Tomasz Flendrich
These are a few simple and one complex testcases.
The simple ones test attaching and detaching ccw devices
with both implicitly and explicitly stated addresses.
In the complex one, attaching and detaching a device
should make the address free to reuse.
I have plan to rework the address handling, so testcases
that verify hotplugging ccw devices will help in avoiding
regression.
In this commit, some device files are duplicated because
of the way qemuhotplug.c calculates the expected xml filenames.
I plan on changing that to explicitly stating the basis domain
xml, the device xml, and the expected xml.
---
Changed in v2:
* Add a newline to the end of qemuhotplug-ccw-virtio-2-explicit.xml,
so that syntax-check doesn't complain.
* Rename two files: remove the "explicit" word where the address
is actually implicit.
Link to the previous patch:
https://www.redhat.com/archives/libvir-list/2016-July/msg00264.html
tests/qemuhotplugtest.c | 37 +++++++++++
.../qemuhotplug-ccw-virtio-1-explicit.xml | 8 +++
.../qemuhotplug-ccw-virtio-1-reverse.xml | 8 +++
.../qemuhotplug-ccw-virtio-2-explicit.xml | 8 +++
.../qemuhotplug-ccw-virtio-2.xml | 8 +++
.../qemuhotplug-ccw-virtio.xml | 8 +++
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 63 +++++++++++++++++++
...ive-with-2-ccw-virtio+ccw-virtio-1-explicit.xml | 73 ++++++++++++++++++++++
...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 73 ++++++++++++++++++++++
...qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 63 +++++++++++++++++++
...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 73 ++++++++++++++++++++++
...-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 73 ++++++++++++++++++++++
.../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 63 +++++++++++++++++++
.../qemuhotplug-base-ccw-live.xml | 53 ++++++++++++++++
14 files changed, 611 insertions(+)
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index f2e7567..0a5f068 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -73,6 +73,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE);
+ virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW);
if (event)
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT);
@@ -523,6 +524,42 @@ mymain(void)
"device_del", QMP_OK,
"chardev-remove", QMP_OK);
+ DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+ DO_TEST_DETACH("base-ccw-live", "ccw-virtio", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ /* Attach a second device, then detach the first one. Then attach the first one again. */
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-explicit", false, true,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-reverse", false, false,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
qemuTestDriverFree(&driver);
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
new file mode 100644
index 0000000..74bd6a9
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
new file mode 100644
index 0000000..7cf469e
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
new file mode 100644
index 0000000..b2cb161
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
new file mode 100644
index 0000000..ebcbfa0
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
new file mode 100644
index 0000000..7cf469e
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw'/>
+</disk>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
new file mode 100644
index 0000000..2a27e11
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
new file mode 100644
index 0000000..ff94b6c
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
new file mode 100644
index 0000000..e03473c
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
new file mode 100644
index 0000000..8aff8e6
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
new file mode 100644
index 0000000..ff94b6c
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
new file mode 100644
index 0000000..ff94b6c
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde2' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
new file mode 100644
index 0000000..2a27e11
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
new file mode 100644
index 0000000..17a0dc2
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
@@ -0,0 +1,53 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
--
1.9.1
8 years, 5 months
[libvirt] gconfig: Add hostdev support v5
by Zeeshan Ali (Khattak)
It's back! :) Really intend to actually get it finished and merged this time around.
Basically I mostly fixed all the minor issues in patch 3/5 (Add GVirConfigDomainHostdevPci) pointed out in last review, including treatment of on/off attributes (which is why the patch "libvirt-gconfig: Accept on/off as boolean attributes" has been dropped in this version).
8 years, 5 months
[libvirt] [PATCH] nodedev: Add retry logic to read fibre channel files
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1319544
During processing of a vport_create event, udevEventHandleCallback
will call udevProcessSCSIHost to read the fibre channel configuration
files for wwpn, wwpn, and fabric_wwn; however, as it turns out those
files may not have valid data. Rather than carry around invalid data,
add some logic to re-read the files up to 5 times. If after 5 attempts
things still fail, don't hold up processing any longer.
The "ffffffffffffffff" value is what seems to be used to initialize the
wwnn and wwpn files, while "0" or "ffffffffffffffff" have been used to
initialize the fabric_wwn file (see bz 1240912 for some details).
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
This has been hanging in a local branch for a while. Figured I'd at the
very least get some feedback and thoughts from others as to whether it's
worth making the adjustments. Lots of details in the bz, the essentially
the tester is bypassing the libvirt create vport mechanism, then wants to
use the libvirt delete vHBA; however, the timing of things seems to have
gotten clogged up and not all the fields in the vHBA are read properly
thus the deletion cannot be done. A workaround to the issue is to run
nodedev-dumpxml on the vHBA again and the data is read properly. This patch
went with a retry mechanism to try and ensure the data we've read is
correct. I'm a bit ambivalent about this, but it doesn't hurt to ask...
src/node_device/node_device_driver.c | 4 ++--
src/node_device/node_device_linux_sysfs.c | 25 +++++++++++++++++++++++++
src/node_device/node_device_udev.c | 9 ++++++++-
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 500caeb..838b3ee 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -53,7 +53,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
while (cap) {
switch (cap->data.type) {
case VIR_NODE_DEV_CAP_SCSI_HOST:
- nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data);
+ ignore_value(nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data));
break;
case VIR_NODE_DEV_CAP_NET:
if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
@@ -292,7 +292,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
while (cap) {
if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) {
- nodeDeviceSysfsGetSCSIHostCaps(&cap->data);
+ ignore_value(nodeDeviceSysfsGetSCSIHostCaps(&cap->data));
if (cap->data.scsi_host.flags &
VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) {
if (STREQ(cap->data.scsi_host.wwnn, wwnn) &&
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index 549d32c..9363487 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -41,6 +41,21 @@
VIR_LOG_INIT("node_device.node_device_linux_sysfs");
+
+/* nodeDeviceSysfsGetSCSIHostCaps:
+ * @d: Pointer to node device capabilities
+ *
+ * Read the various 'scsi_host' files for the device and fill in
+ * the relevant data for our internal representation. It is possible
+ * that the environment isn't completely setup or "stable" when we
+ * go to read, so check for invalid values and fail on those. In
+ * particular, if the wwnn or wwpn are read in as ffffffffffffffff
+ * or the fabric_wwn is read as 0 or ffffffffffffffff, then we need
+ * to force a retry.
+ *
+ * Returns 0 on success, -1 on bad failure, -2 on failure to indicate
+ * to retry
+ */
int
nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
{
@@ -83,6 +98,16 @@ nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
d->scsi_host.host);
goto cleanup;
}
+
+ if (STREQ(d->scsi_host.wwnn, "ffffffffffffffff") ||
+ STREQ(d->scsi_host.wwpn, "ffffffffffffffff") ||
+ STREQ(d->scsi_host.fabric_wwn, "0") ||
+ STREQ(d->scsi_host.fabric_wwn, "ffffffffffffffff")) {
+ VIR_WARN("Failed to get valid wwnn, wwpn, or fabric_wwn for host%d",
+ d->scsi_host.host);
+ ret = -2;
+ goto cleanup;
+ }
}
if (virIsCapableVport(NULL, d->scsi_host.host)) {
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 76c60ea..54c9e58 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -523,6 +523,7 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED,
virNodeDevCapDataPtr data = &def->caps->data;
char *filename = NULL;
char *str;
+ int retry = 5;
filename = last_component(def->sysfs_path);
@@ -534,7 +535,13 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED,
return -1;
}
- nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data);
+ while (retry--) {
+ if (nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data) == -2) {
+ sleep(1);
+ continue;
+ }
+ break;
+ }
if (udevGenerateDeviceName(device, def, NULL) != 0)
return -1;
--
2.5.5
8 years, 5 months
[libvirt] [PATCH 0/2] Invoke drive_del on failute to attach disks
by Guido Günther
There is a drive_del in QEMU so we should use it.
Guido Günther (2):
qemu: attempt to delete disk when SCSI attach failed
qemu: attempt to delete disk when USB mass storage attach failed
src/qemu/qemu_hotplug.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
--
2.8.1
8 years, 5 months
[libvirt] [PATCH] qemu: bugfix: don't fail if disk media removed on second attempt
by Nikolay Shirokovskiy
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_hotplug.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e0b8230..5bbfb5e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -267,12 +267,12 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
format);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
+
+ if (rc < 0)
+ goto error;
}
- virDomainAuditDisk(vm, disk->src, newsrc, "update", rc >= 0);
-
- if (rc < 0)
- goto error;
+ virDomainAuditDisk(vm, disk->src, newsrc, "update", true);
/* remove the old source from shared device list */
ignore_value(qemuRemoveSharedDisk(driver, disk, vm->def->name));
--
1.8.3.1
8 years, 5 months
[libvirt] [PATCH] virt-aa-helper: Make help output match option name
by Guido Günther
---
src/security/virt-aa-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index bdead57..49e12b9 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -107,7 +107,7 @@ vah_usage(void)
" Options:\n"
" -a | --add load profile\n"
" -c | --create create profile from template\n"
- " -d | --dry-run dry run\n"
+ " -d | --dryrun dry run\n"
" -D | --delete unload and delete profile\n"
" -f | --add-file <file> add file to profile\n"
" -F | --append-file <file> append file to profile\n"
--
2.8.1
8 years, 5 months
[libvirt] [PATCH] qemu: hotplug: fix changeable media ejection
by Bjoern Walk
Since return code is checked globally at the end of the function, let's
make sure that we set it correctly at any point.
This fixes a regression introduced in commit 0aa19f35 where the first
command to eject changeable media would fail unconditionally.
Signed-off-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/qemu/qemu_hotplug.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c322543..789f18c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -240,7 +240,8 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
/* If the tray is present and tray change event is supported wait for it to open. */
if (diskPriv->tray &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_TRAY_MOVED)) {
- if (qemuHotplugWaitForTrayEject(driver, vm, disk, driveAlias, force) < 0)
+ rc = qemuHotplugWaitForTrayEject(driver, vm, disk, driveAlias, force);
+ if (rc < 0)
goto error;
} else {
/* otherwise report possible errors from the attempt to eject the media*/
--
2.6.6
8 years, 5 months
[libvirt] [PATCH v3 0/3] qemu: add support for multiple gluster hosts/servers
by Prasanna Kumar Kalever
These series of patches are rebased on latest master;
The dependent QEMU patches are now merged on master targeting for 2.7
Prasanna Kumar Kalever (3):
storage: add gluster backend initialization support for multiple
servers
qemu: add support for multiple gluster hosts/servers
util: add backing store parser support for gluster protocol
v3:
Since now there is qemu support available
refreshed the patches on master, also addressed most of the comments on v2
changes on patch 1/3: moved to the new JSON format of options
changes on patch 2/3: moved to the new JSON format of options
changes on patch 3/3: resolved most of the comments except moving the code from
utils to qemu specific, I need suggestions here to find what is the best file
to fit this in.
v2:
Split patches addressing "Peter Krempa" <pkrempa redhat com> comments
patch 1/3: Support to initialization of gluster backend with multiple servers
patch 2/3: JSON formatter
patch 3/3: JSON parser
v1:
Initial Patches
add support to gluster json formatter
src/qemu/qemu_command.c | 219 +++++++++++++++++++++++++++-------
src/storage/storage_backend_gluster.c | 100 +++++++++++-----
src/util/virstoragefile.c | 208 ++++++++++++++++++++++++++++++++
3 files changed, 453 insertions(+), 74 deletions(-)
--
2.7.4
8 years, 5 months
[libvirt] [PATCH] lxc: Don't crash by forgetting to ref transient domains
by Martin Kletzander
So commit 306b3a8504 tried mimicking behaviour of commit 540c339a25, but
added a virObjectRef(vm) only after virDomainObjListAdd() in
lxcDomainDefineXMLFlags() and not in lxcDomainCreateXMLWithFiles().
That way undefining a domain that was started with different XML than
defined will leave the domain object in a state with not enough
references to then remove it. Hence any lxcDomainDestroyFlags() called
afterwards crashes the daemon.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351057
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/lxc/lxc_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 46af05d43918..2e6788af0952 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1247,6 +1247,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
+ virObjectRef(vm);
def = NULL;
if (virLXCDomainObjBeginJob(driver, vm, LXC_JOB_MODIFY) < 0) {
--
2.9.2
8 years, 5 months