From nobody Tue Apr 23 07:21:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1595841466; cv=none; d=zohomail.com; s=zohoarc; b=nlEky64G2KvD5krFhA+6jr+zyJ2CgnMT98z5j8PtO2uVFat1GNHhcV5XOd3SlsJWB7iJaGUg8ScA5fCpbGSWatRNegmA5wP7DGFbI+YZ0xlveVNKn4mlaPf02UfN6jQqukdPG2YbN39mPYDLPK4uBMTpvS4cG4b8YHLmbSNQZPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595841466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=jL4ZN+uuurzcQC53uF5f/YESNhjw9TW/mBJiIZ6NcVM=; b=iqpSkDBCVOENb5YWuYjB2OhjyYNSaUFISdVR6G9mB/ZMlQsglLvTDMKL9YnmwhXrmJLkru0HTs2NDCIOiPixJG2TJGOjtiJT9kxFryjctTAgP3H+Gy7Bj2FqC5B7tdgirkuBUmdPKjXxdkN0Ni2VWX/QsgZWI3F2LKK1MGlfqXY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1595841466524536.3146201008651; Mon, 27 Jul 2020 02:17:46 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-Ts1FgJlsNXuf1ci1WR-yBw-1; Mon, 27 Jul 2020 05:17:43 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1C9958; Mon, 27 Jul 2020 09:17:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F09A10013C0; Mon, 27 Jul 2020 09:17:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AA43095491; Mon, 27 Jul 2020 09:17:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06R8SsA4013339 for ; Mon, 27 Jul 2020 04:28:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA21A207B2C6; Mon, 27 Jul 2020 08:28:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB08F207B2B8 for ; Mon, 27 Jul 2020 08:28:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C3ADD800394 for ; Mon, 27 Jul 2020 08:28:50 +0000 (UTC) Received: from huawei.com (szxga01-in.huawei.com [45.249.212.187]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-384-B6f3hBRQOpCtFv_LJT4gUg-1; Mon, 27 Jul 2020 04:28:45 -0400 Received: from DGGEML404-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id DB4B485F119C2326496F for ; Mon, 27 Jul 2020 16:28:38 +0800 (CST) Received: from DGGEML424-HUB.china.huawei.com (10.1.199.41) by DGGEML404-HUB.china.huawei.com (10.3.17.39) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 27 Jul 2020 16:28:38 +0800 Received: from DGGEML521-MBX.china.huawei.com ([169.254.6.204]) by dggeml424-hub.china.huawei.com ([10.1.199.41]) with mapi id 14.03.0487.000; Mon, 27 Jul 2020 16:28:28 +0800 X-MC-Unique: Ts1FgJlsNXuf1ci1WR-yBw-1 X-MC-Unique: B6f3hBRQOpCtFv_LJT4gUg-1 From: zhengchuan To: "libvir-list@redhat.com" Subject: [RESEND][PATCH] migration: fix xml file residual during vm crash with migration Thread-Topic: [RESEND][PATCH] migration: fix xml file residual during vm crash with migration Thread-Index: AdZj76Tzp4l7jktzRaCXP/OP5npGdw== Date: Mon, 27 Jul 2020 08:28:28 +0000 Message-ID: <0E8924944E28FD4A97A19E5A680D8A823F53C0D9@DGGEML521-MBX.china.huawei.com> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.186.4] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 06R8SsA4013339 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 27 Jul 2020 05:17:32 -0400 Cc: "Chenzhendong \(alex\)" , yubihong , "wanghao \(O\)" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" >From 935ec812b822ca978631e72bb9b9a5d00df24a42 Mon Sep 17 00:00:00 2001 From: Zheng Chuan Date: Mon, 27 Jul 2020 14:39:05 +0800 Subject: [PATCH] migration: fix xml file residual during vm crash with migration when migration is cancelled (such as kill -9 vmpid in Src, etc), it could do virDomainSaveStatus() to save xml file after qemuProcessStop(), which re= sults in xml residulal. Fix it by that do not do virDomainSaveStatus() if vm is not active. Signed-off-by: Zheng Chuan --- src/qemu/qemu_migration.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2c7bf34..d2804ab 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3073,6 +3073,9 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, jobPriv->migParams, priv->job.apiFlags); =20 + if (!virDomainObjIsActive(vm)) + goto done; + if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) VIR_WARN("Failed to save status on vm %s", vm->def->name); } --=20 1.8.3.1