mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: command: Delegate qemuBuildDriveStr to SD cards only
Remove the generic frontend-less -drive code from qemuBuildDriveStr by assuming that we support only blockdev-enabled qemus. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8c8cce7188
commit
de538266a6
@ -2039,17 +2039,7 @@ qemuBuildDriveStr(virDomainDiskDef *disk)
|
||||
if (qemuBuildDriveSourceStr(disk, &opt) < 0)
|
||||
return NULL;
|
||||
|
||||
if (!qemuDiskBusIsSD(disk->bus)) {
|
||||
g_autofree char *drivealias = qemuAliasDiskDriveFromDisk(disk);
|
||||
if (!drivealias)
|
||||
return NULL;
|
||||
|
||||
virBufferAddLit(&opt, "if=none");
|
||||
virBufferAsprintf(&opt, ",id=%s", drivealias);
|
||||
} else {
|
||||
virBufferAsprintf(&opt, "if=sd,index=%d",
|
||||
virDiskNameToIndex(disk->dst));
|
||||
}
|
||||
virBufferAsprintf(&opt, "if=sd,index=%d", virDiskNameToIndex(disk->dst));
|
||||
|
||||
if (disk->src->readonly)
|
||||
virBufferAddLit(&opt, ",readonly=on");
|
||||
@ -2522,8 +2512,7 @@ qemuBuildDiskSourceCommandLine(virCommand *cmd,
|
||||
if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||
if (!(data = qemuBuildStorageSourceChainAttachPrepareChardev(disk)))
|
||||
return -1;
|
||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV) &&
|
||||
!qemuDiskBusIsSD(disk->bus)) {
|
||||
} else if (!qemuDiskBusIsSD(disk->bus)) {
|
||||
if (virStorageSourceIsEmpty(disk->src))
|
||||
return 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user