[PATCH 71/80] qemuDomainDiskGetBackendAlias: Assume QEMU_CAPS_BLOCKDEV is supported

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c |  2 +-
 src/qemu/qemu_domain.c  | 11 ++++-------
 src/qemu/qemu_domain.h  |  4 +---
 src/qemu/qemu_hotplug.c |  2 +-
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a8c954edf6..afdf79ff55 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1935,7 +1935,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
     if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
         chardev = qemuDomainGetVhostUserChrAlias(disk->info.alias);
     } else {
-        if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &drive) < 0)
+        if (qemuDomainDiskGetBackendAlias(disk, &drive) < 0)
             return NULL;
     }

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8999f58d20..8997041b34 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7802,7 +7802,8 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
  * Returns the pointer to the node-name of the topmost layer used by @disk as
  * backend. Currently returns the nodename of the copy-on-read filter if enabled
  * or the nodename of the top image's format driver. Empty disks return NULL.
- * This must be used only when VIR_QEMU_CAPS_BLOCKDEV is enabled.
+ * This must be used only with disks instantiated via -blockdev (thus not
+ * for SD cards).
  */
 const char *
 qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
@@ -7822,7 +7823,6 @@ qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
 /**
  * qemuDomainDiskGetBackendAlias:
  * @disk: disk definition
- * @qemuCaps: emulator capabilities
  * @backendAlias: filled with the alias of the disk storage backend
  *
  * Returns the correct alias for the disk backend. This may be the alias of
@@ -7835,13 +7835,11 @@ qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
  */
 int
 qemuDomainDiskGetBackendAlias(virDomainDiskDef *disk,
-                              virQEMUCaps *qemuCaps,
                               char **backendAlias)
 {
     *backendAlias = NULL;

-    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV) ||
-        qemuDiskBusIsSD(disk->bus)) {
+    if (qemuDiskBusIsSD(disk->bus)) {
         if (!(*backendAlias = qemuAliasDiskDriveFromDisk(disk)))
             return -1;

@@ -10961,8 +10959,7 @@ qemuDomainPrepareDiskSource(virDomainDiskDef *disk,
             disk->src->format = VIR_STORAGE_FILE_RAW;
     }

-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
-        !qemuDiskBusIsSD(disk->bus)) {
+    if (!qemuDiskBusIsSD(disk->bus)) {
         if (qemuDomainPrepareDiskSourceBlockdev(disk, priv, cfg) < 0)
             return -1;
     } else {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index b674d49207..7dc720dcb8 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -734,10 +734,8 @@ qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
     ATTRIBUTE_NONNULL(1);

 int qemuDomainDiskGetBackendAlias(virDomainDiskDef *disk,
-                                  virQEMUCaps *qemuCaps,
                                   char **backendAlias)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
-    ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT;
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;

 int qemuDomainStorageSourceChainAccessAllow(virQEMUDriver *driver,
                                             virDomainObj *vm,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index a752702fc4..afc9d299f5 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -480,7 +480,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
         if (!(newbackend = qemuBuildStorageSourceChainAttachPrepareBlockdev(newsrc)))
             return -1;

-        if (qemuDomainDiskGetBackendAlias(disk, priv->qemuCaps, &nodename) < 0)
+        if (qemuDomainDiskGetBackendAlias(disk, &nodename) < 0)
             return -1;
     }

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