Re: [libvirt] [PATCH v2 71/73] qemu: Store API flags for async jobs in status XML

2018-04-16 Thread Ján Tomko

On Wed, Apr 11, 2018 at 04:42:01PM +0200, Jiri Denemark wrote:

This will help us decide what to do when libvirtd is restarted while an
async job is running.

Signed-off-by: Jiri Denemark 
---
src/qemu/qemu_domain.c|   8 +
.../migration-out-nbd-out.xml | 450 +-
2 files changed, 457 insertions(+), 1 deletion(-)
mode change 12 => 100644 
tests/qemustatusxml2xmldata/migration-out-nbd-out.xml



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2 71/73] qemu: Store API flags for async jobs in status XML

2018-04-11 Thread Jiri Denemark
This will help us decide what to do when libvirtd is restarted while an
async job is running.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_domain.c|   8 +
 .../migration-out-nbd-out.xml | 450 +-
 2 files changed, 457 insertions(+), 1 deletion(-)
 mode change 12 => 100644 
tests/qemustatusxml2xmldata/migration-out-nbd-out.xml

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 71c3a917c1..8cd00576c8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2087,6 +2087,9 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
   priv->job.phase));
 }
 
+if (priv->job.asyncJob != QEMU_ASYNC_JOB_NONE)
+virBufferAsprintf(, " flags='0x%lx'", priv->job.apiFlags);
+
 if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT) {
 size_t i;
 virDomainDiskDefPtr disk;
@@ -2382,6 +2385,11 @@ qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm,
 }
 }
 
+if (virXPathULongHex("string(@flags)", ctxt, >job.apiFlags) == -2) {
+virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid job flags"));
+goto cleanup;
+}
+
 if ((n = virXPathNodeSet("./disk[@migrating='yes']", ctxt, )) < 0)
 goto cleanup;
 
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml 
b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
deleted file mode 12
index a4830f04a8..00
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
+++ /dev/null
@@ -1 +0,0 @@
-migration-out-nbd-in.xml
\ No newline at end of file
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml 
b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
new file mode 100644
index 00..05da1f81c6
--- /dev/null
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
@@ -0,0 +1,449 @@
+
+  
+  
+  
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+upstream
+dcf47dbd-46d1-4d5b-b442-262a806a333a
+1024000
+1024000
+
+  
+
+8
+
+  
+
+
+  /machine
+
+
+  hvm
+  
+
+
+  
+  
+  
+
+
+  
+
+
+  
+
+
+  
+  
+  
+
+destroy
+restart
+restart
+
+  
+  
+
+
+  /usr/bin/qemu-system-x86_64
+  
+
+
+
+  
+  
+
+  base.qcow2
+
+  
+  
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+  
+  
+
+
+  
+  
+
+
+
+  
+  
+
+
+
+  
+  
+
+
+
+  
+  
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+
+  
+  
+
+
+
+  
+
+
+
+
+
+  
+  
+
+
+  
+
+
+  
+  
+
+
+
+  
+  
+
+
+
+
+  
+  
+
+
+
+  
+  
+
+
+  
+  
+
+  
+  
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+