[PATCH 24/31] qemu: Convert disk backend setup code to use 'format' nodename accessors

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

 



The disk backend setup code is concerned only about the effective
nodename. Doing this conversion will also simplify further changes
needed to drop the 'raw' layer in cases when it's not really needed.

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

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 852028f014..4c1a711dd3 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1980,7 +1980,7 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk)
     ignore_value(virJSONValueObjectAdd(&ret,
                                        "s:driver", "copy-on-read",
                                        "s:node-name", priv->nodeCopyOnRead,
-                                       "s:file", disk->src->nodeformat,
+                                       "s:file", qemuBlockStorageSourceGetEffectiveNodename(disk->src),
                                        "s:discard", "unmap",
                                        NULL));

@@ -2735,10 +2735,10 @@ qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData,
 {
     qemuBlockNamedNodeData *entry;

-    if (!(entry = virHashLookup(blockNamedNodeData, templ->nodeformat))) {
+    if (!(entry = virHashLookup(blockNamedNodeData, qemuBlockStorageSourceGetEffectiveNodename(templ)))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("failed to update capacity data for block node '%1$s'"),
-                       templ->nodeformat);
+                       qemuBlockStorageSourceGetEffectiveNodename(templ));
         return -1;
     }

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d8d3a17e55..995aa3f79c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7891,7 +7891,7 @@ qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
     if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON)
         return priv->nodeCopyOnRead;

-    return disk->src->nodeformat;
+    return qemuBlockStorageSourceGetEffectiveNodename(disk->src);
 }


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