mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: blockjob: Remove pre-blockdev blockjob setup
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
75a0fbe420
commit
99a770881a
@ -250,16 +250,8 @@ qemuBlockJobDiskNewPull(virDomainObj *vm,
|
|||||||
virStorageSource *base,
|
virStorageSource *base,
|
||||||
unsigned int jobflags)
|
unsigned int jobflags)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
|
||||||
g_autoptr(qemuBlockJobData) job = NULL;
|
g_autoptr(qemuBlockJobData) job = NULL;
|
||||||
g_autofree char *jobname = NULL;
|
g_autofree char *jobname = g_strdup_printf("pull-%s-%s", disk->dst, disk->src->nodeformat);
|
||||||
|
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
jobname = g_strdup_printf("pull-%s-%s", disk->dst, disk->src->nodeformat);
|
|
||||||
} else {
|
|
||||||
if (!(jobname = qemuAliasDiskDriveFromDisk(disk)))
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_PULL, jobname)))
|
if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_PULL, jobname)))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -283,21 +275,13 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm,
|
|||||||
bool delete_imgs,
|
bool delete_imgs,
|
||||||
unsigned int jobflags)
|
unsigned int jobflags)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
|
||||||
g_autoptr(qemuBlockJobData) job = NULL;
|
g_autoptr(qemuBlockJobData) job = NULL;
|
||||||
g_autofree char *jobname = NULL;
|
g_autofree char *jobname = g_strdup_printf("commit-%s-%s", disk->dst, top->nodeformat);
|
||||||
qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
|
qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
|
||||||
|
|
||||||
if (topparent == NULL)
|
if (topparent == NULL)
|
||||||
jobtype = QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT;
|
jobtype = QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT;
|
||||||
|
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
jobname = g_strdup_printf("commit-%s-%s", disk->dst, top->nodeformat);
|
|
||||||
} else {
|
|
||||||
if (!(jobname = qemuAliasDiskDriveFromDisk(disk)))
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(job = qemuBlockJobDataNew(jobtype, jobname)))
|
if (!(job = qemuBlockJobDataNew(jobtype, jobname)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -352,16 +336,8 @@ qemuBlockJobDiskNewCopy(virDomainObj *vm,
|
|||||||
bool reuse,
|
bool reuse,
|
||||||
unsigned int jobflags)
|
unsigned int jobflags)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
|
||||||
g_autoptr(qemuBlockJobData) job = NULL;
|
g_autoptr(qemuBlockJobData) job = NULL;
|
||||||
g_autofree char *jobname = NULL;
|
g_autofree char *jobname = g_strdup_printf("copy-%s-%s", disk->dst, disk->src->nodeformat);
|
||||||
|
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
jobname = g_strdup_printf("copy-%s-%s", disk->dst, disk->src->nodeformat);
|
|
||||||
} else {
|
|
||||||
if (!(jobname = qemuAliasDiskDriveFromDisk(disk)))
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_COPY, jobname)))
|
if (!(job = qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_COPY, jobname)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user