Re: [libvirt] [PATCH 4/5] free extent fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 24, 2009 at 11:19:37AM +0200, Henrik Persson wrote:
> Parted reports that the first block of the disk is free, even if it is occupied by the 
> partition table.

> --- libvirt-0.6.4.patches/src/storage_backend_disk.c	2009-06-23 18:17:19.039168000 +0200
> +++ libvirt-0.6.4/src/storage_backend_disk.c	2009-06-23 18:17:10.324936000 +0200
> @@ -36,6 +36,8 @@
>  
>  #define PARTHELPER BINDIR "/libvirt_parthelper"
>  
> +#define SECTOR_SIZE 512
> +
>  /* Map partition types to internal enum */
>  static int 
>  virStorageBackendDiskMapPartitionType(const char* partType)
> @@ -214,6 +216,11 @@ virStorageBackendDiskMakeFreeExtent(virC
>                           &dev->freeExtents[dev->nfreeExtent].end) < 0)
>          return -1; /* Don't bother to re-alloc freeExtents - it'll be free'd shortly */
>  
> +    /* first block reported as free, even if it is not */
> +    if (dev->freeExtents[dev->nfreeExtent].start == 0) {
> +        dev->freeExtents[dev->nfreeExtent].start = SECTOR_SIZE;
> +    }
> +
>      pool->def->available +=
>          (dev->freeExtents[dev->nfreeExtent].end -
>           dev->freeExtents[dev->nfreeExtent].start);


ACK, makes sense,


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]