[libvirt] [PATCHv3 7/8] qemu: bulk stats: add block allocation information
Francesco Romani
fromani at redhat.com
Fri Sep 12 07:55:44 UTC 2014
----- Original Message -----
> From: "Peter Krempa" <pkrempa at redhat.com>
> To: "Francesco Romani" <fromani at redhat.com>, libvir-list at redhat.com
> Sent: Tuesday, September 9, 2014 3:19:28 PM
> Subject: Re: [libvirt] [PATCHv3 7/8] qemu: bulk stats: add block allocation information
>
> On 09/08/14 15:05, Francesco Romani wrote:
> > Management software, want to be able to allocate disk space on demand.
>
> s/, want/ wants/
>
> > To support this, they need keep track of the space occupation
>
> s/,//
>
> > of the block device.
> > This information is reported by qemu as part of block stats.
> >
> > This patch extend the block information in the bulk stats with
> > the allocation information.
> >
> > To keep the same behaviour, an helper is extracted from
>
> s/,// s/an/a/
Thanks, will fix both.
[...]
> > int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
> > const char *dev_name,
> > qemuBlockStatsPtr bstats,
> > @@ -1919,6 +1968,10 @@ int
> > qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
> > goto cleanup;
> > }
> >
> > + /* it's ok to not have this information here. Just skip silently.
> > */
> > + qemuMonitorJSONDevGetBlockExtent(dev, false,
> > + &bstats->wr_highest_offset);
>
> As you want to ignore errors, it would probably be better just to copy
> the extraction code here without error reporting rather than extracting
> it to a helper ... this isn't something that would be reused any more.
I definitely see your point.
But I'm not really OK to replicate code, even if it's "just" twice.
So, I'll work a bit more on that. I'll move this patch to the end
of the series to gain a bit more time.
If I can't come up with a better approach I'll go this way
and just copy the extraction code as suggested above.
Bests,
--
Francesco Romani
RedHat Engineering Virtualization R & D
Phone: 8261328
IRC: fromani
More information about the libvir-list
mailing list