From nobody Sat May 4 03:25:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541005629232840.587896363224; Wed, 31 Oct 2018 10:07:09 -0700 (PDT) Received: from localhost ([::1]:60868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtxU-0001SQ-4I for importer@patchew.org; Wed, 31 Oct 2018 13:07:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtoM-0000eo-2W for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHtoH-0002nb-SP for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47166) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHtoH-0002cE-FK for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45FC8308FB9B for ; Wed, 31 Oct 2018 16:57:28 +0000 (UTC) Received: from dgilbert-t530.redhat.com (unknown [10.36.118.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 895B760C47; Wed, 31 Oct 2018 16:57:27 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Wed, 31 Oct 2018 16:57:23 +0000 Message-Id: <20181031165725.61938-2-dgilbert@redhat.com> In-Reply-To: <20181031165725.61938-1-dgilbert@redhat.com> References: <20181031165725.61938-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 31 Oct 2018 16:57:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] COLO: Fix Colo doc secondeary should be secondary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: wangguang Signed-off-by: Guang Wang Reviewed-by: Eric Blake Signed-off-by: Dr. David Alan Gilbert --- docs/COLO-FT.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt index 6302469d0e..e2686bb338 100644 --- a/docs/COLO-FT.txt +++ b/docs/COLO-FT.txt @@ -173,7 +173,7 @@ Secondary: { 'execute': 'nbd-server-start', 'arguments': {'addr': {'type': 'inet', 'data': {'host': 'xx.xx.xx.xx', '= port': '8889'} } } } -{'execute': 'nbd-server-add', 'arguments': {'device': 'secondeary-disk0', = 'writable': true } } +{'execute': 'nbd-server-add', 'arguments': {'device': 'secondary-disk0', '= writable': true } } =20 Note: a. The qmp command nbd-server-start and nbd-server-add must be run --=20 2.19.1 From nobody Sat May 4 03:25:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541005296029284.8853035156293; Wed, 31 Oct 2018 10:01:36 -0700 (PDT) Received: from localhost ([::1]:60834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHts6-0004ox-PE for importer@patchew.org; Wed, 31 Oct 2018 13:01:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtoM-0000es-2c for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHtoI-0002oZ-NY for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHtoI-0002dV-Bu for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4435C307DAA2 for ; Wed, 31 Oct 2018 16:57:30 +0000 (UTC) Received: from dgilbert-t530.redhat.com (unknown [10.36.118.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 977F660C47; Wed, 31 Oct 2018 16:57:28 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Wed, 31 Oct 2018 16:57:24 +0000 Message-Id: <20181031165725.61938-3-dgilbert@redhat.com> In-Reply-To: <20181031165725.61938-1-dgilbert@redhat.com> References: <20181031165725.61938-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 31 Oct 2018 16:57:30 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/3] qapi: Fix COLOStatus and query-colo-status since version X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Zhang Chen This structure and command have missed qemu version 3.0, so fix it to since= version 3.1. Signed-off-by: Zhang Chen Message-Id: <20181022164118.5502-1-zhangckid@gmail.com> Reviewed-by: Eric Blake Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- qapi/migration.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 0928f4b727..38d4c41d88 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1317,7 +1317,7 @@ # # @reason: describes the reason for the COLO exit. # -# Since: 3.0 +# Since: 3.1 ## { 'struct': 'COLOStatus', 'data': { 'mode': 'COLOMode', 'reason': 'COLOExitReason' } } @@ -1334,7 +1334,7 @@ # -> { "execute": "query-colo-status" } # <- { "return": { "mode": "primary", "active": true, "reason": "request" = } } # -# Since: 3.0 +# Since: 3.1 ## { 'command': 'query-colo-status', 'returns': 'COLOStatus' } --=20 2.19.1 From nobody Sat May 4 03:25:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541005425933976.9729129794969; Wed, 31 Oct 2018 10:03:45 -0700 (PDT) Received: from localhost ([::1]:60844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtu7-0006Mh-Q4 for importer@patchew.org; Wed, 31 Oct 2018 13:03:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtoM-0000el-2O for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHtoI-0002oI-AH for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3305) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHtoI-0002dn-0H for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:57:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5669F81DEC for ; Wed, 31 Oct 2018 16:57:31 +0000 (UTC) Received: from dgilbert-t530.redhat.com (unknown [10.36.118.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 974A960C47; Wed, 31 Oct 2018 16:57:30 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Wed, 31 Oct 2018 16:57:25 +0000 Message-Id: <20181031165725.61938-4-dgilbert@redhat.com> In-Reply-To: <20181031165725.61938-1-dgilbert@redhat.com> References: <20181031165725.61938-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 31 Oct 2018 16:57:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/3] migration: avoid segmentfault when take a snapshot of a VM which being migrated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Jia Lina During an active background migration, snapshot will trigger a segmentfault. As snapshot clears the "current_migration" struct and updates "to_dst_file" before it finds out that there is a migration task, Migration accesses the null pointer in "current_migration" struct and qemu crashes eventually. Signed-off-by: Jia Lina Signed-off-by: Chai Wen Signed-off-by: Zhang Yu Message-Id: <20181026083620.10172-1-jialina01@baidu.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 2 +- migration/migration.h | 2 ++ migration/savevm.c | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 8b36e7f184..b261c1e4ce 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -742,7 +742,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error= **errp) * Return true if we're already in the middle of a migration * (i.e. any of the active or setup states) */ -static bool migration_is_setup_or_active(int state) +bool migration_is_setup_or_active(int state) { switch (state) { case MIGRATION_STATUS_ACTIVE: diff --git a/migration/migration.h b/migration/migration.h index f7813f8261..e413d4d8b6 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -241,6 +241,8 @@ void migrate_fd_error(MigrationState *s, const Error *e= rror); =20 void migrate_fd_connect(MigrationState *s, Error *error_in); =20 +bool migration_is_setup_or_active(int state); + void migrate_init(MigrationState *s); bool migration_is_blocked(Error **errp); /* True if outgoing migration has entered postcopy phase */ diff --git a/migration/savevm.c b/migration/savevm.c index 9992af4db4..ef707b8c43 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1327,21 +1327,25 @@ static int qemu_savevm_state(QEMUFile *f, Error **e= rrp) MigrationState *ms =3D migrate_get_current(); MigrationStatus status; =20 - migrate_init(ms); - - ms->to_dst_file =3D f; + if (migration_is_setup_or_active(ms->state) || + ms->state =3D=3D MIGRATION_STATUS_CANCELLING || + ms->state =3D=3D MIGRATION_STATUS_COLO) { + error_setg(errp, QERR_MIGRATION_ACTIVE); + return -EINVAL; + } =20 if (migration_is_blocked(errp)) { - ret =3D -EINVAL; - goto done; + return -EINVAL; } =20 if (migrate_use_block()) { error_setg(errp, "Block migration and snapshots are incompatible"); - ret =3D -EINVAL; - goto done; + return -EINVAL; } =20 + migrate_init(ms); + ms->to_dst_file =3D f; + qemu_mutex_unlock_iothread(); qemu_savevm_state_header(f); qemu_savevm_state_setup(f); @@ -1363,7 +1367,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) error_setg_errno(errp, -ret, "Error while writing VM state"); } =20 -done: if (ret !=3D 0) { status =3D MIGRATION_STATUS_FAILED; } else { --=20 2.19.1