[libvirt] [PATCH 6/9] Probe for capacity in virStorageBackendUpdateVolTargetInfo

Peter Krempa pkrempa at redhat.com
Wed Feb 25 09:12:16 UTC 2015


On Wed, Feb 25, 2015 at 10:10:38 +0100, Peter Krempa wrote:
> On Thu, Feb 19, 2015 at 15:59:14 +0100, Ján Tomko wrote:
> > Instead of just looking at the output of fstat, call
> > virStorageFileGetMetadata to get the full capacity from
> > image headers.
> > ---
> >  src/storage/storage_backend.c | 32 +++++++++++++++++++++++++++++++-
> >  1 file changed, 31 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> > index dd33436..8471744 100644
> > --- a/src/storage/storage_backend.c
> > +++ b/src/storage/storage_backend.c
> > @@ -1514,6 +1514,9 @@ virStorageBackendUpdateVolTargetInfo(virStorageSourcePtr target,
> >  {
> 
> This function has a parameter named 'updateCapacity' ...
> 
> >      int ret, fd = -1;
> >      struct stat sb;
> > +    virStorageSourcePtr meta = NULL;
> > +    char *buf = NULL;
> > +    ssize_t len = VIR_STORAGE_MAX_HEADER;
> >  
> >      if ((ret = virStorageBackendVolOpen(target->path, &sb, openflags)) < 0)
> >          goto cleanup;
> > @@ -1523,14 +1526,41 @@ virStorageBackendUpdateVolTargetInfo(virStorageSourcePtr target,
> >                                                        updateCapacity)) < 0)
> 
> ... that is obeyed when updating the capacity via the stat call ...
> 
> >          goto cleanup;
> >  
> > +    if (target->type == VIR_STORAGE_VOL_FILE &&
> > +        target->format != VIR_STORAGE_FILE_NONE) {
> 
> 
> ... but this new code ignores it. Is there a specific reason for that?

I see. Next patch reverts all the changes regarding update capacity.

ACK after the release to this patch.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150225/753dc8c7/attachment-0001.sig>


More information about the libvir-list mailing list