From patchwork Wed Jan 20 19:00:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joao Martins X-Patchwork-Id: 8073631 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 20A589F818 for ; Wed, 20 Jan 2016 19:04:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 490DD20529 for ; Wed, 20 Jan 2016 19:04:03 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 669A0204FC for ; Wed, 20 Jan 2016 19:04:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aLy09-00012n-5Q; Wed, 20 Jan 2016 19:01:05 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aLy08-00012b-4w for xen-devel@lists.xen.org; Wed, 20 Jan 2016 19:01:04 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 39/A0-03066-F69DF965; Wed, 20 Jan 2016 19:01:03 +0000 X-Env-Sender: joao.m.martins@oracle.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1453316461!17075012!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15765 invoked from network); 20 Jan 2016 19:01:02 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-10.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Jan 2016 19:01:02 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0KJ104i007825 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 20 Jan 2016 19:01:00 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u0KJ10gA005946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 20 Jan 2016 19:01:00 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0KJ10wJ025782; Wed, 20 Jan 2016 19:01:00 GMT Received: from localhost.localdomain (/87.196.251.223) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Jan 2016 11:00:59 -0800 From: Joao Martins To: libvir-list@redhat.com, jfehlig@suse.com Date: Wed, 20 Jan 2016 19:00:08 +0000 Message-Id: <1453316408-30373-4-git-send-email-joao.m.martins@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453316408-30373-1-git-send-email-joao.m.martins@oracle.com> References: <1453316408-30373-1-git-send-email-joao.m.martins@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Joao Martins , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v3 3/3] libxl: begin job on perform phase X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a job LIBXL_JOB_MODIFY in the perform phase to prevent changes to the domain from happening during migration. Signed-off-by: Joao Martins --- src/libxl/libxl_driver.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 28220b2..73ed448 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -5341,18 +5341,25 @@ libxlDomainMigratePerform3Params(virDomainPtr dom, if (virDomainMigratePerform3ParamsEnsureACL(dom->conn, vm->def) < 0) goto cleanup; + if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) + goto cleanup; + if (flags & VIR_MIGRATE_PEER2PEER) { if (libxlDomainMigrationPerformP2P(driver, vm, dom->conn, dom_xml, dconnuri, uri, dname, flags) < 0) - goto cleanup; + goto endjob; } else { if (libxlDomainMigrationPerform(driver, vm, dom_xml, dconnuri, uri, dname, flags) < 0) - goto cleanup; + goto endjob; } ret = 0; + endjob: + if (!libxlDomainObjEndJob(driver, vm)) + vm = NULL; + cleanup: if (vm) virObjectUnlock(vm);