* "block.<num>.name" - name of the block device <num> as string.
* matches the target name (vda/sda/hda) of the
* block device.
+ * "block.<num>.path" - string describing the source of block device <num>,
+ * if it is a file or block device (omitted for network
+ * sources and drives with no media inserted).
* "block.<num>.rd.reqs" - number of read requests as unsigned long long.
* "block.<num>.rd.bytes" - number of read bytes as unsigned long long.
* "block.<num>.rd.times" - total time (ns) spent on reads as
goto cleanup; \
} while (0)
-#define QEMU_ADD_NAME_PARAM(record, maxparams, type, num, name) \
+#define QEMU_ADD_NAME_PARAM(record, maxparams, type, subtype, num, name) \
do { \
char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \
snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \
- "%s.%zu.name", type, num); \
+ "%s.%zu.%s", type, num, subtype); \
if (virTypedParamsAddString(&(record)->params, \
&(record)->nparams, \
maxparams, \
memset(&tmp, 0, sizeof(tmp));
QEMU_ADD_NAME_PARAM(record, maxparams,
- "net", i, dom->def->nets[i]->ifname);
+ "net", "name", i, dom->def->nets[i]->ifname);
if (virNetInterfaceStats(dom->def->nets[i]->ifname, &tmp) < 0) {
virResetLastError();
qemuBlockStats *entry;
virDomainDiskDefPtr disk = dom->def->disks[i];
- QEMU_ADD_NAME_PARAM(record, maxparams, "block", i, disk->dst);
+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", i, disk->dst);
+ if (virStorageSourceIsLocalStorage(disk->src) && disk->src->path)
+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path",
+ i, disk->src->path);
if (abbreviated || !disk->info.alias ||
!(entry = virHashLookup(stats, disk->info.alias))) {
I<--block> returns:
"block.count" - number of block devices on this domain,
"block.<num>.name" - name of the target of the block device <num>,
+"block.<num>.path" - file source of block device <num>, if it is a
+local file or block device,
"block.<num>.rd.reqs" - number of read requests,
"block.<num>.rd.bytes" - number of read bytes,
"block.<num>.rd.times" - total time (ns) spent on reads,