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. Stefan