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

Daniel P. Berrange berrange at redhat.com
Mon Jun 28 15:45:43 UTC 2010


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 :|




More information about the libvir-list mailing list