Re: [PATCH v2 07/10] Narrow down a parameter to function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 16, 2016 at 02:42:52AM +0200, Tomasz Flendrich wrote:
Attaching to both live and config will soon be tested, so
testQemuHotplugCheckResult will be used on both def and newDef.


Or you could just pass the modification impact flag in as well and
select ->def or ->newDef based on that.

---
tests/qemuhotplugtest.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 0a5f068..d862a0e 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -175,7 +175,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
}

static int
-testQemuHotplugCheckResult(virDomainObjPtr vm,
+testQemuHotplugCheckResult(virDomainDefPtr def,
                           const char *expected,
                           const char *expectedFile,
                           bool fail)
@@ -183,11 +183,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
    char *actual;
    int ret;

-    actual = virDomainDefFormat(vm->def, driver.caps,
+    actual = virDomainDefFormat(def, driver.caps,
                                VIR_DOMAIN_DEF_FORMAT_SECURE);
    if (!actual)
        return -1;
-    vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+    def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;


This should not be set for newDef, it needs to be kept at '-1' for
config updates, because 'id != -1' means the domain is running.

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]