Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_hotplug.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 3c35a115e3..d7f10d8277 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -656,7 +656,6 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver, g_autoptr(qemuBlockStorageSourceChainData) data = NULL; qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virJSONValue) devprops = NULL; - bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool extensionDeviceAttached = false; int rc; g_autoptr(qemuSnapshotDiskContext) transientDiskSnapshotCtxt = NULL; @@ -668,7 +667,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver, if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) { if (!(data = qemuBuildStorageSourceChainAttachPrepareChardev(disk))) return -1; - } else if (blockdev) { + } else { if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src))) return -1; @@ -678,10 +677,6 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver, data->copyOnReadNodename = g_strdup(QEMU_DOMAIN_DISK_PRIVATE(disk)->nodeCopyOnRead); } - - } else { - if (!(data = qemuBuildStorageSourceChainAttachPrepareDrive(disk))) - return -1; } disk->src->readonly = origReadonly; @@ -733,7 +728,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver, * As there isn't anything sane to do if this fails, let's just return * success. */ - if (blockdev && rc == 0 && + if (rc == 0 && qemuDiskConfigBlkdeviotuneEnabled(disk)) { qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (qemuMonitorSetBlockIoThrottle(priv->mon, NULL, diskPriv->qomName, @@ -4287,7 +4282,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriver *driver, g_autoptr(qemuBlockStorageSourceChainData) diskBackend = NULL; size_t i; qemuDomainObjPrivate *priv = vm->privateData; - bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); int ret = -1; VIR_DEBUG("Removing disk %s from domain %p %s", @@ -4299,7 +4293,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriver *driver, if (!(diskBackend = qemuBlockStorageSourceChainDetachPrepareChardev(chardevAlias))) goto cleanup; - } else if (blockdev) { + } else { if (diskPriv->blockjob) { /* the block job keeps reference to the disk chain */ diskPriv->blockjob->disk = NULL; @@ -4315,14 +4309,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriver *driver, diskBackend->copyOnReadNodename = g_strdup(diskPriv->nodeCopyOnRead); diskBackend->copyOnReadAttached = true; } - } else { - char *driveAlias; - - if (!(driveAlias = qemuAliasDiskDriveFromDisk(disk))) - goto cleanup; - - if (!(diskBackend = qemuBlockStorageSourceChainDetachPrepareDrive(disk->src, driveAlias))) - goto cleanup; } for (i = 0; i < vm->def->ndisks; i++) { -- 2.36.1