mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: block: Remove pre-blockdev code paths
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
58e740aa24
commit
d5857ea611
@ -536,7 +536,7 @@ qemuBackupBeginPullExportDisks(virDomainObj *vm,
|
||||
if (!dd->backupdisk->exportname)
|
||||
dd->backupdisk->exportname = g_strdup(dd->domdisk->dst);
|
||||
|
||||
if (qemuBlockExportAddNBD(vm, NULL,
|
||||
if (qemuBlockExportAddNBD(vm,
|
||||
dd->store,
|
||||
dd->backupdisk->exportname,
|
||||
false,
|
||||
|
@ -3530,21 +3530,18 @@ qemuBlockExportGetNBDProps(const char *nodename,
|
||||
/**
|
||||
* qemuBlockExportAddNBD:
|
||||
* @vm: domain object
|
||||
* @drivealias: (optional) alias of -drive to export in pre-blockdev configurations
|
||||
* @src: disk source to export
|
||||
* @exportname: name for the export
|
||||
* @writable: whether the NBD export allows writes
|
||||
* @bitmap: (optional) block dirty bitmap to export along
|
||||
*
|
||||
* This function automatically selects the proper invocation of exporting a
|
||||
* block backend via NBD in qemu. This includes use of nodename for blockdev
|
||||
* and proper configuration for the exportname for older qemus.
|
||||
* block backend via NBD in qemu.
|
||||
*
|
||||
* This function must be called while in the monitor context.
|
||||
*/
|
||||
int
|
||||
qemuBlockExportAddNBD(virDomainObj *vm,
|
||||
const char *drivealias,
|
||||
virStorageSource *src,
|
||||
const char *exportname,
|
||||
bool writable,
|
||||
@ -3554,11 +3551,6 @@ qemuBlockExportAddNBD(virDomainObj *vm,
|
||||
g_autoptr(virJSONValue) nbdprops = NULL;
|
||||
const char *bitmaps[2] = { bitmap, NULL };
|
||||
|
||||
/* older qemu versions didn't support configuring the exportname and
|
||||
* took the 'drivealias' as the export name */
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
|
||||
return qemuMonitorNBDServerAdd(priv->mon, drivealias, NULL, writable, NULL);
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD))
|
||||
return qemuMonitorNBDServerAdd(priv->mon, src->nodeformat,
|
||||
exportname, writable, bitmap);
|
||||
|
@ -289,7 +289,6 @@ qemuBlockExportGetNBDProps(const char *nodename,
|
||||
|
||||
int
|
||||
qemuBlockExportAddNBD(virDomainObj *vm,
|
||||
const char *drivealias,
|
||||
virStorageSource *src,
|
||||
const char *exportname,
|
||||
bool writable,
|
||||
|
@ -612,7 +612,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
server_started = true;
|
||||
}
|
||||
|
||||
if (qemuBlockExportAddNBD(vm, diskAlias, disk->src, diskAlias, true, NULL) < 0)
|
||||
if (qemuBlockExportAddNBD(vm, disk->src, diskAlias, true, NULL) < 0)
|
||||
goto exit_monitor;
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user