SHA256
1
0
forked from pool/libvirt
libvirt/0005-libxl-acquire-a-job-when-receiving-a-migrating-domai.patch
James Fehlig 379397c0f7 Accepting request 320420 from home:jfehlig:branches:Virtualization
- Update to libvirt 1.2.18
  - libxl: support dom0
  - Many incremental improvements and bug fixes, see
    http://libvirt.org/news.html
  - Dropped upstream patches:
    e44bcae-virt-aa-helper-trailing-slash.patch,
    a55a5e7-virt-aa-helper-log.patch,
    61dab0f-virt-aa-helper-renaming.patch,
    24f3c2f-virt-aa-helper-fix-caps.patch,
    45697fe5-libxl-support-dom0.patch,
    e9c27344-libxl-fix-virDomainObj-state.patch,
    4ffb21c8-libxl-dom0-state-fix.patch,
    qemu-nbd-cleanup-fix.patch

OBS-URL: https://build.opensuse.org/request/show/320420
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=475
2015-08-04 15:13:51 +00:00

62 lines
1.9 KiB
Diff

From 710088061fb3caaf3d56888b05ad2d331a740d07 Mon Sep 17 00:00:00 2001
From: Jim Fehlig <jfehlig@suse.com>
Date: Thu, 16 Jul 2015 14:51:32 -0600
Subject: libxl: acquire a job when receiving a migrating domain
Commit f86ae403 moved acquiring a job from libxlDomainStart()
to its callers. One spot missed was in libxlDoMigrateReceive().
Acquire a job in libxlDoMigrateReceive() before calling
libxlDomainStart().
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
src/libxl/libxl_migration.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
Index: libvirt-1.2.18/src/libxl/libxl_migration.c
===================================================================
--- libvirt-1.2.18.orig/src/libxl/libxl_migration.c
+++ libvirt-1.2.18/src/libxl/libxl_migration.c
@@ -95,17 +95,20 @@ libxlDoMigrateReceive(void *opaque)
int recvfd = args->recvfd;
size_t i;
int ret;
+ bool remove_dom = 0;
+
+ virObjectLock(vm);
+ if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
+ goto cleanup;
/*
* Always start the domain paused. If needed, unpause in the
* finish phase, after transfer of the domain is complete.
*/
- virObjectLock(vm);
ret = libxlDomainStart(driver, vm, true, recvfd);
- virObjectUnlock(vm);
if (ret < 0 && !vm->persistent)
- virDomainObjListRemove(driver->domains, vm);
+ remove_dom = true;
/* Remove all listen socks from event handler, and close them. */
for (i = 0; i < nsocks; i++) {
@@ -117,6 +120,17 @@ libxlDoMigrateReceive(void *opaque)
args->nsocks = 0;
VIR_FORCE_CLOSE(recvfd);
virObjectUnref(args);
+
+ if (!libxlDomainObjEndJob(driver, vm))
+ vm = NULL;
+
+ cleanup:
+ if (remove_dom && vm) {
+ virDomainObjListRemove(driver->domains, vm);
+ vm = NULL;
+ }
+ if (vm)
+ virObjectUnlock(vm);
}