]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cgroup: be robust against cgroup movement races, part 2
authorEric Blake <eblake@redhat.com>
Tue, 21 May 2013 02:30:30 +0000 (20:30 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 25 May 2013 12:00:56 +0000 (06:00 -0600)
The previous commit was an incomplete backport of commit 83e4c775,
and as a result made any attempt to start a domain when cgroups
are enabled go into an infinite loop.  This fixes the botched
backport.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/cgroup.c

index b1280c00357aba40ee28ca60eabb81a30fe058cb..778a52ed091a238cc2775af6d88a0fab5ff4150b 100644 (file)
@@ -897,6 +897,8 @@ int virCgroupMoveTask(virCgroupPtr src_group, virCgroupPtr dest_group,
         rc = virCgroupGetValueStr(src_group, controller, "tasks", &content);
         if (rc != 0)
             return rc;
+        if (!*content)
+            break;
 
         rc = virCgroupAddTaskStrController(dest_group, content, controller);
         if (rc != 0)