[libvirt] [PATCH v2 0/3] qemu: Fix hotplug of guest agent

v2: - mostly a rebase, it was almost ACKed but not completely, just to make sure let's see it again with everything done. - use /tmp for paths in tests (automatically fixed by rebasing on top of commit 1893b6df117b) v1: - https://www.redhat.com/archives/libvir-list/2016-March/msg01454.html Martin Kletzander (3): qemuhotplugtest: Allow testing of live data qemu: Move channel path generation out of command creation qemu: Generate channel target paths on hotplug as well src/qemu/qemu_command.c | 25 ++-------- src/qemu/qemu_command.h | 5 +- src/qemu/qemu_domain.c | 20 ++++++++ src/qemu/qemu_domain.h | 4 ++ src/qemu/qemu_hotplug.c | 3 ++ src/qemu/qemu_process.c | 12 +++-- tests/qemuhotplugtest.c | 37 ++++++++++---- .../qemuhotplug-hotplug-base+qemu-agent-detach.xml | 58 ++++++++++++++++++++++ .../qemuhotplug-hotplug-base+qemu-agent.xml | 58 ++++++++++++++++++++++ .../qemuhotplug-qemu-agent-detach.xml | 5 ++ .../qemuhotplugtestdata/qemuhotplug-qemu-agent.xml | 5 ++ 11 files changed, 193 insertions(+), 39 deletions(-) create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml -- 2.8.1

For now, the test was dumping an XML of inactive domain (well, setting the id to '-1' to be precise) when checking the results. This patch enables future additions to test the live XML output as well. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tests/qemuhotplugtest.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index ea6dc361183a..924114668450 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -52,6 +52,7 @@ struct qemuHotplugTestData { bool keep; virDomainObjPtr vm; bool deviceDeletedEvent; + bool live; }; static int @@ -176,12 +177,13 @@ static int testQemuHotplugCheckResult(virDomainObjPtr vm, const char *expected, const char *expectedFile, - bool fail) + bool fail, bool live) { char *actual; int ret; - vm->def->id = -1; + if (!live) + vm->def->id = -1; actual = virDomainDefFormat(vm->def, driver.caps, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!actual) @@ -218,6 +220,7 @@ testQemuHotplug(const void *data) const char *const *tmp; bool fail = test->fail; bool keep = test->keep; + bool live = test->live; unsigned int device_parse_flags = 0; virDomainObjPtr vm = NULL; virDomainDeviceDefPtr dev = NULL; @@ -299,14 +302,14 @@ testQemuHotplug(const void *data) } if (ret == 0 || fail) ret = testQemuHotplugCheckResult(vm, result_xml, - result_filename, fail); + result_filename, fail, live); break; case DETACH: ret = testQemuHotplugDetach(vm, dev); if (ret == 0 || fail) ret = testQemuHotplugCheckResult(vm, domain_xml, - domain_filename, fail); + domain_filename, fail, live); break; case UPDATE: @@ -370,7 +373,7 @@ mymain(void) /* wait only 100ms for DEVICE_DELETED event */ qemuDomainRemoveDeviceWaitTime = 100; -#define DO_TEST(file, ACTION, dev, event, fial, kep, ...) \ +#define DO_TEST(file, ACTION, dev, event, fial, kep, liv, ...) \ do { \ const char *my_mon[] = { __VA_ARGS__, NULL}; \ const char *name = file " " #ACTION " " dev; \ @@ -380,25 +383,29 @@ mymain(void) data.fail = fial; \ data.mon = my_mon; \ data.keep = kep; \ + data.live = liv; \ data.deviceDeletedEvent = event; \ if (virtTestRun(name, testQemuHotplug, &data) < 0) \ ret = -1; \ } while (0) #define DO_TEST_ATTACH(file, dev, fial, kep, ...) \ - DO_TEST(file, ATTACH, dev, false, fial, kep, __VA_ARGS__) + DO_TEST(file, ATTACH, dev, false, fial, kep, false, __VA_ARGS__) + +#define DO_TEST_ATTACH_LIVE(file, dev, fial, kep, ...) \ + DO_TEST(file, ATTACH, dev, false, fial, kep, true, __VA_ARGS__) #define DO_TEST_DETACH(file, dev, fial, kep, ...) \ - DO_TEST(file, DETACH, dev, false, fial, kep, __VA_ARGS__) + DO_TEST(file, DETACH, dev, false, fial, kep, false, __VA_ARGS__) #define DO_TEST_ATTACH_EVENT(file, dev, fial, kep, ...) \ - DO_TEST(file, ATTACH, dev, true, fial, kep, __VA_ARGS__) + DO_TEST(file, ATTACH, dev, true, fial, kep, false, __VA_ARGS__) #define DO_TEST_DETACH_EVENT(file, dev, fial, kep, ...) \ - DO_TEST(file, DETACH, dev, true, fial, kep, __VA_ARGS__) + DO_TEST(file, DETACH, dev, true, fial, kep, false, __VA_ARGS__) #define DO_TEST_UPDATE(file, dev, fial, kep, ...) \ - DO_TEST(file, UPDATE, dev, false, fial, kep, __VA_ARGS__) + DO_TEST(file, UPDATE, dev, false, fial, kep, false, __VA_ARGS__) #define QMP_OK "{\"return\": {}}" -- 2.8.1

