[PATCH 14/19] qemu: blockjob: Store 'flags' for all the block job types

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

 



The flags may control important aspects of the block job which may
influence also the termination of the job. Store the 'flags' for all
the block job types.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 13 ++++++++++---
 src/qemu/qemu_blockjob.h |  9 ++++++---
 src/qemu/qemu_driver.c   |  7 ++++---
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 3dc9222a6f..6b59bbeb2c 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -252,7 +252,8 @@ qemuBlockJobDiskNew(virDomainObjPtr vm,
 qemuBlockJobDataPtr
 qemuBlockJobDiskNewPull(virDomainObjPtr vm,
                         virDomainDiskDefPtr disk,
-                        virStorageSourcePtr base)
+                        virStorageSourcePtr base,
+                        unsigned int jobflags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     g_autoptr(qemuBlockJobData) job = NULL;
@@ -269,6 +270,7 @@ qemuBlockJobDiskNewPull(virDomainObjPtr vm,
         return NULL;

     job->data.pull.base = base;
+    job->jobflags = jobflags;

     if (qemuBlockJobRegister(job, vm, disk, true) < 0)
         return NULL;
@@ -283,7 +285,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
                           virStorageSourcePtr topparent,
                           virStorageSourcePtr top,
                           virStorageSourcePtr base,
-                          bool delete_imgs)
+                          bool delete_imgs,
+                          unsigned int jobflags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     g_autoptr(qemuBlockJobData) job = NULL;
@@ -307,6 +310,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
     job->data.commit.top = top;
     job->data.commit.base = base;
     job->data.commit.deleteCommittedImages = delete_imgs;
+    job->jobflags = jobflags;

     if (qemuBlockJobRegister(job, vm, disk, true) < 0)
         return NULL;
@@ -350,7 +354,8 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm,
                         virDomainDiskDefPtr disk,
                         virStorageSourcePtr mirror,
                         bool shallow,
-                        bool reuse)
+                        bool reuse,
+                        unsigned int jobflags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     g_autoptr(qemuBlockJobData) job = NULL;
@@ -371,6 +376,8 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm,
     if (shallow && !reuse)
         job->data.copy.shallownew = true;

+    job->jobflags = jobflags;
+
     if (qemuBlockJobRegister(job, vm, disk, true) < 0)
         return NULL;

diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index 9e55382f15..72c7fa053e 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -176,7 +176,8 @@ qemuBlockJobDiskNew(virDomainObjPtr vm,
 qemuBlockJobDataPtr
 qemuBlockJobDiskNewPull(virDomainObjPtr vm,
                         virDomainDiskDefPtr disk,
-                        virStorageSourcePtr base);
+                        virStorageSourcePtr base,
+                        unsigned int jobflags);

 qemuBlockJobDataPtr
 qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
@@ -184,7 +185,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
                           virStorageSourcePtr topparent,
                           virStorageSourcePtr top,
                           virStorageSourcePtr base,
-                          bool delete_imgs);
+                          bool delete_imgs,
+                          unsigned int jobflags);

 qemuBlockJobDataPtr
 qemuBlockJobNewCreate(virDomainObjPtr vm,
@@ -197,7 +199,8 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm,
                         virDomainDiskDefPtr disk,
                         virStorageSourcePtr mirror,
                         bool shallow,
-                        bool reuse);
+                        bool reuse,
+                        unsigned int jobflags);

 qemuBlockJobDataPtr
 qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 021e5a2732..a2481232ad 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17706,7 +17706,7 @@ qemuDomainBlockPullCommon(virDomainObjPtr vm,
         speed <<= 20;
     }

-    if (!(job = qemuBlockJobDiskNewPull(vm, disk, baseSource)))
+    if (!(job = qemuBlockJobDiskNewPull(vm, disk, baseSource, flags)))
         goto endjob;

     if (blockdev) {
@@ -18393,7 +18393,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
             goto endjob;
     }

-    if (!(job = qemuBlockJobDiskNewCopy(vm, disk, mirror, mirror_shallow, mirror_reuse)))
+    if (!(job = qemuBlockJobDiskNewCopy(vm, disk, mirror, mirror_shallow, mirror_reuse, flags)))
         goto endjob;

     disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;
@@ -18814,7 +18814,8 @@ qemuDomainBlockCommit(virDomainPtr dom,

     if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
                                           baseSource,
-                                          flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)))
+                                          flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE,
+                                          flags)))
         goto endjob;

     disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;
-- 
2.24.1





[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