From nobody Thu May 2 03:08:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150367089553234.0496685405642; Fri, 25 Aug 2017 07:21:35 -0700 (PDT) Received: from localhost ([::1]:53557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlFUM-0003GR-3A for importer@patchew.org; Fri, 25 Aug 2017 10:21:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlFSg-0002LQ-3Y for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlFSe-0002FH-Rn for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51100) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlFSe-0002F6-Li for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8CCC7F7A9; Fri, 25 Aug 2017 14:19:47 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-187.ams2.redhat.com [10.36.117.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id C50D77EE9E; Fri, 25 Aug 2017 14:19:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B8CCC7F7A9 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dgilbert@redhat.com From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, shorne@gmail.com, quintela@redhat.com, mreitz@redhat.com Date: Fri, 25 Aug 2017 15:19:39 +0100 Message-Id: <20170825141940.20740-2-dgilbert@redhat.com> In-Reply-To: <20170825141940.20740-1-dgilbert@redhat.com> References: <20170825141940.20740-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 25 Aug 2017 14:19:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] migration: Reset rather than destroy main_thread_load_event 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: , Cc: lvivier@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" migration_incoming_state_destroy doesn't really destroy, it cleans up. After a loadvm it's called, but the loadvm command can be run twice, and so destroying an init-once mutex breaks on the second loadvm. Reported-by: Stafford Horne Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Tested-by: Stafford Horne --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index c3fe0ed9ca..a625551ce5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -167,7 +167,7 @@ void migration_incoming_state_destroy(void) mis->from_src_file =3D NULL; } =20 - qemu_event_destroy(&mis->main_thread_load_event); + qemu_event_reset(&mis->main_thread_load_event); } =20 static void migrate_generate_event(int new_state) --=20 2.13.5 From nobody Thu May 2 03:08:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503670907110336.68280394246244; Fri, 25 Aug 2017 07:21:47 -0700 (PDT) Received: from localhost ([::1]:53558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlFUX-0003PZ-PA for importer@patchew.org; Fri, 25 Aug 2017 10:21:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlFSk-0002OI-BT for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlFSj-0002Ge-AZ for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlFSj-0002GO-35 for qemu-devel@nongnu.org; Fri, 25 Aug 2017 10:19:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 251657E423; Fri, 25 Aug 2017 14:19:52 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-187.ams2.redhat.com [10.36.117.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EE1B7EE74; Fri, 25 Aug 2017 14:19:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 251657E423 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dgilbert@redhat.com From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, shorne@gmail.com, quintela@redhat.com, mreitz@redhat.com Date: Fri, 25 Aug 2017 15:19:40 +0100 Message-Id: <20170825141940.20740-3-dgilbert@redhat.com> In-Reply-To: <20170825141940.20740-1-dgilbert@redhat.com> References: <20170825141940.20740-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 25 Aug 2017 14:19:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] snapshot/tests: Try loadvm twice 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: , Cc: lvivier@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" It's legal to loadvm twice, modify the existing save/loadvm test to do it twice. Signed-off-by: Dr. David Alan Gilbert Reported-by: Stafford Horne Reviewed-by: Peter Xu --- tests/qemu-iotests/068 | 2 +- tests/qemu-iotests/068.out | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index cfa0f2aed5..e7fca6a494 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -78,7 +78,7 @@ for extra_args in \ # Give qemu some time to boot before saving the VM state { sleep 1; printf "savevm 0\nquit\n"; } | _qemu $extra_args # Now try to continue from that VM state (this should just work) - echo quit | _qemu $extra_args -loadvm 0 + { sleep 1; printf "loadvm 0\nloadvm 0\nquit\n"; } | _qemu $extra_args = -S done =20 # success, all done diff --git a/tests/qemu-iotests/068.out b/tests/qemu-iotests/068.out index aa063cf711..f07a938a38 100644 --- a/tests/qemu-iotests/068.out +++ b/tests/qemu-iotests/068.out @@ -7,6 +7,8 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm 0 (qemu) quit QEMU X.Y.Z monitor - type 'help' for more information +(qemu) loadvm 0 +(qemu) loadvm 0 (qemu) quit =20 =3D=3D=3D Saving and reloading a VM state to/from a qcow2 image (-object i= othread,id=3Diothread0 -set device.hba0.iothread=3Diothread0) =3D=3D=3D @@ -16,5 +18,7 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm 0 (qemu) quit QEMU X.Y.Z monitor - type 'help' for more information +(qemu) loadvm 0 +(qemu) loadvm 0 (qemu) quit *** done --=20 2.13.5