[PATCH 3/6] qemu: domain: Don't overwrite job type in private data

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

 



The code overwrote the internal job type and then fixed it back. Since
the job type is not accessed in the code this does not make much sense.
Use the temporary value instead.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2db736fbed..e5b494fa2a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2040,15 +2040,14 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
                                  virDomainObjPtr vm,
                                  qemuDomainObjPrivatePtr priv)
 {
-    qemuDomainJob job;
+    qemuDomainJob job = priv->job.active;

-    job = priv->job.active;
     if (!qemuDomainTrackJob(job))
-        priv->job.active = QEMU_JOB_NONE;
+        job = QEMU_JOB_NONE;

-    if (priv->job.active || priv->job.asyncJob) {
+    if (job || priv->job.asyncJob) {
         virBufferAsprintf(buf, "<job type='%s' async='%s'",
-                          qemuDomainJobTypeToString(priv->job.active),
+                          qemuDomainJobTypeToString(job),
                           qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
         if (priv->job.phase) {
             virBufferAsprintf(buf, " phase='%s'",
@@ -2077,7 +2076,6 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
             virBufferAddLit(buf, "</job>\n");
         }
     }
-    priv->job.active = job;
 }


-- 
2.16.2

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