Re: [PATCHv2 4/4] Selectively ignore domainSetSecurityAllLabel failure in domain restore

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

 



On Fri, Jun 25, 2010 at 01:22:17PM -0400, Laine Stump wrote:
> When the saved domain image is on an NFS share, at least some part of
> domainSetSecurityAllLabel will fail (for example, selinux labels can't
> be modified). To allow domain restore to still work in this case, just
> ignore the errors.
> ---
>  src/qemu/qemu_driver.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index b248fdb..e282ecf 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -3368,8 +3368,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
>      DEBUG0("Generating setting domain security labels (if required)");
>      if (driver->securityDriver &&
>          driver->securityDriver->domainSetSecurityAllLabel &&
> -        driver->securityDriver->domainSetSecurityAllLabel(vm, stdin_path) < 0)
> -        goto cleanup;
> +        driver->securityDriver->domainSetSecurityAllLabel(vm, stdin_path) < 0) {
> +        if (virStorageFileIsSharedFS(stdin_path) != 1)
> +            goto cleanup;
> +    }
>  
>      /* Ensure no historical cgroup for this VM is lying around bogus
>       * settings */

ACK


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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]