[PATCH 20/31] qemu: blockjob: Use 'format' nodename accessors for job naming

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

 



Use the effective nodename for naming the job as we use that one now.
It doesn't matter too much which one we pick, because it's used just for
the name of the job, which we preserve in the status XML.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 12f3d59df5..cb9948ae2a 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -252,7 +252,8 @@ qemuBlockJobDiskNewPull(virDomainObj *vm,
                         unsigned int jobflags)
 {
     g_autoptr(qemuBlockJobData) job = NULL;
-    g_autofree char *jobname = g_strdup_printf("pull-%s-%s", disk->dst, disk->src->nodeformat);
+    g_autofree char *jobname = g_strdup_printf("pull-%s-%s", disk->dst,
+                                               qemuBlockStorageSourceGetEffectiveNodename(disk->src));

     if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_PULL, jobname)))
         return NULL;
@@ -278,7 +279,8 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm,
                           unsigned int jobflags)
 {
     g_autoptr(qemuBlockJobData) job = NULL;
-    g_autofree char *jobname = g_strdup_printf("commit-%s-%s", disk->dst, top->nodeformat);
+    g_autofree char *jobname = g_strdup_printf("commit-%s-%s", disk->dst,
+                                               qemuBlockStorageSourceGetEffectiveNodename(top));
     qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;

     if (topparent == NULL)
@@ -309,7 +311,7 @@ qemuBlockJobNewCreate(virDomainObj *vm,
 {
     g_autoptr(qemuBlockJobData) job = NULL;
     g_autofree char *jobname = NULL;
-    const char *nodename = src->nodeformat;
+    const char *nodename = qemuBlockStorageSourceGetEffectiveNodename(src);

     if (storage)
         nodename = qemuBlockStorageSourceGetStorageNodename(src);
@@ -340,7 +342,8 @@ qemuBlockJobDiskNewCopy(virDomainObj *vm,
                         unsigned int jobflags)
 {
     g_autoptr(qemuBlockJobData) job = NULL;
-    g_autofree char *jobname = g_strdup_printf("copy-%s-%s", disk->dst, disk->src->nodeformat);
+    g_autofree char *jobname = g_strdup_printf("copy-%s-%s", disk->dst,
+                                               qemuBlockStorageSourceGetEffectiveNodename(disk->src));

     if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_COPY, jobname)))
         return NULL;
@@ -368,7 +371,8 @@ qemuBlockJobDiskNewBackup(virDomainObj *vm,
     g_autoptr(qemuBlockJobData) job = NULL;
     g_autofree char *jobname = NULL;

-    jobname = g_strdup_printf("backup-%s-%s", disk->dst, disk->src->nodeformat);
+    jobname = g_strdup_printf("backup-%s-%s", disk->dst,
+                              qemuBlockStorageSourceGetEffectiveNodename(disk->src));

     if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_BACKUP, jobname)))
         return NULL;
-- 
2.41.0




[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