From nobody Tue May 21 13:27:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1612237732; cv=none; d=zohomail.com; s=zohoarc; b=HHx4Ix91xsSJICOcaQsbW5rf1dVwqiWoibKUwYrbej7oHmwy4OyeTifQmBXpZXmGuACD/EuTa/ioKboeGOV7MSgvD3DuRPd6BNNFV6XyfRo/KBg8f1TyAhRX1+P530XeRTrey44KRggJwNUKuxwkbBktuw3i40s39rdIh0WQau0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612237732; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nk/Hnr4gW9mXq+0wdVcx6zTF1nkAURtTsKCWVmpJ2o4=; b=IzabjaR9vsPZfMIyyTaP94EdDQJKiDs/kXg9IfROcZHPgWBLUQ12IKrPJceKsR8ucoquH1WYQBI/8cyvW2kgpE2GhluQqoYTDtO4cN+NVmaL1Jc2EAlXH7V02TgAtHbEBxIyDSuETuwoyYvyA5HC0mc+ieFcqEjvsKqPdWWtmZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612237731826278.84109530190983; Mon, 1 Feb 2021 19:48:51 -0800 (PST) Received: from localhost ([::1]:33466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6mgM-0000ck-Kl for importer@patchew.org; Mon, 01 Feb 2021 22:48:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6mfR-00006a-8P for qemu-devel@nongnu.org; Mon, 01 Feb 2021 22:47:53 -0500 Received: from [240e:678:8c0:5::c0a8:3a62] (port=31012 helo=FZEX3.ruijie.com.cn) by eggs.gnu.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6mfN-0001A0-1J for qemu-devel@nongnu.org; Mon, 01 Feb 2021 22:47:51 -0500 Received: from centos.localdomain (172.20.101.108) by FZEX3.ruijie.com.cn (192.168.58.89) with Microsoft SMTP Server id 14.3.123.3; Tue, 2 Feb 2021 11:41:55 +0800 From: lichun To: , Subject: [PATCH] savevm: check for incoming-state in savevm Date: Tue, 2 Feb 2021 19:41:47 +0800 Message-ID: <1612266107-76091-1-git-send-email-lichun@ruijie.com.cn> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [172.20.101.108] X-Host-Lookup-Failed: Reverse DNS lookup failed for 240e:678:8c0:5::c0a8:3a62 (failed) Received-SPF: pass (zohomail.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; Received-SPF: permerror client-ip=240e:678:8c0:5::c0a8:3a62; envelope-from=lichun@ruijie.com.cn; helo=FZEX3.ruijie.com.cn X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DATE_IN_FUTURE_06_12=1.947, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lichun , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Running #qemu-system-i386 test.img -monitor stdio -incoming tcp:0.0.0.0:1234 (qemu) savevm we get: before the patch: bdrv_co_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed. Aborted after: Error: Guest is waiting for an incoming migration Signed-off-by: lichun --- migration/savevm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index 4f3b69e..84e76e4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1522,6 +1522,11 @@ static int qemu_savevm_state(QEMUFile *f, Error **er= rp) return -EINVAL; } =20 + if (runstate_check(RUN_STATE_INMIGRATE)) { + error_setg(errp, "Guest is waiting for an incoming migration"); + return -EINVAL; + } + if (migrate_use_block()) { error_setg(errp, "Block migration and snapshots are incompatible"); return -EINVAL; --=20 1.8.3.1