On Fri, Sep 02, 2011 at 04:37:24PM +0100, Stefan Hajnoczi wrote: > On Fri, Sep 2, 2011 at 4:01 PM, Daniel P. Berrange <d...@berrange.com> wrote: > > From: "Daniel P. Berrange" <d...@berrange.com> > > > > To aid in knowing whether a 'block_resize' was succesful, display > > the sector count in the 'info block' output > > > > Signed-off-by: Daniel P. Berrange <d...@berrange.com> > > --- > > block.c | 6 ++++-- > > qmp-commands.hx | 1 + > > 2 files changed, 5 insertions(+), 2 deletions(-) > > Please use bdrv_getlength(). That way units are in bytes, not > "sectors" (could be confusing, e.g. on 4 KB devices). Also for > "growable" block devices we actually query instead of reading the > cached total_sectors field.
Good points, I've sent a v2 using bytes instead of sectors. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|