On Thu, Apr 28, 2016 at 04:43:40PM +0200, Martin Kletzander wrote:
For now, the test was dumping an XML of inactive domain (well, setting the id to '-1' to be precise) when checking the results. This patch enables future additions to test the live XML output as well.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> ---
I've noticed this too that our qemuhotplugtest is actually performing config updates and I think that it's pointless. Since the test is named hotplug which means operating on live domain I think that we should fix this test to do what it should've done from the beginning by doing only live updates. Pavel

Put it into separate function called qemuDomainPrepareChannel() and call it from the new qemuProcessPrepareDomain(). Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/qemu/qemu_command.c | 25 +++---------------------- src/qemu/qemu_command.h | 5 ++--- src/qemu/qemu_domain.c | 20 ++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ src/qemu/qemu_process.c | 12 ++++++++---- 5 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6fbfe215bf29..f3e07ab1920c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8513,8 +8513,7 @@ static int qemuBuildChannelsCommandLine(virLogManagerPtr logManager, virCommandPtr cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, - const char *domainChannelTargetDir) + virQEMUCapsPtr qemuCaps) { size_t i; @@ -8553,22 +8552,6 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager, return -1; } - /* - * TODO: Refactor so that we generate this (and onther - * things) somewhere else then where we are building the - * command line. - */ - if (channel->source.type == VIR_DOMAIN_CHR_TYPE_UNIX && - !channel->source.data.nix.path) { - if (virAsprintf(&channel->source.data.nix.path, - "%s/%s", domainChannelTargetDir, - channel->target.name ? channel->target.name - : "unknown.sock") < 0) - return -1; - - channel->source.data.nix.listen = true; - } - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC) && channel->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) { /* spicevmc was originally introduced via a -device @@ -9237,8 +9220,7 @@ qemuBuildCommandLine(virConnectPtr conn, virBitmapPtr nodeset, size_t *nnicindexes, int **nicindexes, - const char *domainLibDir, - const char *domainChannelTargetDir) + const char *domainLibDir) { size_t i; char uuid[VIR_UUID_STRING_BUFLEN]; @@ -9386,8 +9368,7 @@ qemuBuildCommandLine(virConnectPtr conn, if (qemuBuildParallelsCommandLine(logManager, cmd, def, qemuCaps) < 0) goto error; - if (qemuBuildChannelsCommandLine(logManager, cmd, def, qemuCaps, - domainChannelTargetDir) < 0) + if (qemuBuildChannelsCommandLine(logManager, cmd, def, qemuCaps) < 0) goto error; if (qemuBuildConsoleCommandLine(logManager, cmd, def, qemuCaps) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 1e9ce6690603..e128d455c57d 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -63,9 +63,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, virBitmapPtr nodeset, size_t *nnicindexes, int **nicindexes, - const char *domainLibDir, - const char *domainChannelTargetDir) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(16) ATTRIBUTE_NONNULL(17); + const char *domainLibDir) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(16); /* Generate '-device' string for chardev device */ int diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6262bfee47d0..3fce0641d58e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4972,3 +4972,23 @@ qemuDomainDiskByName(virDomainDefPtr def, return ret; } + + +int +qemuDomainPrepareChannel(virDomainChrDefPtr channel, + const char *domainChannelTargetDir) +{ + if (channel->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO && + channel->source.type == VIR_DOMAIN_CHR_TYPE_UNIX && + !channel->source.data.nix.path) { + if (virAsprintf(&channel->source.data.nix.path, + "%s/%s", domainChannelTargetDir, + channel->target.name ? channel->target.name + : "unknown.sock") < 0) + return -1; + + channel->source.data.nix.listen = true; + } + + return 0; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 7d2c4fd92ae4..cb1d8124e416 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -589,4 +589,8 @@ int qemuDomainMasterKeyCreate(virQEMUDriverPtr driver, void qemuDomainMasterKeyRemove(qemuDomainObjPrivatePtr priv); +int +qemuDomainPrepareChannel(virDomainChrDefPtr chr, + const char *domainChannelTargetDir); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0ccc3ac64385..8c783816688b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5113,6 +5113,12 @@ qemuProcessPrepareDomain(virConnectPtr conn, goto cleanup; } + for (i = 0; i < vm->def->nchannels; i++) { + if (qemuDomainPrepareChannel(vm->def->channels[i], + priv->channelTargetDir) < 0) + goto cleanup; + } + if (VIR_ALLOC(priv->monConfig) < 0) goto cleanup; @@ -5330,8 +5336,7 @@ qemuProcessLaunch(virConnectPtr conn, qemuCheckFips(), priv->autoNodeset, &nnicindexes, &nicindexes, - priv->libDir, - priv->channelTargetDir))) + priv->libDir))) goto cleanup; if (incoming && incoming->fd != -1) @@ -5751,8 +5756,7 @@ qemuProcessCreatePretendCmd(virConnectPtr conn, priv->autoNodeset, NULL, NULL, - priv->libDir, - priv->channelTargetDir); + priv->libDir); cleanup: return cmd; -- 2.8.1

