[libvirt] [PATCHv8 01/11] storage: let format probing work on root-squash NFS

Peter Krempa pkrempa at redhat.com
Mon Oct 22 15:18:58 UTC 2012


On 10/20/12 23:47, Eric Blake wrote:
> Yet another instance of where using plain open() mishandles files
> that live on root-squash NFS, and where improving the API can
> improve the chance of a successful probe.
>
> * src/util/storage_file.h (virStorageFileProbeFormat): Alter
> signature.
> * src/util/storage_file.c (virStorageFileProbeFormat): Use better
> method for opening file.
> * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Update caller.
> * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
> Likewise.
> ---
>
> v8: new patch
>
>   src/qemu/qemu_driver.c           | 3 ++-
>   src/storage/storage_backend_fs.c | 2 +-
>   src/util/storage_file.c          | 4 ++--
>   src/util/storage_file.h          | 2 +-
>   4 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index feda4d9..dc9c62c 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -9309,7 +9309,8 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
>           format = disk->format;
>       } else {
>           if (driver->allowDiskFormatProbing) {
> -            if ((format = virStorageFileProbeFormat(disk->src)) < 0)
> +            if ((format = virStorageFileProbeFormat(disk->src, driver->user,
> +                                                    driver->group)) < 0)

I know it's late now, and this patch has been pushed, but we will 
probably need a followup patch that changes this part to values set in 
the DAC seclabels in the domain configuration. The DAC driver gives us 
the ability to specify the user and group of the machine separately, so 
we should use that information to access the images.

Peter




More information about the libvir-list mailing list