From nobody Sun Sep 27 21:13:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=openvz.org ARC-Seal: i=1; a=rsa-sha256; t=1790251036; cv=none; d=zohomail.com; s=zohoarc; b=kBHO32GyBjuWRt/hpoZJb5eb62l89DSfdqEp5hoOGXThAbP6va39U/G1Pc8hEKkrmnrnE4Zjdhl7J7tXizUlUTR8jIWkE47jYCaiNuFeADXVUSYMo+A0JXYJ7np5brZa8prcGPlW9FO1vRHvzGtEY/3/Y1yF7rOMGaX0DFSxFyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790251036; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9ju/weBv0BliSm1Ra/ckEb/qWEoMCPQnAz2B35BNNLE=; b=B4PFtw1qCIVKz/TZIFbw91Ns9VuSFlOpDgI9DTi+BlGqCJMGegvg2KioWk5fFFgEsqB1/IK2Nu7vGOR4DwvH4QVMioxJqgQzgW6DvmHPfU90l+XLnJLIMc+GNN5MEfWVb3wy/z/WMnH1A5GGjxBcOvYDfGHwV4oIVTRqjArpUT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790251036324789.7684730690718; Thu, 24 Sep 2026 04:57:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9i3r-00029h-Vr; Thu, 24 Sep 2026 07:56:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9i3o-000276-4p for qemu-devel@nongnu.org; Thu, 24 Sep 2026 07:56:20 -0400 Received: from mail-wm2-x11.google.com ([2a00:1450:4864:31::11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9i3l-0003NT-NL for qemu-devel@nongnu.org; Thu, 24 Sep 2026 07:56:19 -0400 Received: by mail-wm2-x11.google.com with SMTP id 5b1f17b1804b1-49cd38e0e5dso24801955e9.2 for ; Thu, 24 Sep 2026 04:56:17 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:f9ec:9c2f:7d67:4ad8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cca160sm58870135e9.12.2026.09.24.04.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 04:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1790250976; x=1790855776; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9ju/weBv0BliSm1Ra/ckEb/qWEoMCPQnAz2B35BNNLE=; b=l9FNI0K0wsqq83GUNxMmRvWogN8HYwelTkF9T0Eu9tzLfzDVbxuLlBOZiAUjCgMY37 tlrA5XWiyANYLUOAJ5MovMdGy7R9ri64BScdB5AYh2Ht1Lx1THddSn+zZU2DzvGaWlME +ceR3FS7cyV9vj2YA4Pd4BRzSCMTsZfki3vKM1o2nC3nB+cXJtrwpa/RKDo1N8mdwpVB f3EXvSe4LBIEDcLsOAyjbqhGkWQH9Zrd2cEOBZWSwZosCKYFCO7RlTSG3I/hkCBKVzUy Vzzcsm8SXHEI/Y/tMb8H1QWUYMMy38yl+9yeQP66C5IdgFO7UkY5DEH8MpcMspwnQ47o HxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790250976; x=1790855776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9ju/weBv0BliSm1Ra/ckEb/qWEoMCPQnAz2B35BNNLE=; b=TO8jpbvKWEKIUBnakCwKJtTdXzA/pqKM5W5IYEN/ksaD4NPagNrGjMjiN6PHZ68+Tn fu6pdRLlRdtYRRHUUiUriHy3nJg3PgotX92slMST83Q6rtw+eJ8v+7DyLxbdKinuUWVK l5GQkuwvGgYOrJyZr6mt5jaGCBSzh88PWomxQJB8hdVILcO/LvpASPJNbRAhvz4poXwN YDY0Dkb25QK4mS7aBC3m6ptLcUloLKwGNhz+fljgHgObW+pEjnHCg8tWgFvWndHXyFsB /raIoZKZ6D1F/dxzGdVM1vRRlUnAj9KjFlhh2PbMqXdYB1uHLsGAt/G+Y93/U1BTPahR OoCQ== X-Gm-Message-State: AFuF++mRT8geJGtQAFJYPMTr38Bqk2zrxvismU1MutLS/lABq8MGV6DP Ykb8GKVrJBC6N6LfWGPUA20nzQka7dbS8zUHXMp58iNs8cFeJUCOisXmy0YbPaO5rMrxJmRIGb4 AMeGt X-Gm-Gg: AYBFou0fZESHe+UiUFG75r/9joAKD6LBlmWUH6wHLRPIMnkMGk3ytyjKDCBLZewmJWU ETQ0K0hwLSPsfzYWrfShJAHmmnJB7oPXQ13lopy1RYZS1N4P33h650edhNWLTVz0/4ZrE1D68fB +Fxqgee8RvTV57F9Bx8xbdxWDZgIPzEwd92D6bZnTAb6/GDAoToKS74zd+RnPJvXlrjT7m6AAjN lxuGsBFsQ17+nGZMI6TyEXjuXccUbteyACk1u9pTUT0cAyoLT/VHBdFdA6lkKP6g549tjzAyit6 eykVZHkEhqJVlxeBg+pVZOYSFEJ4eiL9/ZX2xFPSt/HRghy03Brvj5+B7Bf9Egadz/eGGXXhyTp CuzlVYCRdjQD/OJTiZ6huiUkYsgmmX2Xf6doWl/7txktNSP+LxZKaVuHyvzx2ArjF9bpssAGUDa QQbZiEglIoXlvArRuAHfZKbbFDQDB9ijpg+Rqz21FHQI8bhR+CkfX3qqHIwLNS4sDI+no= X-Received: by 2002:a05:600c:8b4c:b0:49f:bd3c:bc16 with SMTP id 5b1f17b1804b1-49fe66f4c16mr35263685e9.17.1790250976300; Thu, 24 Sep 2026 04:56:16 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Denis V. Lunev" , Peter Xu , Fabiano Rosas , Eric Blake , Vladimir Sementsov-Ogievskiy , qemu-stable@nongnu.org Subject: [PATCH 1/2] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes Date: Thu, 24 Sep 2026 13:56:10 +0200 Message-ID: <20260924115611.4098417-2-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924115611.4098417-1-den@openvz.org> References: <20260924115611.4098417-1-den@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:31::11; envelope-from=den@openvz.org; helo=mail-wm2-x11.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @openvz.org) X-ZM-MESSAGEID: 1790251037147158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev With dirty bitmaps on more than one node, the source switches nodes during the postcopy bulk phase and sends the node name again. The destination reads those chunks in the postcopy listen thread, which does not hold the BQL, and resolves the name through bdrv_lookup_bs(): qemu-system-x86_64: ../block.c:6400: bdrv_lookup_bs: Assertion `qemu_in_main_thread()' failed. The bdrv_find_dirty_bitmap() call right after it needs the BQL or the dirty bitmap lock as well. Taking the BQL there would deadlock: the listen thread holds s->lock, and dirty_bitmap_mig_before_vm_start() takes s->lock with the BQL held. Every node and bitmap that a non-START chunk refers to was set up by a START chunk, and those are loaded under the BQL during setup. Record the node alias there, and resolve all other chunks against s->bitmaps instead of the block graph. Bitmaps on a single node never resend the node name after setup, which is why migrate-bitmaps-postcopy-test does not catch this. Fixes: f791bf7f93f2 ("assertions for block global state API") Signed-off-by: Denis V. Lunev Cc: Peter Xu Cc: Fabiano Rosas Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: qemu-stable@nongnu.org --- migration/block-dirty-bitmap.c | 59 +++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 1b8f39c12b..61691ee4cc 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -136,6 +136,7 @@ typedef struct DBMSaveState { } DBMSaveState; =20 typedef struct LoadBitmapState { + char node_alias[256]; BlockDriverState *bs; BdrvDirtyBitmap *bitmap; bool migrated; @@ -859,6 +860,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoad= State *s) } =20 b =3D g_new(LoadBitmapState, 1); + g_strlcpy(b->node_alias, s->node_alias, sizeof(b->node_alias)); b->bs =3D s->bs; b->bitmap =3D s->bitmap; b->migrated =3D false; @@ -1056,6 +1058,54 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLo= adState *s) return 0; } =20 +/* + * Only START chunks are guaranteed to be loaded under the BQL; the rest m= ay + * come from the postcopy listen thread and must not touch the block graph. + */ +static BlockDriverState *dirty_bitmap_load_find_bs(DBMLoadState *s, + const char *device, + const char *node_name, + Error **errp) +{ + GSList *item; + + if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) { + return bdrv_lookup_bs(device, node_name, errp); + } + + for (item =3D s->bitmaps; item; item =3D g_slist_next(item)) { + LoadBitmapState *b =3D item->data; + + if (!strcmp(b->node_alias, s->node_alias)) { + return b->bs; + } + } + + error_setg(errp, "Error: no migrated bitmaps on node alias '%s'", + s->node_alias); + return NULL; +} + +static BdrvDirtyBitmap *dirty_bitmap_load_find_bitmap(DBMLoadState *s) +{ + GSList *item; + + if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) { + return bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); + } + + for (item =3D s->bitmaps; item; item =3D g_slist_next(item)) { + LoadBitmapState *b =3D item->data; + + if (b->bs =3D=3D s->bs && + !strcmp(bdrv_dirty_bitmap_name(b->bitmap), s->bitmap_name)) { + return b->bitmap; + } + } + + return NULL; +} + static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s, GHashTable *alias_map) { @@ -1084,11 +1134,12 @@ static int dirty_bitmap_load_header(QEMUFile *f, DB= MLoadState *s, s->bs =3D NULL; } else { bitmap_alias_map =3D amin->subtree; - s->bs =3D bdrv_lookup_bs(NULL, amin->string, &local_er= r); + s->bs =3D dirty_bitmap_load_find_bs(s, NULL, amin->str= ing, + &local_err); } } else { - s->bs =3D bdrv_lookup_bs(s->node_alias, s->node_alias, - &local_err); + s->bs =3D dirty_bitmap_load_find_bs(s, s->node_alias, + s->node_alias, &local_er= r); } if (!s->bs) { error_report_err(local_err); @@ -1139,7 +1190,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBML= oadState *s, =20 if (!s->cancelled) { g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); - s->bitmap =3D bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); + s->bitmap =3D dirty_bitmap_load_find_bitmap(s); =20 /* * bitmap may be NULL here, it wouldn't be an error if it is t= he --=20 2.53.0 From nobody Sun Sep 27 21:13:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=openvz.org ARC-Seal: i=1; a=rsa-sha256; t=1790251038; cv=none; d=zohomail.com; s=zohoarc; b=b6tQPSEFfraSi6uPu1jW4bTsACXOwrIHSqxAjAs9SBF+qjkXc/DuJw/wLptvP2lULrbCImLZ1GHFFfL5R1ua7Jyn19av1TEBZkPMOSQk6zHdRfG2gZzCSc3GrcKGHltnf7t4kRImjwLhPGRkyVq592ExUNvUXTraFTh0vAOzezs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790251038; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2of6IpDgSU0f/44dTod0e4ZV9C12++pxS+xEs2Nw4II=; b=DAfNwIl1YUnC2NYWMkhdE6wQ/O/s+zXtFMpZDITqz1VD2rVB9gosO2aEBOWTSDEuAa1s28N34aHZ0jPg3pm0pA4/wDaC4eFI7U03jrgRKe9pdG6mlrwPt4xMroUQjKBA3dh75b1htMNeF70WIqEtLnJjkTBCOWLwUhIFK3afXdc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790251038055881.3450501204118; Thu, 24 Sep 2026 04:57:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9i3t-0002AK-0z; Thu, 24 Sep 2026 07:56:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9i3q-00028m-2J for qemu-devel@nongnu.org; Thu, 24 Sep 2026 07:56:22 -0400 Received: from mail-wm2-x10.google.com ([2a00:1450:4864:31::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9i3n-0003Nr-7H for qemu-devel@nongnu.org; Thu, 24 Sep 2026 07:56:21 -0400 Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49cd38e0f79so11154955e9.3 for ; Thu, 24 Sep 2026 04:56:18 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:f9ec:9c2f:7d67:4ad8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cca160sm58870135e9.12.2026.09.24.04.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 04:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1790250977; x=1790855777; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2of6IpDgSU0f/44dTod0e4ZV9C12++pxS+xEs2Nw4II=; b=kVrkq6+yAFjRx9mozla96x+ZzrdRt8L0azQQ0b72FLfw/dHsVUQ3sL4xxawXXXflR8 ZbyvexrJQK3vuVXp47CmdYXtSwCk0lTb/Xmjf4nCn19wW6deXZCeYoYYrcg/UUIsRBCX oz6U2LezRo6AGpiNL08Og7iI8NCb9JItXPF33l6v/GoTFR2ETIA11FevhpvCP8nCKfNo tCBXN9l4xklkBMBUa9vjzok5s0X/lfniKUIy2ZCNBokX7GnDy+ZWm8yfRsN3qqgXKDRW T9ncuDXoViHjgXc5ecbi1499HxK5HfSQ5lVJ/zNUSfhquKj5zTkQJ8WqC6taiwfZHwc+ wOvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790250977; x=1790855777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=2of6IpDgSU0f/44dTod0e4ZV9C12++pxS+xEs2Nw4II=; b=ybPszUXTp69Ee59Yvq4ZnkGqyNQ4zj047t7LJ87Q3irIX0GSN5KQ2j0Ps5Qk4Gt6v5 +Gil3eBYbrXhaVIy7K080nnZwsT0NjSwxqnOGSJINKjZToq/EVeX7THo8J7folPfnmgm 6OsAAJtO7IPap2cSkt9B2eaZmSKUrran+aDAyh4irlqQ/pEGyNeZnP9dN6BbPfW2QctH b3h3JDdHBBBF+7nVfQW8SXN+fDok7bzSGnBu3Q0soAgqqh5l5XbWfQTNdaFqaQvsr2dP SuR52x5C/XSFZsajS+F4+nNfs4xkworSIIg9DyrH3dzjkNUAw5CjApJ7hBD/RMUDri0M 16PQ== X-Gm-Message-State: AFuF++nCfijptL70ec9dbVmdwv1+Zj5YzN5DZWEiq5FEgUbnFtvilab5 P/va5X4i0BanR2PMk3Y6o1rvG3mHfX2Pgv93+O9JZukzbL5aE5Sh1Wwzj+7puI1zbQNVZE/7cnS EeLwh X-Gm-Gg: AYBFou3oG1spihMTXVTrSdd8ZURnuQCrhP59iADel5Qi5Ii6yl+FzrBHv26viQGtHtP 8PDlfH9AT16uZMGfyjBUjEGRj+PaaEpZUYfAW2odhforQgL9N9QFzoaxMHHXwrnD8p8W1XLUlC+ Js1RNkx1C2ly5b4Zo6+KNPN9xJEUHa6YB009sP0OZcKQk3g4gX/+O8uQGbEjPqC8MFDkBc4VIAj gquW12i5fW4uioB8ldAnjFKXrohb44dLrP/htOckodoVgj45FvPR5o3nVzDS9IMHnqAUhpRVkAk l7f9lZOMpxpxSQy4VljjJKh1+OojGlXzpFthWarL44jizdbRcA+jFdGk97OiARDvLhVlyGFi8Qk LyQWv8Lf+NuiRLiEyjGg3SYHHwQ9iczwCsTt8WjcQKmNW6/3ESFnJomPaEEktGQ4/LjUY8LEwkN cg+vOoGzVFQn3ygZ73VfiE4nKSUWGVnbjJTSKktyaSYEntCQgRctBoxoJIH63avU8Xoys= X-Received: by 2002:a05:600c:4e8b:b0:49f:ce78:356a with SMTP id 5b1f17b1804b1-49fe66fb018mr37208515e9.27.1790250977594; Thu, 24 Sep 2026 04:56:17 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Denis V. Lunev" , Peter Xu , Fabiano Rosas , Eric Blake , Vladimir Sementsov-Ogievskiy Subject: [PATCH 2/2] iotests/migrate-bitmaps-postcopy-test: add a bitmap on a second node Date: Thu, 24 Sep 2026 13:56:11 +0200 Message-ID: <20260924115611.4098417-3-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924115611.4098417-1-den@openvz.org> References: <20260924115611.4098417-1-den@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:31::10; envelope-from=den@openvz.org; helo=mail-wm2-x10.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @openvz.org) X-ZM-MESSAGEID: 1790251038872158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev All bitmaps in the test live on drive0, so the source never switches nodes after setup and the destination never resolves a node name from the postcopy listen thread. Add a second drive with one bitmap and check that it arrives intact. Signed-off-by: Denis V. Lunev Cc: Peter Xu Cc: Fabiano Rosas Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy --- .../tests/migrate-bitmaps-postcopy-test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests= /qemu-iotests/tests/migrate-bitmaps-postcopy-test index b2b37ada4b..36c281596d 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -27,6 +27,8 @@ debug =3D False =20 disk_a =3D os.path.join(iotests.test_dir, 'disk_a') disk_b =3D os.path.join(iotests.test_dir, 'disk_b') +disk_a1 =3D os.path.join(iotests.test_dir, 'disk_a1') +disk_b1 =3D os.path.join(iotests.test_dir, 'disk_b1') size =3D '256G' fifo =3D os.path.join(iotests.test_dir, 'mig_fifo') =20 @@ -97,16 +99,23 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): self.vm_b.shutdown() os.remove(disk_a) os.remove(disk_b) + os.remove(disk_a1) + os.remove(disk_b1) os.remove(fifo) =20 def setUp(self): os.mkfifo(fifo) qemu_img('create', '-f', iotests.imgfmt, disk_a, size) qemu_img('create', '-f', iotests.imgfmt, disk_b, size) + qemu_img('create', '-f', iotests.imgfmt, disk_a1, '1G') + qemu_img('create', '-f', iotests.imgfmt, disk_b1, '1G') self.vm_a =3D iotests.VM(path_suffix=3D'a').add_drive(disk_a, 'discard=3Dunmap= ') self.vm_b =3D iotests.VM(path_suffix=3D'b').add_drive(disk_b, 'discard=3Dunmap= ') + # A bitmap on a second node makes postcopy switch nodes after setup + self.vm_a.add_drive(disk_a1) + self.vm_b.add_drive(disk_b1) self.vm_b.add_incoming("exec: cat '" + fifo + "'") self.vm_a.launch() self.vm_b.launch() @@ -127,6 +136,13 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTest= Case): node=3D'drive0', name=3D'bitmap0') empty_sha256 =3D result['return']['sha256'] =20 + self.vm_a.cmd('block-dirty-bitmap-add', node=3D'drive1', + name=3D'bitmap0', granularity=3Dgranularity) + self.vm_a.hmp_qemu_io('drive1', 'write 0 64k') + result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive1', name=3D'bitmap0') + self.drive1_sha256 =3D result['return']['sha256'] + apply_discards(self.vm_a, discards1) =20 result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', @@ -212,6 +228,9 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): =20 # check that bitmaps are migrated and persistence works check_bitmaps(self.vm_b, nb_bitmaps) + result =3D self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive1', name=3D'bitmap0') + self.assert_qmp(result, 'return/sha256', self.drive1_sha256) self.vm_b.shutdown() # recreate vm_b, so there is no incoming option, which prevents # loading bitmaps from disk --=20 2.53.0