[PATCH 2/7] conf: Drop pointless 'domain' argument from virDomainCheckpointRedefinePrep

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

 



'vm' is passed in which contains the definition which contains the UUID
so we don't need another parameter for this.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/checkpoint_conf.c | 7 +++----
 src/conf/checkpoint_conf.h | 3 +--
 src/qemu/qemu_driver.c     | 2 +-
 src/test/test_driver.c     | 2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c
index 5c998267aa..a83863adcc 100644
--- a/src/conf/checkpoint_conf.c
+++ b/src/conf/checkpoint_conf.c
@@ -532,8 +532,7 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,


 int
-virDomainCheckpointRedefinePrep(virDomainPtr domain,
-                                virDomainObjPtr vm,
+virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
                                 virDomainCheckpointDefPtr *defptr,
                                 virDomainMomentObjPtr *chk,
                                 virDomainXMLOptionPtr xmlopt,
@@ -544,13 +543,13 @@ virDomainCheckpointRedefinePrep(virDomainPtr domain,
     virDomainMomentObjPtr other = NULL;
     virDomainCheckpointDefPtr otherdef = NULL;

-    virUUIDFormat(domain->uuid, uuidstr);
+    virUUIDFormat(vm->def->uuid, uuidstr);

     if (virDomainCheckpointCheckCycles(vm->checkpoints, def, vm->def->name) < 0)
         return -1;

     if (!def->parent.dom ||
-        memcmp(def->parent.dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) {
+        memcmp(def->parent.dom->uuid, vm->def->uuid, VIR_UUID_BUFLEN)) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("definition for checkpoint %s must use uuid %s"),
                        def->parent.name, uuidstr);
diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h
index 47ff69eb4d..2be041ff56 100644
--- a/src/conf/checkpoint_conf.h
+++ b/src/conf/checkpoint_conf.h
@@ -90,8 +90,7 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,
 int
 virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr checkpoint);

-int virDomainCheckpointRedefinePrep(virDomainPtr domain,
-                                    virDomainObjPtr vm,
+int virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
                                     virDomainCheckpointDefPtr *def,
                                     virDomainMomentObjPtr *checkpoint,
                                     virDomainXMLOptionPtr xmlopt,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 21ab58e4ec..ad14b864f7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17313,7 +17313,7 @@ qemuDomainCheckpointCreateXML(virDomainPtr domain,
         goto cleanup;

     if (redefine) {
-        if (virDomainCheckpointRedefinePrep(domain, vm, &def, &chk,
+        if (virDomainCheckpointRedefinePrep(vm, &def, &chk,
                                             driver->xmlopt,
                                             &update_current) < 0)
             goto endjob;
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 9df7840390..dafd8c8daa 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -9073,7 +9073,7 @@ testDomainCheckpointCreateXML(virDomainPtr domain,
         goto cleanup;

     if (redefine) {
-        if (virDomainCheckpointRedefinePrep(domain, vm, &def, &chk,
+        if (virDomainCheckpointRedefinePrep(vm, &def, &chk,
                                             privconn->xmlopt,
                                             &update_current) < 0)
             goto cleanup;
-- 
2.21.0

--
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]

  Powered by Linux