On Thu, Apr 28, 2016 at 04:43:41PM +0200, Martin Kletzander wrote:
Put it into separate function called qemuDomainPrepareChannel() and call it from the new qemuProcessPrepareDomain().
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> ---
ACK

Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, qemu agent channel cannot be plugged in because we won't generate its path automatically. Let's not only fix that, but also add tests for it so next time it's checked for. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322210 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/qemu/qemu_hotplug.c | 3 ++ tests/qemuhotplugtest.c | 10 ++++ .../qemuhotplug-hotplug-base+qemu-agent-detach.xml | 58 ++++++++++++++++++++++ .../qemuhotplug-hotplug-base+qemu-agent.xml | 58 ++++++++++++++++++++++ .../qemuhotplug-qemu-agent-detach.xml | 5 ++ .../qemuhotplugtestdata/qemuhotplug-qemu-agent.xml | 5 ++ 6 files changed, 139 insertions(+) create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index ef8696be4690..da116a93a7be 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1566,6 +1566,9 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, goto cleanup; } + if (qemuDomainPrepareChannel(chr, priv->channelTargetDir) < 0) + goto cleanup; + if (qemuAssignDeviceChrAlias(vmdef, chr, -1) < 0) goto cleanup; diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 924114668450..19af173543a5 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -97,6 +97,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID; + if (qemuDomainSetPrivatePaths(&driver, *vm) < 0) + goto cleanup; + ret = 0; cleanup: return ret; @@ -494,6 +497,13 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "human-monitor-command", HMP("")); + DO_TEST_ATTACH_LIVE("hotplug-base", "qemu-agent", false, true, + "chardev-add", QMP_OK, + "device_add", QMP_OK); + DO_TEST_DETACH("hotplug-base", "qemu-agent-detach", false, false, + "device_del", QMP_OK, + "chardev-remove", QMP_OK); + qemuTestDriverFree(&driver); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml new file mode 100644 index 000000000000..2c449f1d49cd --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml @@ -0,0 +1,58 @@ +<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='x86_64' machine='pc'>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='ide'/> + <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> + <channel type='unix'> + <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-7-hotplug/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <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> + </devices> + <seclabel type='none' model='none'/> +</domain> diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml new file mode 100644 index 000000000000..47fc9708ac43 --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml @@ -0,0 +1,58 @@ +<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='x86_64' machine='pc'>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='ide'/> + <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> + <channel type='unix'> + <source mode='bind' path='/tmp/channel/domain-7-hotplug/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <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> + </devices> + <seclabel type='none' model='none'/> +</domain> diff --git a/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml b/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml new file mode 100644 index 000000000000..1ae1468cf605 --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml @@ -0,0 +1,5 @@ + <channel type='unix'> + <source mode='bind' path='/tmp/channel/domain-7-hotplug/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> diff --git a/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml b/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml new file mode 100644 index 000000000000..f0e90dea3cc2 --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml @@ -0,0 +1,5 @@ + <channel type='unix'> + <source mode='bind'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> -- 2.8.1

