On Thu, Jun 01, 2023 at 12:44:19 +0600, Oleg Vasilev wrote: > From: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx> > > Unmap stats are useful for debugging how efficient qemu is in freeing host > disk space. "debugging [..] qemu" seems a bit too weak of a justification. Do you have any better usage for this data? > > Signed-off-by: Oleg Vasilev <oleg.vasilev@xxxxxxxxxxxxx> Missing sign-off by original author. (See 'From' field above) > --- > src/qemu/qemu_driver.c | 3 +++ > src/qemu/qemu_monitor.h | 3 +++ > src/qemu/qemu_monitor_json.c | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index 5ee15bab7a..6725bddff9 100644 > --- a/src/qemu/qemu_driver.c > +++ b/src/qemu/qemu_driver.c > @@ -17451,6 +17451,9 @@ qemuDomainGetStatsBlockExportFrontend(const char *frontendname, > virTypedParamListAddULLong(par, en->wr_req, "block.%zu.wr.reqs", idx) < 0 || > virTypedParamListAddULLong(par, en->wr_bytes, "block.%zu.wr.bytes", idx) < 0 || > virTypedParamListAddULLong(par, en->wr_total_times, "block.%zu.wr.times", idx) < 0 || > + virTypedParamListAddULLong(par, en->unmap_req, "block.%zu.un.reqs", idx) < 0 || > + virTypedParamListAddULLong(par, en->unmap_bytes, "block.%zu.un.bytes", idx) < 0 || > + virTypedParamListAddULLong(par, en->unmap_total_times, "block.%zu.un.times", idx) < 0 || Missing documentation for the new fields in: docs/manpages/virsh.rst - section for 'domstats' has: * ``block.<num>.rd.times`` - total time (ns) spent on reads * ``block.<num>.wr.reqs`` - number of write requests * ``block.<num>.wr.bytes`` - number of written bytes * ``block.<num>.wr.times`` - total time (ns) spent on writes src/libvirt-domain.c - function comment for 'virConnectGetAllDomainStats' * "block.<num>.wr.reqs" - number of write requests as unsigned long long. * "block.<num>.wr.bytes" - number of written bytes as unsigned long long. * "block.<num>.wr.times" - total time (ns) spent on writes as * unsigned long long. also, both internally and in qemu it's spelled 'unmap' so consider spelling it in full here too. Good thing is that the stats are reported since qemu-4.2 which is the minimum supported version so you don't need to add any special handling for the case if it weren't present.