]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Rename qemuDiskBusNeedsDriveArg to qemuDiskBusIsSD
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 May 2020 13:44:43 +0000 (15:44 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 May 2020 04:54:59 +0000 (06:54 +0200)
The function effectively boils down to whether the disk is 'SD'. Since
we'll need to make more decisions based on the fact whether the disk is
on the SD bus, rename the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c

index d9c3a7a52ed7fab630edeb75c358e8a1e45507e1..1b3651a75808812f6909656a65e036d3536f208e 100644 (file)
@@ -1141,7 +1141,7 @@ qemuCheckFips(void)
 
 
 /**
- * qemuDiskBusNeedsDriveArg:
+ * qemuDiskBusIsSD:
  * @bus: disk bus
  *
  * Unfortunately it is not possible to use -device for SD devices.
@@ -1149,7 +1149,7 @@ qemuCheckFips(void)
  * without -device.
  */
 bool
-qemuDiskBusNeedsDriveArg(int bus)
+qemuDiskBusIsSD(int bus)
 {
     return bus == VIR_DOMAIN_DISK_BUS_SD;
 }
@@ -1441,7 +1441,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
     if (qemuBuildDriveSourceStr(disk, qemuCaps, &opt) < 0)
         return NULL;
 
-    if (!qemuDiskBusNeedsDriveArg(disk->bus)) {
+    if (!qemuDiskBusIsSD(disk->bus)) {
         g_autofree char *drivealias = qemuAliasDiskDriveFromDisk(disk);
         if (!drivealias)
             return NULL;
@@ -2158,7 +2158,7 @@ qemuBuildDiskCommandLine(virCommandPtr cmd,
     if (qemuBuildDiskSourceCommandLine(cmd, disk, qemuCaps) < 0)
         return -1;
 
-    if (!qemuDiskBusNeedsDriveArg(disk->bus)) {
+    if (!qemuDiskBusIsSD(disk->bus)) {
         if (disk->bus != VIR_DOMAIN_DISK_BUS_FDC ||
             virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
             if (qemuCommandAddExtDevice(cmd, &disk->info) < 0)
index 0bb66c3f0bc306da3370801f487cb1d8aef8971a..53e05777e7bfae671faf5b5e78e987dbf8f39048 100644 (file)
@@ -101,7 +101,7 @@ char *qemuBuildNicDevStr(virDomainDefPtr def,
                          virQEMUCapsPtr qemuCaps);
 
 char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk);
-bool qemuDiskBusNeedsDriveArg(int bus);
+bool qemuDiskBusIsSD(int bus);
 
 qemuBlockStorageSourceAttachDataPtr
 qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
index 641b6f1fe1086b077f7f67c64e139e0ce76bf951..f1b2fbb1a86199519a82acadf8c59ab89999ca81 100644 (file)
@@ -1072,7 +1072,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr driver,
     case VIR_DOMAIN_DISK_BUS_SD:
         /* Note that SD card hotplug support should be added only once
          * they support '-device' (don't require -drive only).
-         * See also: qemuDiskBusNeedsDriveArg */
+         * See also: qemuDiskBusIsSD */
     case VIR_DOMAIN_DISK_BUS_LAST:
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("disk bus '%s' cannot be hotplugged."),
index 8ea470f75f2c099106cfdad4aabb8b0a43833553..488ca91435c121bbe452474a3f6c0b166b92f228 100644 (file)
@@ -5499,7 +5499,7 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm,
 
     /* clear the 'blockdev' capability for VMs which have disks that need -drive */
     for (i = 0; i < vm->def->ndisks; i++) {
-        if (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) {
+        if (qemuDiskBusIsSD(vm->def->disks[i]->bus)) {
             virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
             break;
         }