]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuProcessLaunch: Rename 'snapshot' to 'internalSnapshotRevert'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 May 2025 17:05:31 +0000 (19:05 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 May 2025 12:48:20 +0000 (14:48 +0200)
Make it obvious that the variable is used for internal snapshot
reversion by renaming it. This is necessary mainly as the function
parameters are not documented, but makes it obvious also if they were.

We can also report the name of the sanpshot rather than a pointer that
says absolutely nothing to the reader.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c
src/qemu/qemu_process.h

index 9b191ebd4f6948c8dac4352ba2695f304fe73be4..8533dab7309bba90a4251b8e1f963b01bd79973b 100644 (file)
@@ -7963,7 +7963,7 @@ qemuProcessLaunch(virConnectPtr conn,
                   virDomainObj *vm,
                   virDomainAsyncJob asyncJob,
                   qemuProcessIncomingDef *incoming,
-                  virDomainMomentObj *snapshot,
+                  virDomainMomentObj *internalSnapshotRevert,
                   virNetDevVPortProfileOp vmop,
                   unsigned int flags)
 {
@@ -7983,12 +7983,13 @@ qemuProcessLaunch(virConnectPtr conn,
     VIR_DEBUG("conn=%p driver=%p vm=%p name=%s id=%d asyncJob=%d "
               "incoming.uri=%s "
               "incoming.fd=%d incoming.path=%s "
-              "snapshot=%p vmop=%d flags=0x%x",
+              "internalSnapshotRevert='%s' vmop=%d flags=0x%x",
               conn, driver, vm, vm->def->name, vm->def->id, asyncJob,
               NULLSTR(incoming ? incoming->uri : NULL),
               incoming ? incoming->fd : -1,
               NULLSTR(incoming ? incoming->path : NULL),
-              snapshot, vmop, flags);
+              NULLSTR(internalSnapshotRevert ? internalSnapshotRevert->def->name : NULL),
+              vmop, flags);
 
     /* Okay, these are just internal flags,
      * but doesn't hurt to check */
@@ -8252,9 +8253,9 @@ qemuProcessLaunch(virConnectPtr conn,
 
     qemuDomainVcpuPersistOrder(vm->def);
 
-    if (snapshot) {
+    if (internalSnapshotRevert) {
         VIR_DEBUG("reverting internal snapshot via QMP");
-        if (qemuSnapshotInternalRevert(vm, snapshot, asyncJob) < 0)
+        if (qemuSnapshotInternalRevert(vm, internalSnapshotRevert, asyncJob) < 0)
             goto cleanup;
     }
 
@@ -8306,14 +8307,14 @@ qemuProcessLaunch(virConnectPtr conn,
     /* Since CPUs were not started yet, the balloon could not return the memory
      * to the host and thus cur_balloon needs to be updated so that GetXMLdesc
      * and friends return the correct size in case they can't grab the job */
-    if (!incoming && !snapshot &&
+    if (!incoming && !internalSnapshotRevert &&
         qemuProcessRefreshBalloonState(vm, asyncJob) < 0)
         goto cleanup;
 
     if (flags & VIR_QEMU_PROCESS_START_AUTODESTROY)
         virCloseCallbacksDomainAdd(vm, conn, qemuProcessAutoDestroy);
 
-    if (!incoming && !snapshot) {
+    if (!incoming && !internalSnapshotRevert) {
         VIR_DEBUG("Setting up transient disk");
         if (qemuProcessSetupDisksTransient(vm, asyncJob) < 0)
             goto cleanup;
index 1729b39d7396088cec084b88784867c57c16e2f4..021dbbd96033da89468bd4069fa8fedd51ed02d5 100644 (file)
@@ -153,7 +153,7 @@ int qemuProcessLaunch(virConnectPtr conn,
                       virDomainObj *vm,
                       virDomainAsyncJob asyncJob,
                       qemuProcessIncomingDef *incoming,
-                      virDomainMomentObj *snapshot,
+                      virDomainMomentObj *internalSnapshotRevert,
                       virNetDevVPortProfileOp vmop,
                       unsigned int flags);