[libvirt] [REPOST 4/4] qemu: Put the emulator cgroup pid into the right task file

Daniel P. Berrange berrange at redhat.com
Thu Jan 14 12:00:34 UTC 2016


On Wed, Jan 13, 2016 at 07:29:50AM -0500, John Ferlan wrote:
> Recently reverted commit id 'a41c00b4' was designed to move the setting
> of the task file into the right place in the cgroup hierarchy. This patch
> applies the portion of the reverted patch which writes the pid to the
> right task file.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_cgroup.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index 16c6492..a0ad03f 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
> @@ -1168,6 +1168,10 @@ qemuSetupCgroupForEmulator(virDomainObjPtr vm)
>              goto cleanup;
>      }
>  
> +    /* consider the first thread an emulator-thread */
> +    if (virCgroupAddTask(cgroup_emulator, vm->pid) < 0)
> +        goto cleanup;
> +
>      virCgroupFree(&cgroup_emulator);
>      return 0;

This doesn't actually do anything useful. Take a look further
up in this method and you'll see virCgroupMoveTask() which moves
every single PID, including vm->pid.

So NACK to this as it doesn't solve the race condition Henning was
addressing.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list