From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859032; cv=none; d=zoho.com; s=zohoarc; b=hl2GXbW2Fm774L89gDE4AG2YZk5GGLpyN6K7QoxZlUkOk7jPHOQoCT/QGwxuqKv+uckNoFYmsPGpfQ9Bghyc0DrLyuxKJExZpjT5bYrgcES+Li3u26/jyeRuuVnVtl9pen1g7BaappcU4CrPC2+4W8M3vD0vtLmwgH38l1QMnno= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859032; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=d3+3BofSYGlsdM/RS7htI3ULQTff+L3rEk++IamGR/c=; b=Kvp8YGX61xVIhCwUl/G7DfoFAkvSLYb6G6WFHBbVkdjEMVle53Mm853E4wMKG0cMkfqJ2gvyj5cjDQk4Vmg1sWv2wfLsLRqaN/vqdufo1cu6yMazoY+T+Sc8aBkh7IZzVvlA3WceYmFfuwINEQI5/+mv+jhgDt0crAPswnLkm9I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 15578590328748.415673591562609; Tue, 14 May 2019 11:37:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:52393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcIS-0007zi-R3 for importer@patchew.org; Tue, 14 May 2019 14:37:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcGU-0006Op-0W for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcGT-0000Qs-2W for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59298) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcGS-0000Pt-SK for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A65430833DF; Tue, 14 May 2019 18:35:00 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2B5A608AB; Tue, 14 May 2019 18:34:58 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:39 +0100 Message-Id: <20190514183454.12758-2-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 14 May 2019 18:35:00 +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 01/16] migration: comment VMSTATE_UNUSED*() properly 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: Peter Xu It is error prone to use VMSTATE_UNUSED*() sometimes especially when the size of the migration stream of the field is not the same as the size of the structure (boolean is one example). Comment it well so people will be aware of this when people want to use it. Signed-off-by: Peter Xu Message-Id: <20190329095713.14177-1-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/vmstate.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index a668ec75b8..9224370ed5 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1035,6 +1035,20 @@ extern const VMStateInfo vmstate_info_qtailq; #define VMSTATE_BUFFER_UNSAFE(_field, _state, _version, _size) \ VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, vmstate_info_buff= er, _size) =20 +/* + * These VMSTATE_UNUSED*() macros can be used to fill in the holes + * when some of the vmstate fields are obsolete to be compatible with + * migrations between new/old binaries. + * + * CAUTION: when using any of the VMSTATE_UNUSED*() macros please be + * sure that the size passed in is the size that was actually *sent* + * rather than the size of the *structure*. One example is the + * boolean type - the size of the structure can vary depending on the + * definition of boolean, however the size we actually sent is always + * 1 byte (please refer to implementation of VMSTATE_BOOL_V and + * vmstate_info_bool). So here we should always pass in size=3D=3D1 + * rather than size=3D=3Dsizeof(bool). + */ #define VMSTATE_UNUSED_V(_v, _size) \ VMSTATE_UNUSED_BUFFER(NULL, _v, _size) =20 --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859032; cv=none; d=zoho.com; s=zohoarc; b=GVDfTpTixT4h2r+uHNnsvwDMKA7HVn9xwC3dIZcknQ4prAsgZ3aZNuL24HGvglPnudTXqt8aTuNb+OGTBuDkcX6T8+DkHc9XHkCIYos4psCZlJdapvW+JyixQwAACZOS77ZWez5eC5bA7xjwmgo8o3Xvo/Xeb8egLGacCcutoyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859032; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lRjCnuEd8T4WOZW45A6FEAZg8kYMnkwsQ/jRuZEDNlM=; b=jj6VSoRf9F5UEESb9d6RBnfGy6XoxXB28GoQn2IFw2U5ws91xRMAGIBHYVejrDJ9j1d0rZ/kR78wElJAssyesw2z9U3TkMushv3bcHg0gBm/WggxGMVX2hffeQkgbBj8OmrHoxRj0aTySxDZJIxi8XH1GAFX/Gev0IPMy1dSWOA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859032905367.0914148868018; Tue, 14 May 2019 11:37:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:52397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcIW-00085B-P9 for importer@patchew.org; Tue, 14 May 2019 14:37:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcGV-0006PV-PR for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcGU-0000VR-Ru for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcGU-0000UT-MU for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:02 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01CD730018E9; Tue, 14 May 2019 18:35:02 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70E80608AB; Tue, 14 May 2019 18:35:00 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:40 +0100 Message-Id: <20190514183454.12758-3-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 14 May 2019 18:35:02 +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 02/16] migration: not necessary to check ops again 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: Wei Yang During each iteration, se->ops is checked before each loop. So it is not necessary to check it again and simplify the following check a little. Signed-off-by: Wei Yang Message-Id: <20190327013130.26259-1-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 34bcad3807..587fec8ce2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1157,15 +1157,13 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool pos= tcopy) if (!se->ops || !se->ops->save_live_iterate) { continue; } - if (se->ops && se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (se->ops->is_active && + !se->ops->is_active(se->opaque)) { + continue; } - if (se->ops && se->ops->is_active_iterate) { - if (!se->ops->is_active_iterate(se->opaque)) { - continue; - } + if (se->ops->is_active_iterate && + !se->ops->is_active_iterate(se->opaque)) { + continue; } /* * In the postcopy phase, any device that doesn't know how to --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859152; cv=none; d=zoho.com; s=zohoarc; b=j/XdUbvHDKp2JpIPDdAhuOOFkq7YTaHnnDXuKD6hP/C4aHec+0cAi4uNt8P2EujBRA/IH3ACGALI/wzVeXnukcADaIJC91mLbKYdXBwv/I0qNmLLiba93UVrZ6NVJJWSfDGSTejaBmIwWxYfYptG+DSwV5fFiH5/n0W9ip+FRTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859152; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vKnKv0iL8QL+jEHWpeueV3Dk3R6/8DrMeHpuCtPLrEg=; b=EaPKAaCOoiJHJ9UMceotrZTuv6gGZ7LUaQxmAYHKZo3LQbOImW6x/tCEQlrBqou052lJ+c69M7NC1TMs6XjW1EQgw/0ZjNL69tiiZck3MXoaFk9pVBIYr/O5Yft70iwptnE/f60eHiDfvyocMsPVFLmVATCP9DXJhTrApMkREdA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155785915299372.32589997758566; Tue, 14 May 2019 11:39:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:52417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcKT-0001Ra-PB for importer@patchew.org; Tue, 14 May 2019 14:39:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcGX-0006Ra-P2 for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcGW-0000Z9-Sc for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50354) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcGW-0000Xr-Mk for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C58893087BD2; Tue, 14 May 2019 18:35:03 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40BDA608A6; Tue, 14 May 2019 18:35:02 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:41 +0100 Message-Id: <20190514183454.12758-4-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 14 May 2019 18:35:04 +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 03/16] migration: remove not used field xfer_limit 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: Wei Yang MigrationState->xfer_limit is only set to 0 in migrate_init(). Remove this unnecessary field. Signed-off-by: Wei Yang Message-Id: <20190326055726.10539-1-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 1 - migration/migration.h | 1 - 2 files changed, 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 609e0df5d0..4844ad438b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1681,7 +1681,6 @@ void migrate_init(MigrationState *s) * locks. */ s->bytes_xfer =3D 0; - s->xfer_limit =3D 0; s->cleanup_bh =3D 0; s->to_dst_file =3D NULL; s->state =3D MIGRATION_STATUS_NONE; diff --git a/migration/migration.h b/migration/migration.h index 438f17edad..780a096857 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -117,7 +117,6 @@ struct MigrationState =20 /*< public >*/ size_t bytes_xfer; - size_t xfer_limit; QemuThread thread; QEMUBH *cleanup_bh; QEMUFile *to_dst_file; --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859196; cv=none; d=zoho.com; s=zohoarc; b=VzdHZQqUBHDxFqTPHBjsMnjsi6b3+sI0dB++ykZC2WStWAPJZcF/vp+n6ZMiOstUbp33kNbt+h1sfzIR6ftFR/tcxudErgkqldEnP5VZFkD39m4cLV8jajU15NG8idEOTr2snGbvfB+wGukR0Q4N2wmvX7KQm5TKzv1ALmvkdfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859196; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6CCZpnF3hrL0EVBZErNU5i8vXbyk1oZgyHRLbVMkD8Q=; b=B7rd7B4nr5SfBOcRDG4q4rho7DxceJErvmHg7et/IrFyYG+U61dGtVsr5d36h/88jTQFnUUxwn/KhERm7aSMqUROb1vDQywwbtp2slh1jaJmZmN1JW/6znNQMdhOw42E6gBPiwUmQXsxMEmmkbBJaI6LKh0KGkUzAQHy/2nZ3Xk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859196545739.4580495808636; Tue, 14 May 2019 11:39:56 -0700 (PDT) Received: from localhost ([127.0.0.1]:52419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcLB-00024k-ES for importer@patchew.org; Tue, 14 May 2019 14:39:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcGZ-0006TG-DN for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcGY-0000ax-Fc for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56804) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcGY-0000aN-A2 for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A4D7300C22E; Tue, 14 May 2019 18:35:05 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AB6B67668; Tue, 14 May 2019 18:35:03 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:42 +0100 Message-Id: <20190514183454.12758-5-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 14 May 2019 18:35:05 +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 04/16] vmstate: check subsection_found is enough 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: Wei Yang subsection_found is true implies vmdesc is not NULL. This patch remove the additional check on vmdesc and rename subsection_found to vmdesc_has_subsections to make it more self-explain. Signed-off-by: Wei Yang Message-Id: <20190403011016.12549-1-richardw.yang@linux.intel.com> Acked-by: Stefano Garzarella Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/vmstate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index e2bbb7b5f7..1305d1a528 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -496,7 +496,7 @@ static int vmstate_subsection_save(QEMUFile *f, const V= MStateDescription *vmsd, void *opaque, QJSON *vmdesc) { const VMStateDescription **sub =3D vmsd->subsections; - bool subsection_found =3D false; + bool vmdesc_has_subsections =3D false; int ret =3D 0; =20 trace_vmstate_subsection_save_top(vmsd->name); @@ -508,9 +508,9 @@ static int vmstate_subsection_save(QEMUFile *f, const V= MStateDescription *vmsd, trace_vmstate_subsection_save_loop(vmsd->name, vmsdsub->name); if (vmdesc) { /* Only create subsection array when we have any */ - if (!subsection_found) { + if (!vmdesc_has_subsections) { json_start_array(vmdesc, "subsections"); - subsection_found =3D true; + vmdesc_has_subsections =3D true; } =20 json_start_object(vmdesc, NULL); @@ -533,7 +533,7 @@ static int vmstate_subsection_save(QEMUFile *f, const V= MStateDescription *vmsd, sub++; } =20 - if (vmdesc && subsection_found) { + if (vmdesc_has_subsections) { json_end_array(vmdesc); } =20 --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859366; cv=none; d=zoho.com; s=zohoarc; b=EiD4S2Q+EzKducr01jdoEKRG6mjXs8coxx2PwzAwHGmFMBM+tkQlupv897mqspVwES8NGX9TB/loqBhK4QmymPMR91/vSydI5rotuj9kFVqY8Qtjaxmm6xofWiKXkb3czC6WcY7SlGeT0qhnyRfd0ejNuR+6kqWJTY0Cp7sOdG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859366; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=utV0KpF9vL5n9ScPwM2bqLWztYgBQzVKvTgaVsqWaBw=; b=k5xHlORvZnq4atHMX2+YSPqCHxmjXxGZkM1riTGbw0PTHNtyQYYPU7IqJovxOXFaTcGTF3K4zIfXpGqfnY58T05k0M3x6J9bR+4vYdEnEcZ+puq7K8S/5CITFBTboZ63jbPdJjHJqR73pbLHfKr5QJoNaPgAE2cLnLAEGfXqN6s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859366436194.75722788108078; Tue, 14 May 2019 11:42:46 -0700 (PDT) Received: from localhost ([127.0.0.1]:52475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcNo-0004Yz-DN for importer@patchew.org; Tue, 14 May 2019 14:42:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcH0-0006t9-Uq for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcH0-0001IR-3T for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49850) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcGz-0001Hf-Ub for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BCCE309B15D; Tue, 14 May 2019 18:35:33 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6CDB608BA; Tue, 14 May 2019 18:35:05 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:43 +0100 Message-Id: <20190514183454.12758-6-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 14 May 2019 18:35:33 +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 05/16] migration: savevm: fix error code with migration blockers 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: Cole Robinson The only caller that checks the error code is looking for !=3D 0, so returning false is incorrect. Fixes: 5aaac467938 "migration: savevm: consult migration blockers" Signed-off-by: Cole Robinson Message-Id: Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 587fec8ce2..81a9a2ef30 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2542,7 +2542,7 @@ int save_snapshot(const char *name, Error **errp) AioContext *aio_context; =20 if (migration_is_blocked(errp)) { - return false; + return ret; } =20 if (!replay_can_snapshot()) { --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859515; cv=none; d=zoho.com; s=zohoarc; b=Ux0lQWrBF2+0IoVJ4GjKOq8SDQBmJo9UfFHG3QmxCQWVch4HOut/ls3hG3TXxNz4mJoeMXWjmrrmvg7P5d72D4o61lAe0RbiNxqULVF1asvLakEI8d8J/YJ8ZPjvdT2ADZIlE5hM9FWmHBtmB6dfU+r3AKw+/LKBqDUUazobuQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859515; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4I7DABaHB6d+JGRi6lYXxGOlUDVDKIB5p9XTsEuyyi8=; b=ZoBv6S9tJ4wgOfZrCq38xYntDtIMU9J6FoJuemJ7hxIKauRemU9Ijjbr1TAGJ0QZvh719AAyLCrtc3nC78xYUuw+gwl1p+G4MEdIFwWxvJB84vNJPdhASzKIiLqeatPVdW8nd4RUK0U+vS6Kjxqh8mjXngoSoecRIY1mb87zd48= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859515214647.5010381543309; Tue, 14 May 2019 11:45:15 -0700 (PDT) Received: from localhost ([127.0.0.1]:52504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcQK-0006qU-4p for importer@patchew.org; Tue, 14 May 2019 14:45:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHF-00073Z-9s for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHE-0001YK-BI for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57186) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHE-0001Xa-6c for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E9FE3019880; Tue, 14 May 2019 18:35:47 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85A2A608A6; Tue, 14 May 2019 18:35:33 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:44 +0100 Message-Id: <20190514183454.12758-7-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 14 May 2019 18:35:47 +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 06/16] migration/colo.c: Remove redundant input parameter 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 The colo_do_failover no need the input parameter. Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-2-chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 +- migration/colo-failover.c | 2 +- migration/colo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/migration/colo.h b/include/migration/colo.h index 99ce17aca7..ddebe0ad27 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -37,7 +37,7 @@ bool migration_incoming_in_colo_state(void); COLOMode get_colo_mode(void); =20 /* failover */ -void colo_do_failover(MigrationState *s); +void colo_do_failover(void); =20 void colo_checkpoint_notify(void *opaque); #endif diff --git a/migration/colo-failover.c b/migration/colo-failover.c index 4854a96c92..e9ca0b4774 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -39,7 +39,7 @@ static void colo_failover_bh(void *opaque) return; } =20 - colo_do_failover(NULL); + colo_do_failover(); } =20 void failover_request_active(Error **errp) diff --git a/migration/colo.c b/migration/colo.c index 238a6d62c7..8c1644091f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -193,7 +193,7 @@ COLOMode get_colo_mode(void) } } =20 -void colo_do_failover(MigrationState *s) +void colo_do_failover(void) { /* Make sure VM stopped while failover happened. */ if (!colo_runstate_is_stopped()) { --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859202; cv=none; d=zoho.com; s=zohoarc; b=HrdgDamk1KpK0Pccsh+oetOIK83E2S0E/pUBE6GApRfwraFYYeL3o3g6LwCXScn4/iIjpVtpSitRbr7Kq3MwfTDgpegWPQ/jHzXDzm+V/E8jr4MLRpJNjZUFvAp7DrOGurKlNcm2mdQJmI9L3rtehyUSFn826OC5EOzrg9ZoRrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859202; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ub2srqNECjZv/XDv/C/ySd0BGtbd0PXRAX2qD9hW98E=; b=BvKPx3Ac8sz1w/JAYaIxmIpM7QA2jLxLPuieEEw2aCUm05tozq+7Z/8bPuhJInpFwCgY4GlGKdD37zBssm7l7VmaOR7aEasFSjJMljQA+fwN94Qn4mVVA86KawYyU2hjqhkjKP1EbyFi7dVsedYJ/PdQH6epodJ3x2DONa/NV1c= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859202387781.3505117563395; Tue, 14 May 2019 11:40:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:52423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcLH-00028I-AP for importer@patchew.org; Tue, 14 May 2019 14:39:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHH-000754-3M for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHG-0001Zx-4g for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59972) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHF-0001ZI-Vr for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D5DA307EA8E; Tue, 14 May 2019 18:35:49 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8860608A6; Tue, 14 May 2019 18:35:47 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:45 +0100 Message-Id: <20190514183454.12758-8-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 14 May 2019 18:35:49 +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 07/16] migration/colo.h: Remove obsolete codes 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 Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-3-chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/migration/colo.h b/include/migration/colo.h index ddebe0ad27..f6fbe23ec9 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -22,8 +22,6 @@ enum colo_event { COLO_EVENT_FAILOVER, }; =20 -void colo_info_init(void); - void migrate_start_colo_process(MigrationState *s); bool migration_in_colo_state(void); =20 --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859200; cv=none; d=zoho.com; s=zohoarc; b=Nu+aKWUDQgBTkURSuGHG4+w5bA0OMqBnHBbIy7azb6A4yTALvaGNIYqLRoeX76xyccH8k524HOvJfTSK1S6CWPQ9ZqLx15P/4my7EXv8R3jKaApvzo2dMWPj3HSH+4fJ1NgdYINWoOVmuXk7GQeB0etTaJneE+o3fGdAFmHBEy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859200; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=v0+CWtYyUgjKQO3TVfD1FhXypeTC0RpoCEGB4FC6hXE=; b=EIF6Wi3JIhrPNQjXQTktYqqdtd3U4ndnO9iiT604bvNiYnKGl+z/K6X5ZeE51Mph82pBAEAwRDvZMa+hAvXLICMpetAw0MLryoIjOL+jkvJjzVo8o29cuqXIssesdDCxAVsrLCaj9b0s/l3ST8noeflUWWCpSNIO9g7ZVwLQuXA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859200619555.0858538071142; Tue, 14 May 2019 11:40:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:52421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcLD-00025N-Gl for importer@patchew.org; Tue, 14 May 2019 14:39:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHJ-00075D-DQ for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHH-0001eE-VU for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHH-0001cw-Px for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1ADD5309702E; Tue, 14 May 2019 18:35:51 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94A02608A6; Tue, 14 May 2019 18:35:49 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:46 +0100 Message-Id: <20190514183454.12758-9-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 14 May 2019 18:35:51 +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 08/16] qemu-option.hx: Update missed parameter for colo-compare 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 We missed the iothread related args in this file. This patch is used to fix this issue. Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-4-chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- qemu-options.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 51802cbb26..3faa935929 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4425,13 +4425,15 @@ Dump the network traffic on netdev @var{dev} to the= file specified by The file format is libpcap, so it can be analyzed with tools such as tcpdu= mp or Wireshark. =20 -@item -object colo-compare,id=3D@var{id},primary_in=3D@var{chardevid},seco= ndary_in=3D@var{chardevid},outdev=3D@var{chardevid}[,vnet_hdr_support] +@item -object colo-compare,id=3D@var{id},primary_in=3D@var{chardevid},seco= ndary_in=3D@var{chardevid},outdev=3D@var{chardevid},iothread=3D@var{id}[,vn= et_hdr_support] =20 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@v= ar{chardevid}, than compare primary packet with secondary packet. If the packets are same, we will output primary packet to outdev@var{chardevid}, else we will notify colo-frame do checkpoint and send primary packet to outdev@var{chardevid}. -if it has the vnet_hdr_support flag, colo compare will send/recv packet wi= th vnet_hdr_len. +In order to improve efficiency, we need to put the task of comparison +in another thread. If it has the vnet_hdr_support flag, colo compare +will send/recv packet with vnet_hdr_len. =20 we must use it with the help of filter-mirror and filter-redirector. =20 @@ -4446,10 +4448,11 @@ primary: -chardev socket,id=3Dcompare0-0,host=3D3.3.3.3,port=3D9001 -chardev socket,id=3Dcompare_out,host=3D3.3.3.3,port=3D9005,server,nowait -chardev socket,id=3Dcompare_out0,host=3D3.3.3.3,port=3D9005 +-object iothread,id=3Diothread1 -object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirror0 -object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,indev=3Dcom= pare_out -object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outdev=3Dco= mpare0 --object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_in=3Dcom= pare1,outdev=3Dcompare_out0 +-object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_in=3Dcom= pare1,outdev=3Dcompare_out0,iothread=3Diothread1 =20 secondary: -netdev tap,id=3Dhn0,vhost=3Doff,script=3D/etc/qemu-ifup,down script=3D/et= c/qemu-ifdown --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859366; cv=none; d=zoho.com; s=zohoarc; b=jG3vGU3XUGXVb58JSKP13hbGlQHc+lIBIbGYApHL57MWreHK8X8FSjXOa3iBmy6AwJem3jR4Lix5ysgf+KeQ9z87klQFXNQ0sxmupsqtasNLSO8b5t2hYISMaLkfZYqo8yY0HZueNWftN/JL8rkGqpLZpijQmLe6xrig7ck1C58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859366; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1S0tratmM+ZfOAPmkNQxwfAZx79m7XEdQt8GOLNSFcM=; b=d4+M6DxFjKV0SfbzYIvN+SqlRN5+GLZw5mgMRUwut+3TpI2HODpv/iS27fTsvFBe8P2iWtmDI6rRkXd2It8H/BNeocikGg4/bVtURZ7RhNJXwONT6HT+TvDiLW/mo/+PBW1wIs0omeuof7Pw7pEXviqdm+BKfdW0SPGXldNt+n0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155785936628250.00454012666444; Tue, 14 May 2019 11:42:46 -0700 (PDT) Received: from localhost ([127.0.0.1]:52479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcNs-0004cf-8l for importer@patchew.org; Tue, 14 May 2019 14:42:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHK-00077v-Jr for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHJ-0001gM-NW for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17723) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHJ-0001fZ-I4 for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBD98C049E20; Tue, 14 May 2019 18:35:52 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 639A9608B9; Tue, 14 May 2019 18:35:51 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:47 +0100 Message-Id: <20190514183454.12758-10-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 May 2019 18:35:52 +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 09/16] migration/ram.c: start of migration_bitmap_sync_range is always 0 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: Wei Yang We can eliminate to pass 0. Signed-off-by: Wei Yang Message-Id: <20190430034412.12935-2-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 1ca9ba77b6..ec11161d58 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1681,10 +1681,10 @@ static inline bool migration_bitmap_clear_dirty(RAM= State *rs, } =20 static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb, - ram_addr_t start, ram_addr_t lengt= h) + ram_addr_t length) { rs->migration_dirty_pages +=3D - cpu_physical_memory_sync_dirty_bitmap(rb, start, length, + cpu_physical_memory_sync_dirty_bitmap(rb, 0, length, &rs->num_dirty_pages_period); } =20 @@ -1773,7 +1773,7 @@ static void migration_bitmap_sync(RAMState *rs) qemu_mutex_lock(&rs->bitmap_mutex); rcu_read_lock(); RAMBLOCK_FOREACH_NOT_IGNORED(block) { - migration_bitmap_sync_range(rs, block, 0, block->used_length); + migration_bitmap_sync_range(rs, block, block->used_length); } ram_counters.remaining =3D ram_bytes_remaining(); rcu_read_unlock(); @@ -4196,7 +4196,7 @@ static void colo_flush_ram_cache(void) memory_global_dirty_log_sync(); rcu_read_lock(); RAMBLOCK_FOREACH_NOT_IGNORED(block) { - migration_bitmap_sync_range(ram_state, block, 0, block->used_lengt= h); + migration_bitmap_sync_range(ram_state, block, block->used_length); } rcu_read_unlock(); =20 --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859363; cv=none; d=zoho.com; s=zohoarc; b=UOsfpQQC4nTuHTrxJT9xoceCqr+u7Et5YIA7TSGYhgXc9y0ODxJbHRSKE9ycCfun5NZXqLxqm4IPjZ0e7HU1urWRGZ3Pj1bumCJQNFmQfq/2RSPd+Zv8cqOdQUAunvmmXfPMWLi1rNDy10kLNvEyTjPFXQSk7aN2s2HCRLtPUSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859363; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lZkFkfrRVX6dd28dEotqtT6eGIpgXd9CY+H/Cewa2Yw=; b=iqfd6433J/hPTSvx+EjcKulvgpH8DimAbEmmBFeOi6Bap6G5yKrfUh+RepB83k30YWWn2TPbdHgS8ZkrCGYfpmpsqPpP+ylt+LlZX6WaANoE2lU0VMgz7Ce/uWlgBzGDwN8mPjSs5sWUBfWlCMg+5eShOQsGiz7BHEHA9982Phg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859363981325.52579541477473; Tue, 14 May 2019 11:42:43 -0700 (PDT) Received: from localhost ([127.0.0.1]:52477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcNq-0004aA-0Y for importer@patchew.org; Tue, 14 May 2019 14:42:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHM-0007Ac-Pw for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHL-0001iK-HE for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHL-0001hs-C6 for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEBA4882F2; Tue, 14 May 2019 18:35:54 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3129B608AC; Tue, 14 May 2019 18:35:53 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:48 +0100 Message-Id: <20190514183454.12758-11-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 14 May 2019 18:35:54 +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 10/16] migration: update comments of migration bitmap 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: Yi Wang Since the ram bitmap and the unsent bitmap are split by RAMBlock in commit 6b6712e, it's better to update the comments about them. Signed-off-by: Yi Wang Message-Id: <1555311089-18610-1-git-send-email-wang.yi59@zte.com.cn> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index ec11161d58..e1fe45311d 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1630,8 +1630,6 @@ static int save_xbzrle_page(RAMState *rs, uint8_t **c= urrent_data, /** * migration_bitmap_find_dirty: find the next dirty page from start * - * Called with rcu_read_lock() to protect migration_bitmap - * * Returns the byte offset within memory region of the start of a dirty pa= ge * * @rs: current RAM state @@ -2681,7 +2679,7 @@ static void ram_save_cleanup(void *opaque) RAMBlock *block; =20 /* caller have hold iothread lock or is in a bh, so there is - * no writing race against this migration_bitmap + * no writing race against the migration bitmap */ memory_global_dirty_log_stop(); =20 --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859705; cv=none; d=zoho.com; s=zohoarc; b=e/WUl8jm3WiSCdr9tCN1PcVZsxfwDUbdWnisNrx8MtxItihqgs89R5jl2X58sWvU+Bagd+8NhysCg6Aq447BmmBtHAWJ5w7KVViqBqEfXIoy5EVAxuIqeeGRVV94Kac04bVciMTF9KPcevilhKqCOvzfPSeCptqELSiNZIQGSrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859705; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=R4Q5l7Le/Na1VDmwFhrfcCRABg/ho0EigxlEsryeUxk=; b=Jk1pud5gvRxJbgiFf58sCBfKY99g/xk43MQbd03z3eGtxexCgjm0RGXLs6W7G9A9pmLJCMizJ4nWBlqVPYbAwmgg/asoYTLhguJ/07oBZXrFF5o1CsQZNabru5qWI5sRVHJKuwu3Gw4JzBp0hHotBujaFYCC1prlhrPou+ggD8M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859705285302.96649192558596; Tue, 14 May 2019 11:48:25 -0700 (PDT) Received: from localhost ([127.0.0.1]:52565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcSv-00017v-Id for importer@patchew.org; Tue, 14 May 2019 14:47:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHO-0007Dx-7t for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHN-0001kZ-Bt for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10755) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHN-0001jp-6e for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8092E19D05D; Tue, 14 May 2019 18:35:56 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03EC2608A6; Tue, 14 May 2019 18:35:54 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:49 +0100 Message-Id: <20190514183454.12758-12-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 14 May 2019 18:35:56 +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 11/16] migration/savevm: remove duplicate check of migration_is_blocked 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: Wei Yang Current call flow of save_snapshot is: save_snapshot migration_is_blocked qemu_savevm_state migration_is_blocked Since qemu_savevm_state is only called in save_snapshot, this means migration_is_blocked has been already checked. Signed-off-by: Wei Yang Message-Id: <20190424004700.12766-2-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 81a9a2ef30..6e8912af49 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1418,10 +1418,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **er= rp) return -EINVAL; } =20 - if (migration_is_blocked(errp)) { - return -EINVAL; - } - if (migrate_use_block()) { error_setg(errp, "Block migration and snapshots are incompatible"); return -EINVAL; --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859321; cv=none; d=zoho.com; s=zohoarc; b=EgDSUzQLThF82AqXaXTkIAp3fX1b3IRJpO2t3YZY2hPFSO+15cLShXbvgyMwRaSp4KZPIvT70xHoFuuy5VNKLVi3ocjwvvoE8ydbHFnou0p+9IYWAhUTgNcZHRl1I1VXuxv+WSxzEGtr8HygfcvSd3s8ltsUyEgeUXMWqcXK09c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859321; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=h4nqLuH9dvjKd6T+VmuB7Ck43mvZ0NA0eQtFKcfTeIA=; b=T5tHGv8PUfH7Gh9ZrHU5AOtdGw1jsoiqUM+O5yJ496AxYP23BLeeT2bXfUIhIlUTvElm+Z2eNXYWEAHj6Q3MWQYI8dZnaYSw+e/EYQQdC7YGwrg6owXtN0bEpzTIxy+QPdeVmiCOHA80ewlzzTD8MYL/aWfEZykQKdAuvdc0KVY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859321429390.8838405233612; Tue, 14 May 2019 11:42:01 -0700 (PDT) Received: from localhost ([127.0.0.1]:52473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcN9-0003vH-BD for importer@patchew.org; Tue, 14 May 2019 14:41:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHQ-0007H9-3Z for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHP-0001mq-6Z for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHP-0001lq-0v for qemu-devel@nongnu.org; Tue, 14 May 2019 14:35:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BCCF33026D; Tue, 14 May 2019 18:35:58 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6FC1608A6; Tue, 14 May 2019 18:35:56 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:50 +0100 Message-Id: <20190514183454.12758-13-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 14 May 2019 18:35:58 +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 12/16] migration/savevm: load_header before load_setup 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: Wei Yang In migration_thread() and qemu_savevm_state(), we savevm_state in following sequence: qemu_savevm_state_header(f); qemu_savevm_state_setup(f); Then it would be more proper to loadvm_state in the save sequence. Signed-off-by: Wei Yang Message-Id: <20190424004700.12766-4-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 6e8912af49..4c7b8379e8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2434,10 +2434,6 @@ int qemu_loadvm_state(QEMUFile *f) return -ENOTSUP; } =20 - if (qemu_loadvm_state_setup(f) !=3D 0) { - return -EINVAL; - } - if (migrate_get_current()->send_configuration) { if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { error_report("Configuration section missing"); @@ -2452,6 +2448,10 @@ int qemu_loadvm_state(QEMUFile *f) } } =20 + if (qemu_loadvm_state_setup(f) !=3D 0) { + return -EINVAL; + } + cpu_synchronize_all_pre_loadvm(); =20 ret =3D qemu_loadvm_state_main(f, mis); --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859518; cv=none; d=zoho.com; s=zohoarc; b=Ohc1gqM0Nn7fMAqXj3K+pt3iceL9hSdqR/fX77EeSIvdv6baeVo7KWCHGEZw7iomeXqQyrqaOCNkCIoTdW8Wbn0bIn/xjcrfnJeARiHlB7M8LICEs2pDycwN0mfejrHyaS8uw6PSidwt2ylGBh8U0ME9ByFj8FYq2d4RUMkRmsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859518; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=FE6F0fpWzsw7GwPS4fGhaKBKQJe0joz8rj6RglIpRKw=; b=MJM6s02qNAAsGEE0sfpH7xN1C+K30jz7QOdkW2cz+/1gKO6F4TZMgf7/NMokgZ5RKXchljI7kfG1HfvcfGzjK+Tz7r3Yl18reeBD/iVwIKpqPaEoEZHRTuc1fL1IBNS+1i4xngd/+y0j/gnINhix9Uau9n9ozfpKBtnJGMNCYds= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859518543222.5268185487006; Tue, 14 May 2019 11:45:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:52506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcQN-0006sW-CZ for importer@patchew.org; Tue, 14 May 2019 14:45:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHU-0007Os-Hx for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHT-0001rS-Gh for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHT-0001pz-9B for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82CBD3079B6B; Tue, 14 May 2019 18:36:02 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94661608B9; Tue, 14 May 2019 18:35:58 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:51 +0100 Message-Id: <20190514183454.12758-14-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 14 May 2019 18:36:02 +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 13/16] migration/savevm: wrap into qemu_loadvm_state_header() 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: Wei Yang On source side, we have qemu_savevm_state_header() to send related data, while on the receiving side those steps are scattered in qemu_loadvm_state(). This patch wrap those related steps into qemu_loadvm_state_header() to make it friendly to read. Signed-off-by: Wei Yang Message-Id: <20190424004700.12766-5-richardw.yang@linux.intel.com> Reviewed-by: Daniel Henrique Barboza Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 69 +++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 4c7b8379e8..c0e557b4c2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2262,6 +2262,43 @@ qemu_loadvm_section_part_end(QEMUFile *f, MigrationI= ncomingState *mis) return 0; } =20 +static int qemu_loadvm_state_header(QEMUFile *f) +{ + unsigned int v; + int ret; + + v =3D qemu_get_be32(f); + if (v !=3D QEMU_VM_FILE_MAGIC) { + error_report("Not a migration stream"); + return -EINVAL; + } + + v =3D qemu_get_be32(f); + if (v =3D=3D QEMU_VM_FILE_VERSION_COMPAT) { + error_report("SaveVM v2 format is obsolete and don't work anymore"= ); + return -ENOTSUP; + } + if (v !=3D QEMU_VM_FILE_VERSION) { + error_report("Unsupported migration stream version"); + return -ENOTSUP; + } + + if (migrate_get_current()->send_configuration) { + if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { + error_report("Configuration section missing"); + qemu_loadvm_state_cleanup(); + return -EINVAL; + } + ret =3D vmstate_load_state(f, &vmstate_configuration, &savevm_stat= e, 0); + + if (ret) { + qemu_loadvm_state_cleanup(); + return ret; + } + } + return 0; +} + static int qemu_loadvm_state_setup(QEMUFile *f) { SaveStateEntry *se; @@ -2410,7 +2447,6 @@ int qemu_loadvm_state(QEMUFile *f) { MigrationIncomingState *mis =3D migration_incoming_get_current(); Error *local_err =3D NULL; - unsigned int v; int ret; =20 if (qemu_savevm_state_blocked(&local_err)) { @@ -2418,34 +2454,9 @@ int qemu_loadvm_state(QEMUFile *f) return -EINVAL; } =20 - v =3D qemu_get_be32(f); - if (v !=3D QEMU_VM_FILE_MAGIC) { - error_report("Not a migration stream"); - return -EINVAL; - } - - v =3D qemu_get_be32(f); - if (v =3D=3D QEMU_VM_FILE_VERSION_COMPAT) { - error_report("SaveVM v2 format is obsolete and don't work anymore"= ); - return -ENOTSUP; - } - if (v !=3D QEMU_VM_FILE_VERSION) { - error_report("Unsupported migration stream version"); - return -ENOTSUP; - } - - if (migrate_get_current()->send_configuration) { - if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { - error_report("Configuration section missing"); - qemu_loadvm_state_cleanup(); - return -EINVAL; - } - ret =3D vmstate_load_state(f, &vmstate_configuration, &savevm_stat= e, 0); - - if (ret) { - qemu_loadvm_state_cleanup(); - return ret; - } + ret =3D qemu_loadvm_state_header(f); + if (ret) { + return ret; } =20 if (qemu_loadvm_state_setup(f) !=3D 0) { --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859812; cv=none; d=zoho.com; s=zohoarc; b=Ig8COPxyED9VFE02CvZA/2Me21koqBxWFmvjNYobEXBaNIuZ+JoJrSglkVm2fAXVverTKfh0Jmykmx/8tZ0A0WqhjhlXFKRpelCDta2W3E5IHixZDRq2i3JFOONSFViUro+uuH1/Pbin3G/M5a5H6n8jVRh7OGlv8VhzCY/9MvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859812; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=+yY+JZBE+QKm8IjckdHlJr7eAQKO9Jr0wQ5TRwtjq1g=; b=e37olc8RiRZ96RPUri6qHigL3Ld+KWZhqq3oAnXBXUZ+LjMLF9wTUiN8L1CTLRRyDzuhIIMEDbOttqH4/pYwIV/znjs6wraazWBMLnAUHtd3k5NhYnbY8n1bMi4kiJHVfkmEO0FhhqlmJMRaKFdL2mRFTv99tdWluUm0N41L9pk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859812791195.9156126214658; Tue, 14 May 2019 11:50:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:52589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcV4-0002fd-Oc for importer@patchew.org; Tue, 14 May 2019 14:50:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHX-0007S3-Vn for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHW-0001uI-Ie for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37922) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHW-0001tl-B5 for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A25C0307D979; Tue, 14 May 2019 18:36:05 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id C46E7608A6; Tue, 14 May 2019 18:36:02 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:52 +0100 Message-Id: <20190514183454.12758-15-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 14 May 2019 18:36:05 +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 14/16] migration: Fix use-after-free during process exit 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: Yury Kotov It fixes heap-use-after-free which was found by clang's ASAN. Control flow of this use-after-free: main_thread: * Got SIGTERM and completes main loop * Calls migration_shutdown - migrate_fd_cancel (so, migration_thread begins to complete) - object_unref(OBJECT(current_migration)); migration_thread: * migration_iteration_finish -> schedule cleanup bh * object_unref(OBJECT(s)); (Now, current_migration is freed) * exits main_thread: * Calls vm_shutdown -> drain bdrvs -> main loop -> cleanup_bh -> use after free If you want to reproduce, these couple of sleeps will help: vl.c:4613: migration_shutdown(); + sleep(2); migration.c:3269: + sleep(1); trace_migration_thread_after_loop(); migration_iteration_finish(s); Original output: qemu-system-x86_64: terminating on signal 15 from pid 31980 () =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D31958=3D=3DERROR: AddressSanitizer: heap-use-after-free on address 0x= 61900001d210 at pc 0x555558a535ca bp 0x7fffffffb190 sp 0x7fffffffb188 READ of size 8 at 0x61900001d210 thread T0 (qemu-vm-0) #0 0x555558a535c9 in migrate_fd_cleanup migration/migration.c:1502:23 #1 0x5555594fde0a in aio_bh_call util/async.c:90:5 #2 0x5555594fe522 in aio_bh_poll util/async.c:118:13 #3 0x555559524783 in aio_poll util/aio-posix.c:725:17 #4 0x555559504fb3 in aio_wait_bh_oneshot util/aio-wait.c:71:5 #5 0x5555573bddf6 in virtio_blk_data_plane_stop hw/block/dataplane/virtio-blk.c:282:5 #6 0x5555589d5c09 in virtio_bus_stop_ioeventfd hw/virtio/virtio-bus.c:2= 46:9 #7 0x5555589e9917 in virtio_pci_stop_ioeventfd hw/virtio/virtio-pci.c:2= 87:5 #8 0x5555589e22bf in virtio_pci_vmstate_change hw/virtio/virtio-pci.c:1= 072:9 #9 0x555557628931 in virtio_vmstate_change hw/virtio/virtio.c:2257:9 #10 0x555557c36713 in vm_state_notify vl.c:1605:9 #11 0x55555716ef53 in do_vm_stop cpus.c:1074:9 #12 0x55555716eeff in vm_shutdown cpus.c:1092:12 #13 0x555557c4283e in main vl.c:4617:5 #14 0x7fffdfdb482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #15 0x555556ecb118 in _start (x86_64-softmmu/qemu-system-x86_64+0x19771= 18) 0x61900001d210 is located 144 bytes inside of 952-byte region [0x61900001d180,0x61900001d538) freed by thread T6 (live_migration) here: #0 0x555556f76782 in __interceptor_free /tmp/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.c= c:124:3 #1 0x555558d5fa94 in object_finalize qom/object.c:618:9 #2 0x555558d57651 in object_unref qom/object.c:1068:9 #3 0x555558a55588 in migration_thread migration/migration.c:3272:5 #4 0x5555595393f2 in qemu_thread_start util/qemu-thread-posix.c:502:9 #5 0x7fffe057f6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.= 0+0x76b9) previously allocated by thread T0 (qemu-vm-0) here: #0 0x555556f76b03 in __interceptor_malloc /tmp/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.c= c:146:3 #1 0x7ffff6ee37b8 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0= x4f7b8) #2 0x555558d58031 in object_new qom/object.c:640:12 #3 0x555558a31f21 in migration_object_init migration/migration.c:139:25 #4 0x555557c41398 in main vl.c:4320:5 #5 0x7fffdfdb482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6= +0x2082f) Thread T6 (live_migration) created by T0 (qemu-vm-0) here: #0 0x555556f5f0dd in pthread_create /tmp/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.c= c:210:3 #1 0x555559538cf9 in qemu_thread_create util/qemu-thread-posix.c:539:11 #2 0x555558a53304 in migrate_fd_connect migration/migration.c:3332:5 #3 0x555558a72bd8 in migration_channel_connect migration/channel.c:92:5 #4 0x555558a6ef87 in exec_start_outgoing_migration migration/exec.c:42:5 #5 0x555558a4f3c2 in qmp_migrate migration/migration.c:1922:9 #6 0x555558bb4f6a in qmp_marshal_migrate qapi/qapi-commands-migration.c= :607:5 #7 0x555559363738 in do_qmp_dispatch qapi/qmp-dispatch.c:131:5 #8 0x555559362a15 in qmp_dispatch qapi/qmp-dispatch.c:174:11 #9 0x5555571bac15 in monitor_qmp_dispatch monitor.c:4124:11 #10 0x55555719a22d in monitor_qmp_bh_dispatcher monitor.c:4207:9 #11 0x5555594fde0a in aio_bh_call util/async.c:90:5 #12 0x5555594fe522 in aio_bh_poll util/async.c:118:13 #13 0x5555595201e0 in aio_dispatch util/aio-posix.c:460:5 #14 0x555559503553 in aio_ctx_dispatch util/async.c:261:5 #15 0x7ffff6ede196 in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a196) SUMMARY: AddressSanitizer: heap-use-after-free migration/migration.c:1502:23 in migrate_fd_cleanup Shadow bytes around the buggy address: 0x0c327fffb9f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c327fffba00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c327fffba10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c327fffba20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c327fffba30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =3D>0x0c327fffba40: fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c327fffba50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c327fffba60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c327fffba70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c327fffba80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c327fffba90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc =3D=3D31958=3D=3DABORTING Signed-off-by: Yury Kotov Message-Id: <20190408113343.2370-1-yury-kotov@yandex-team.ru> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert Fixed up comment formatting --- migration/migration.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 4844ad438b..d0a0f68f11 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1495,10 +1495,8 @@ static void block_cleanup_parameters(MigrationState = *s) } } =20 -static void migrate_fd_cleanup(void *opaque) +static void migrate_fd_cleanup(MigrationState *s) { - MigrationState *s =3D opaque; - qemu_bh_delete(s->cleanup_bh); s->cleanup_bh =3D NULL; =20 @@ -1543,6 +1541,23 @@ static void migrate_fd_cleanup(void *opaque) block_cleanup_parameters(s); } =20 +static void migrate_fd_cleanup_schedule(MigrationState *s) +{ + /* + * Ref the state for bh, because it may be called when + * there're already no other refs + */ + object_ref(OBJECT(s)); + qemu_bh_schedule(s->cleanup_bh); +} + +static void migrate_fd_cleanup_bh(void *opaque) +{ + MigrationState *s =3D opaque; + migrate_fd_cleanup(s); + object_unref(OBJECT(s)); +} + void migrate_set_error(MigrationState *s, const Error *error) { qemu_mutex_lock(&s->error_mutex); @@ -3143,7 +3158,7 @@ static void migration_iteration_finish(MigrationState= *s) error_report("%s: Unknown ending state %d", __func__, s->state); break; } - qemu_bh_schedule(s->cleanup_bh); + migrate_fd_cleanup_schedule(s); qemu_mutex_unlock_iothread(); } =20 @@ -3278,7 +3293,7 @@ void migrate_fd_connect(MigrationState *s, Error *err= or_in) bool resume =3D s->state =3D=3D MIGRATION_STATUS_POSTCOPY_PAUSED; =20 s->expected_downtime =3D s->parameters.downtime_limit; - s->cleanup_bh =3D qemu_bh_new(migrate_fd_cleanup, s); + s->cleanup_bh =3D qemu_bh_new(migrate_fd_cleanup_bh, s); if (error_in) { migrate_fd_error(s, error_in); migrate_fd_cleanup(s); --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859475; cv=none; d=zoho.com; s=zohoarc; b=eD33xAOkXBQ7hHqPSBQrXFGGGUWXhQTVFOgbfyiFsH21SQ1bLDulTKm1rR0nff9kJrFo6kIkxYe9C1vknXMONHv81K/DQzpVdt5h5HuCTAPIxal0mEOWprqO4i4MKAGaPZrJ2QXsZb2hlZW+u13u/JPSHcNad8PoyGXKTykN6VM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859475; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QFNuBENDfzsMTmZIcktrQiRZJbRvQxR/CaDH2tdYpZ8=; b=axezmA10XySJhnLtDvQyMjflVZ7cci/v+aoZX/ydHYv8XVXO5qvEVa/LKIshXRwtaPScqMDiz8A88RtSVjvTrnVNhO3rxZejt7pab5WmHKMB+54RNL0ZYkM+0vQXDdC838nBZ1b8YpV+jPAByIHtioy8ln9oOXW+V9TsmzQYTjk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155785947597140.70310571525761; Tue, 14 May 2019 11:44:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:52501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcPg-0006Gl-V5 for importer@patchew.org; Tue, 14 May 2019 14:44:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHg-0007a0-Eo for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHf-00022o-Dt for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60240) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHf-00021i-8T for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 875942D7ED; Tue, 14 May 2019 18:36:14 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC80D608BA; Tue, 14 May 2019 18:36:05 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:53 +0100 Message-Id: <20190514183454.12758-16-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 May 2019 18:36:14 +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 15/16] migration/ram.c: fix typos in comments 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: Wei Yang Signed-off-by: Wei Yang Message-Id: <20190510233729.15554-1-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index e1fe45311d..4c60869226 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -917,7 +917,7 @@ struct { * - to make easier to know what to free at the end of migration * * This way we always know who is the owner of each "pages" struct, - * and we don't need any loocking. It belongs to the migration thread + * and we don't need any locking. It belongs to the migration thread * or to the channel thread. Switching is safe because the migration * thread is using the channel mutex when changing it, and the channel * have to had finish with its own, otherwise pending_job can't be @@ -1630,7 +1630,7 @@ static int save_xbzrle_page(RAMState *rs, uint8_t **c= urrent_data, /** * migration_bitmap_find_dirty: find the next dirty page from start * - * Returns the byte offset within memory region of the start of a dirty pa= ge + * Returns the page offset within memory region of the start of a dirty pa= ge * * @rs: current RAM state * @rb: RAMBlock where to search for dirty pages @@ -2144,7 +2144,7 @@ retry: * find_dirty_block: find the next dirty page and update any state * associated with the search process. * - * Returns if a page is found + * Returns true if a page is found * * @rs: current RAM state * @pss: data about the state of the current dirty page scan @@ -2240,7 +2240,7 @@ static RAMBlock *unqueue_page(RAMState *rs, ram_addr_= t *offset) * * Skips pages that are already sent (!dirty) * - * Returns if a queued page is found + * Returns true if a queued page is found * * @rs: current RAM state * @pss: data about the state of the current dirty page scan @@ -3447,7 +3447,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) =20 /* we want to check in the 1st loop, just in case it was the 1st t= ime and we had to sync the dirty bitmap. - qemu_get_clock_ns() is a bit expensive, so we only check each s= ome + qemu_clock_get_ns() is a bit expensive, so we only check each s= ome iterations */ if ((i & 63) =3D=3D 0) { --=20 2.21.0 From nobody Fri Apr 19 22:38:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557859708; cv=none; d=zoho.com; s=zohoarc; b=dIzxfSln6iis+XaMD7zVk5PKKxTgy1UYNSqnEyn9w6IShsl7S5I4eGGbsA2qw1CAwjZCbKw5FZAzzSdqw6ypPNcxU68oPv2aVGrka2YASKK8+5pzyGjZU8wGkfWFHwev9Ol8rMntQVpBFS2AWxY1CpxTVEV7jvERCf2DTZmgCVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557859708; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=90esQQ1jIkbGaQwTiW2QmwBpTJxntJsWeL3Dftd6X8M=; b=R5o3gySsKU6vdukSDGa/yuCrBxnQixj3zOLvtZiKGrW9kspNPOT69YhHnDnHqWIvUmJ6retl0bQJgqwieqZoMI9AkHnCQBjE3lfdDiHXvjQxdUvTbYxCrHwR3NhiQPxHACxwxc94Z1qDb+K5ZHHEffG00zxb2/ZiyW0USlPyt48= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557859708990547.9004981902161; Tue, 14 May 2019 11:48:28 -0700 (PDT) Received: from localhost ([127.0.0.1]:52569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcTI-0001LM-9n for importer@patchew.org; Tue, 14 May 2019 14:48:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcHq-0007tj-Gf for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQcHp-0002A0-MR for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35698) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQcHp-00029b-HB for qemu-devel@nongnu.org; Tue, 14 May 2019 14:36:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDBAA3001809; Tue, 14 May 2019 18:36:24 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE6F3608BA; Tue, 14 May 2019 18:36:14 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, ehabkost@redhat.com, richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru, chen.zhang@intel.com Date: Tue, 14 May 2019 19:34:54 +0100 Message-Id: <20190514183454.12758-17-dgilbert@redhat.com> In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com> References: <20190514183454.12758-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 14 May 2019 18:36:24 +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 16/16] monitor: Call mon_get_cpu() only once at hmp_gva2gpa() 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: Eduardo Habkost hmp_gva2gpa() calls mon_get_cpu() twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346). Signed-off-by: Eduardo Habkost Message-Id: <20190510185620.15757-1-ehabkost@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index bb48997913..6428eb3b7e 100644 --- a/monitor.c +++ b/monitor.c @@ -1685,8 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qd= ict) return; } =20 - gpa =3D cpu_get_phys_page_attrs_debug(mon_get_cpu(), - addr & TARGET_PAGE_MASK, &attrs); + gpa =3D cpu_get_phys_page_attrs_debug(cs, addr & TARGET_PAGE_MASK, &a= ttrs); if (gpa =3D=3D -1) { monitor_printf(mon, "Unmapped\n"); } else { --=20 2.21.0