]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Parse all job related private XML in dedicated function
authorJiri Denemark <jdenemar@redhat.com>
Tue, 13 Mar 2018 14:43:00 +0000 (15:43 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 15 Mar 2018 08:24:20 +0000 (09:24 +0100)
Commit dc567cc22b introduced qemuDomainObjPrivateXMLParseJob, but forgot
to move "./job[1]/@type" parsing into it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_domain.c

index 2d108bec1b79a7c8f90e679523372ba48c7cabc9..a08a1825e93eda59a36d80e93db9d2491929a05e 100644 (file)
@@ -2337,6 +2337,18 @@ qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm,
     int n;
     int ret = -1;
 
+    if ((tmp = virXPathString("string(./job[1]/@type)", ctxt))) {
+        int type;
+
+        if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Unknown job type %s"), tmp);
+            goto cleanup;
+        }
+        VIR_FREE(tmp);
+        priv->job.active = type;
+    }
+
     if ((tmp = virXPathString("string(./job[1]/@async)", ctxt))) {
         int async;
 
@@ -2502,19 +2514,6 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
 
     priv->lockState = virXPathString("string(./lockstate)", ctxt);
 
-    if ((tmp = virXPathString("string(./job[1]/@type)", ctxt))) {
-        int type;
-
-        if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unknown job type %s"), tmp);
-            VIR_FREE(tmp);
-            goto error;
-        }
-        VIR_FREE(tmp);
-        priv->job.active = type;
-    }
-
     if (qemuDomainObjPrivateXMLParseJob(vm, priv, ctxt) < 0)
         goto error;