mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Widening API change - accept empty path for virDomainBlockStats
And provide domain summary stat in that case, for lxc backend. Use case is a container inheriting all devices from the host, e.g. when doing application containerization.
This commit is contained in:
committed by
Michal Privoznik
parent
dcc85c603e
commit
0bd2ccdecc
@@ -888,7 +888,7 @@ static const vshCmdOptDef opts_domblkstat[] = {
|
||||
},
|
||||
{.name = "device",
|
||||
.type = VSH_OT_DATA,
|
||||
.flags = VSH_OFLAG_REQ,
|
||||
.flags = VSH_OFLAG_EMPTY_OK,
|
||||
.help = N_("block device")
|
||||
},
|
||||
{.name = "human",
|
||||
@@ -954,9 +954,16 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
|
||||
return false;
|
||||
|
||||
/* device argument is optional now. if it's missing, supply empty
|
||||
string to denote 'all devices'. A NULL device arg would violate
|
||||
API contract.
|
||||
*/
|
||||
if (vshCommandOptStringReq(ctl, cmd, "device", &device) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!device)
|
||||
device = "";
|
||||
|
||||
rc = virDomainBlockStatsFlags(dom, device, NULL, &nparams, 0);
|
||||
|
||||
/* It might fail when virDomainBlockStatsFlags is not
|
||||
|
||||
Reference in New Issue
Block a user