mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Remove 'driveAlias' argument of qemuBlockStorageSourceDetachPrepare
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
eb4c544877
commit
49b19bae56
@ -1555,36 +1555,29 @@ qemuBlockStorageSourceAttachRollback(qemuMonitor *mon,
|
||||
/**
|
||||
* qemuBlockStorageSourceDetachPrepare:
|
||||
* @src: disk source structure
|
||||
* @driveAlias: Alias of the -drive backend, the pointer is always consumed
|
||||
*
|
||||
* Prepare qemuBlockStorageSourceAttachData *for detaching a single source
|
||||
* from a VM. If @driveAlias is NULL -blockdev is assumed.
|
||||
* from a VM.
|
||||
*/
|
||||
qemuBlockStorageSourceAttachData *
|
||||
qemuBlockStorageSourceDetachPrepare(virStorageSource *src,
|
||||
char *driveAlias)
|
||||
qemuBlockStorageSourceDetachPrepare(virStorageSource *src)
|
||||
{
|
||||
qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||
g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
|
||||
|
||||
data = g_new0(qemuBlockStorageSourceAttachData, 1);
|
||||
|
||||
if (driveAlias) {
|
||||
data->driveAlias = g_steal_pointer(&driveAlias);
|
||||
data->driveAdded = true;
|
||||
} else {
|
||||
data->formatNodeName = src->nodeformat;
|
||||
data->formatAttached = true;
|
||||
data->storageNodeName = src->nodestorage;
|
||||
data->storageAttached = true;
|
||||
data->formatNodeName = src->nodeformat;
|
||||
data->formatAttached = true;
|
||||
data->storageNodeName = src->nodestorage;
|
||||
data->storageAttached = true;
|
||||
|
||||
/* 'raw' format doesn't need the extra 'raw' layer when slicing, thus
|
||||
* the nodename is NULL */
|
||||
if (src->sliceStorage &&
|
||||
src->sliceStorage->nodename) {
|
||||
data->storageSliceNodeName = src->sliceStorage->nodename;
|
||||
data->storageSliceAttached = true;
|
||||
}
|
||||
/* 'raw' format doesn't need the extra 'raw' layer when slicing, thus
|
||||
* the nodename is NULL */
|
||||
if (src->sliceStorage &&
|
||||
src->sliceStorage->nodename) {
|
||||
data->storageSliceNodeName = src->sliceStorage->nodename;
|
||||
data->storageSliceAttached = true;
|
||||
}
|
||||
|
||||
if (src->pr &&
|
||||
@ -1647,7 +1640,7 @@ qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSource *src)
|
||||
data = g_new0(qemuBlockStorageSourceChainData, 1);
|
||||
|
||||
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
if (!(backend = qemuBlockStorageSourceDetachPrepare(n, NULL)))
|
||||
if (!(backend = qemuBlockStorageSourceDetachPrepare(n)))
|
||||
return NULL;
|
||||
|
||||
VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, backend);
|
||||
|
@ -116,8 +116,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src,
|
||||
bool autoreadonly);
|
||||
|
||||
qemuBlockStorageSourceAttachData *
|
||||
qemuBlockStorageSourceDetachPrepare(virStorageSource *src,
|
||||
char *driveAlias);
|
||||
qemuBlockStorageSourceDetachPrepare(virStorageSource *src);
|
||||
|
||||
int
|
||||
qemuBlockStorageSourceAttachApply(qemuMonitor *mon,
|
||||
|
@ -1327,7 +1327,7 @@ qemuBlockJobProcessEventConcludedCreate(virQEMUDriver *driver,
|
||||
if (!job->data.create.src)
|
||||
return;
|
||||
|
||||
if (!(backend = qemuBlockStorageSourceDetachPrepare(job->data.create.src, NULL)))
|
||||
if (!(backend = qemuBlockStorageSourceDetachPrepare(job->data.create.src)))
|
||||
return;
|
||||
|
||||
/* the format node part was not attached yet, so we don't need to detach it */
|
||||
@ -1364,7 +1364,7 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriver *driver,
|
||||
progressCurrent, progressTotal, asyncJob);
|
||||
|
||||
if (job->data.backup.store &&
|
||||
!(backend = qemuBlockStorageSourceDetachPrepare(job->data.backup.store, NULL)))
|
||||
!(backend = qemuBlockStorageSourceDetachPrepare(job->data.backup.store)))
|
||||
return;
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
||||
|
@ -700,7 +700,7 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm,
|
||||
goto rollback;
|
||||
|
||||
QEMU_DOMAIN_DISK_PRIVATE(disk)->transientOverlayCreated = true;
|
||||
backend = qemuBlockStorageSourceDetachPrepare(disk->src, NULL);
|
||||
backend = qemuBlockStorageSourceDetachPrepare(disk->src);
|
||||
ignore_value(VIR_INSERT_ELEMENT(data->srcdata, 0, data->nsrcdata, backend));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user