mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Rename qemuDiskBusNeedsDriveArg to qemuDiskBusIsSD
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>
This commit is contained in:
parent
514822dbbd
commit
cc4a277db2
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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."),
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user