Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_block.c | 14 -------------- src/qemu/qemu_block.h | 2 -- src/qemu/qemu_command.c | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index afdcca2813..f504d8bc4c 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1304,7 +1304,6 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachData *data) g_free(data->encryptsecretAlias); g_free(data->httpcookiesecretAlias); g_free(data->driveCmd); - g_free(data->driveAlias); g_free(data->chardevAlias); g_free(data); } @@ -1472,13 +1471,6 @@ qemuBlockStorageSourceAttachApply(qemuMonitor *mon, qemuBlockStorageSourceAttachApplyFormat(mon, data) < 0) return -1; - if (data->driveCmd) { - if (qemuMonitorAddDrive(mon, data->driveCmd) < 0) - return -1; - - data->driveAdded = true; - } - if (data->chardevDef) { if (qemuMonitorAttachCharDev(mon, data->chardevAlias, data->chardevDef) < 0) return -1; @@ -1515,12 +1507,6 @@ qemuBlockStorageSourceAttachRollback(qemuMonitor *mon, } } - if (data->driveAdded) { - if (qemuMonitorDriveDel(mon, data->driveAlias) < 0) - VIR_WARN("Unable to remove drive %s (%s) after failed 'device_add'", - data->driveAlias, data->driveCmd); - } - if (data->formatAttached) ignore_value(qemuMonitorBlockdevDel(mon, data->formatNodeName)); diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index d29d444a5a..b083b7565e 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -81,8 +81,6 @@ struct qemuBlockStorageSourceAttachData { bool formatAttached; char *driveCmd; - char *driveAlias; - bool driveAdded; virDomainChrSourceDef *chardevDef; char *chardevAlias; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ed718eb81b..865464a772 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10624,8 +10624,7 @@ qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDef *disk) data = g_new0(qemuBlockStorageSourceAttachData, 1); - if (!(data->driveCmd = qemuBuildDriveStr(disk)) || - !(data->driveAlias = qemuAliasDiskDriveFromDisk(disk))) + if (!(data->driveCmd = qemuBuildDriveStr(disk))) return NULL; return g_steal_pointer(&data); -- 2.36.1