On Thu, Apr 28, 2016 at 04:43:42PM +0200, Martin Kletzander wrote:
Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, qemu agent channel cannot be plugged in because we won't generate its path automatically. Let's not only fix that, but also add tests for it so next time it's checked for.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322210
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> ---
[...]
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 924114668450..19af173543a5 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -97,6 +97,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
(*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+ if (qemuDomainSetPrivatePaths(&driver, *vm) < 0) + goto cleanup; + ret = 0; cleanup: return ret; @@ -494,6 +497,13 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "human-monitor-command", HMP(""));
+ DO_TEST_ATTACH_LIVE("hotplug-base", "qemu-agent", false, true, + "chardev-add", QMP_OK, + "device_add", QMP_OK);
This seems to depend on this patch: <https://www.redhat.com/archives/libvir-list/2016-April/msg01912.html> Pavel
+ DO_TEST_DETACH("hotplug-base", "qemu-agent-detach", false, false, + "device_del", QMP_OK, + "chardev-remove", QMP_OK); + qemuTestDriverFree(&driver); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
[...]

On Tue, May 03, 2016 at 04:05:02PM +0200, Pavel Hrdina wrote:
On Thu, Apr 28, 2016 at 04:43:42PM +0200, Martin Kletzander wrote:
Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, qemu agent channel cannot be plugged in because we won't generate its path automatically. Let's not only fix that, but also add tests for it so next time it's checked for.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322210
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> ---
[...]
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 924114668450..19af173543a5 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -97,6 +97,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
(*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+ if (qemuDomainSetPrivatePaths(&driver, *vm) < 0) + goto cleanup; + ret = 0; cleanup: return ret; @@ -494,6 +497,13 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "human-monitor-command", HMP(""));
+ DO_TEST_ATTACH_LIVE("hotplug-base", "qemu-agent", false, true, + "chardev-add", QMP_OK, + "device_add", QMP_OK);
This seems to depend on this patch: <https://www.redhat.com/archives/libvir-list/2016-April/msg01912.html>
Well, that's why that patch is 1/3 and this one is 3/3... Or have I missed something?
Pavel
+ DO_TEST_DETACH("hotplug-base", "qemu-agent-detach", false, false, + "device_del", QMP_OK, + "chardev-remove", QMP_OK); + qemuTestDriverFree(&driver); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
[...]

On Sat, May 14, 2016 at 09:20:40AM +0200, Martin Kletzander wrote:
On Tue, May 03, 2016 at 04:05:02PM +0200, Pavel Hrdina wrote:
On Thu, Apr 28, 2016 at 04:43:42PM +0200, Martin Kletzander wrote:
Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, qemu agent channel cannot be plugged in because we won't generate its path automatically. Let's not only fix that, but also add tests for it so next time it's checked for.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322210
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> ---
[...]
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 924114668450..19af173543a5 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -97,6 +97,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
(*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+ if (qemuDomainSetPrivatePaths(&driver, *vm) < 0) + goto cleanup; + ret = 0; cleanup: return ret; @@ -494,6 +497,13 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK, "human-monitor-command", HMP(""));
+ DO_TEST_ATTACH_LIVE("hotplug-base", "qemu-agent", false, true, + "chardev-add", QMP_OK, + "device_add", QMP_OK);
This seems to depend on this patch: <https://www.redhat.com/archives/libvir-list/2016-April/msg01912.html>
Well, that's why that patch is 1/3 and this one is 3/3... Or have I missed something?
Oh right, my bad. I don't know why I thought that it was from a different series.
participants (2)
-
Martin Kletzander
-
Pavel Hrdina