Re: [PATCH v3 3/3] qemu: Correctly label migration TCP socket

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

 



On Fri, Aug 26, 2011 at 10:23:48AM +0200, Jiri Denemark wrote:
> ---
> Notes:
>     Version 3:
>     - use virSecurityManagerSetSocketLabel/virSecurityManagerClearSocketLabel
>       pair around virNetSocketNewConnectTCP to label the newly created socket
>       with svirt_t
> 
>     Version 2:
>     - use virSecurityManagerSetProcessFDLabel instead of
>       virSecurityManagerSetImageFDLabel since the correct label for
>       TCP sockets appears to be svirt_t and not svirt_image_t
> 
>  src/qemu/qemu_migration.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index a38c0d9..3818d71 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -1624,11 +1624,14 @@ static int doNativeMigrate(struct qemud_driver *driver,
>              virReportOOMError();
>              goto cleanup;
>          }
> +        if (virSecurityManagerSetSocketLabel(driver->securityManager, vm) < 0)
> +            goto cleanup;
>          if (virNetSocketNewConnectTCP(uribits->server, tmp, &sock) == 0) {
>              spec.dest.fd.qemu = virNetSocketDupFD(sock, true);
>              virNetSocketFree(sock);
>          }
> -        if (spec.dest.fd.qemu == -1)
> +        if (virSecurityManagerClearSocketLabel(driver->securityManager, vm) < 0 ||
> +            spec.dest.fd.qemu == -1)
>              goto cleanup;
>      } else {
>          spec.destType = MIGRATION_DEST_HOST;

  ACK now, I feel more confident it it :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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