mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
virsh: expose partial pull
Now virsh can call virDomainBlockRebase. * tools/virsh.c (cmdBlockPull): Add --base parameter. (blockJobImpl): Use it to expose BlockRebase API. * tools/virsh.pod (blockpull): Document it.
This commit is contained in:
parent
10ec36e2e7
commit
ff4c25bae9
@ -7349,14 +7349,21 @@ blockJobImpl(vshControl *ctl, const vshCmd *cmd,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == VSH_CMD_BLOCK_JOB_ABORT)
|
if (mode == VSH_CMD_BLOCK_JOB_ABORT) {
|
||||||
ret = virDomainBlockJobAbort(dom, path, 0);
|
ret = virDomainBlockJobAbort(dom, path, 0);
|
||||||
else if (mode == VSH_CMD_BLOCK_JOB_INFO)
|
} else if (mode == VSH_CMD_BLOCK_JOB_INFO) {
|
||||||
ret = virDomainGetBlockJobInfo(dom, path, info, 0);
|
ret = virDomainGetBlockJobInfo(dom, path, info, 0);
|
||||||
else if (mode == VSH_CMD_BLOCK_JOB_SPEED)
|
} else if (mode == VSH_CMD_BLOCK_JOB_SPEED) {
|
||||||
ret = virDomainBlockJobSetSpeed(dom, path, bandwidth, 0);
|
ret = virDomainBlockJobSetSpeed(dom, path, bandwidth, 0);
|
||||||
else if (mode == VSH_CMD_BLOCK_JOB_PULL)
|
} else if (mode == VSH_CMD_BLOCK_JOB_PULL) {
|
||||||
|
const char *base = NULL;
|
||||||
|
if (vshCommandOptString(cmd, "base", &base) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
if (base)
|
||||||
|
ret = virDomainBlockRebase(dom, path, base, bandwidth, 0);
|
||||||
|
else
|
||||||
ret = virDomainBlockPull(dom, path, bandwidth, 0);
|
ret = virDomainBlockPull(dom, path, bandwidth, 0);
|
||||||
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (dom)
|
if (dom)
|
||||||
@ -7377,6 +7384,8 @@ static const vshCmdOptDef opts_block_pull[] = {
|
|||||||
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
|
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
|
||||||
{"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("Fully-qualified path of disk")},
|
{"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("Fully-qualified path of disk")},
|
||||||
{"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("Bandwidth limit in MB/s")},
|
{"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("Bandwidth limit in MB/s")},
|
||||||
|
{"base", VSH_OT_DATA, VSH_OFLAG_NONE,
|
||||||
|
N_("path of backing file in chain for a partial pull")},
|
||||||
{NULL, 0, 0, NULL}
|
{NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -598,10 +598,14 @@ currently in use by a running domain. Other contexts that require a MAC
|
|||||||
address of virtual interface (such as I<detach-interface> or
|
address of virtual interface (such as I<detach-interface> or
|
||||||
I<domif-setlink>) will accept the MAC address printed by this command.
|
I<domif-setlink>) will accept the MAC address printed by this command.
|
||||||
|
|
||||||
=item B<blockpull> I<domain> I<path> [I<bandwidth>]
|
=item B<blockpull> I<domain> I<path> [I<bandwidth>] [I<base>]
|
||||||
|
|
||||||
Populate a disk from its backing image. Once all data from its backing
|
Populate a disk from its backing image chain. By default, this command
|
||||||
image has been pulled, the disk no longer depends on the backing image.
|
flattens the entire chain; but if I<base> is specified, containing the
|
||||||
|
name of one of the backing files in the chain, then that file becomes
|
||||||
|
the new backing file and only the intermediate portion of the chain is
|
||||||
|
pulled. Once all requested data from the backing image chain has been
|
||||||
|
pulled, the disk no longer depends on that portion of the backing chain.
|
||||||
It pulls data for the entire disk in the background, the process of the
|
It pulls data for the entire disk in the background, the process of the
|
||||||
operation can be checked with B<blockjob>.
|
operation can be checked with B<blockjob>.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user