From nobody Thu May 2 18:01:29 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=1559735777; cv=none; d=zoho.com; s=zohoarc; b=bV7eph8ZJ+RivRSEU/bWa/psp24uCUMKAB4pm+TyY7+SC8RqDgjqSRQABtFZTO4wpQnDses226E0baiXZu+ksxelXYLm1vPWHDi10s3UJyRv+6HP4kmL4YgROzy0EYAxZ8hWnB8BEeSHMgFa3q33A0C03F1+JaXq6vLtmKyMxts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735777; h=Content-Transfer-Encoding:Cc: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=lZsZkVGzrhEs8yMyd1mUw7IQFxAHOZMyGBfXjmvEOl0=; b=bPG5Hu4lS+o141dJBpMylRok0a+AWjJ0uf1tXy7CtCMkOjwKItka95W/93yqere2KNb7zwVFtjFLkXita4lg/ZsvxIPOnJyz1GaciprRXtdTRwFqElaHGV0SzYpXba++1iLTe0yWbES+ICo8cHvg78kz9T00TN5ufCetWFcr5vc= 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 1559735777854872.2713566250276; Wed, 5 Jun 2019 04:56:17 -0700 (PDT) Received: from localhost ([127.0.0.1]:39866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUW6-0004od-K6 for importer@patchew.org; Wed, 05 Jun 2019 07:55:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUU5-0003kx-SW for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUU4-0002TD-78 for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52704) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUU4-0002SN-28 for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9F943086217; Wed, 5 Jun 2019 11:53:29 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E4AB5B683; Wed, 5 Jun 2019 11:53:27 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:14 +0200 Message-Id: <20190605115318.9972-2-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 05 Jun 2019 11:53:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] migration/ram.c: MultiFDSendParams.sem_sync is not really used 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: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang Besides init and destroy, MultiFDSendParams.sem_sync is not really used. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 4c60869226..4c15f6fda1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -661,8 +661,6 @@ typedef struct { uint64_t num_packets; /* pages sent through this channel */ uint64_t num_pages; - /* syncs main thread and channels */ - QemuSemaphore sem_sync; } MultiFDSendParams; =20 typedef struct { @@ -1027,7 +1025,6 @@ void multifd_save_cleanup(void) p->c =3D NULL; qemu_mutex_destroy(&p->mutex); qemu_sem_destroy(&p->sem); - qemu_sem_destroy(&p->sem_sync); g_free(p->name); p->name =3D NULL; multifd_pages_clear(p->pages); @@ -1201,7 +1198,6 @@ int multifd_save_setup(void) =20 qemu_mutex_init(&p->mutex); qemu_sem_init(&p->sem, 0); - qemu_sem_init(&p->sem_sync, 0); p->quit =3D false; p->pending_job =3D 0; p->id =3D i; --=20 2.21.0 From nobody Thu May 2 18:01:29 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=1559735760; cv=none; d=zoho.com; s=zohoarc; b=a8lrgtmv30ntz/41/hlz9xRON2sKkMQycg3iugDS2LdKWl+nyv0szhQHd14wJjvUui0rAAC8S5l7uEnaILA5hqZCelcGrHLM7YO9u1aUCnDasmv35b9dM0umJCvzh4Rfs+6mEC5qire4XrHXMbHb0Z3bK/uuexXCr6QqRzuspqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735760; h=Content-Transfer-Encoding:Cc: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=iVd0nL03uk6QV7tTNf/4xlghfcZJ15GmUY5onvWW6nE=; b=hecfZ/6PYjRBX8yijExTXSADIIFBYU1AtC4RV4cFLjKhrxsd92xQsMdEob4tO7i4UxpmMw/OrbVqi3BDEVGPE+c6QlU7WVVNnuSyZGGgKBERo00QItjuVNTdwoIuLr/yatmfVDz2TxfgYeFDoOor16Pl82F0G989c5Z/4COa+XU= 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 1559735760215331.5965231324252; Wed, 5 Jun 2019 04:56:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:39888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUWF-0004u3-Rh for importer@patchew.org; Wed, 05 Jun 2019 07:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUU8-0003lQ-SK for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUU7-0002Wp-II for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40992) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUU7-0002Vw-Cd for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:39 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D303883BA; Wed, 5 Jun 2019 11:53:33 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B7115D705; Wed, 5 Jun 2019 11:53:29 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:15 +0200 Message-Id: <20190605115318.9972-3-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 05 Jun 2019 11:53:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] migration/ram.c: multifd_send_state->count is not really used 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: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Wei Yang , Paolo Bonzini 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 Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 4c15f6fda1..03a9cce9f9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -892,8 +892,6 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams= *p, Error **errp) =20 struct { MultiFDSendParams *params; - /* number of created threads */ - int count; /* array of pages to sent */ MultiFDPages_t *pages; /* syncs main thread and channels */ @@ -1171,8 +1169,6 @@ static void multifd_new_send_channel_async(QIOTask *t= ask, gpointer opaque) p->running =3D true; qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, QEMU_THREAD_JOINABLE); - - atomic_inc(&multifd_send_state->count); } } =20 @@ -1188,7 +1184,6 @@ int multifd_save_setup(void) thread_count =3D migrate_multifd_channels(); multifd_send_state =3D g_malloc0(sizeof(*multifd_send_state)); multifd_send_state->params =3D g_new0(MultiFDSendParams, thread_count); - atomic_set(&multifd_send_state->count, 0); multifd_send_state->pages =3D multifd_pages_init(page_count); qemu_sem_init(&multifd_send_state->sem_sync, 0); qemu_sem_init(&multifd_send_state->channels_ready, 0); --=20 2.21.0 From nobody Thu May 2 18:01:29 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=1559735899; cv=none; d=zoho.com; s=zohoarc; b=Pb1nkZOgzw8lapsUDfEJMRCDhfpOEkeOUJM3LDZ3QFOFsAOiAyqgpIRJN5aFP39aIpBBmTiIoffdqSSgevpP4WTsg65PaDT7ksLhhKeHYbdRNE4lKjK7VgdgiW0fr9Be/mQAh+7JKYYIGHoU+G5J2JZcA2LDM0RCyQgsbOMkl+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735899; h=Content-Transfer-Encoding:Cc: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=s27Y1wtyPVXNdwPybvNTaGXQFLfA1keMqAw4PkMYgDg=; b=mmTG/e2flX/b4/jfdsycTlSYLRogaGTYRMZGSv7gVfVGdolKpFZxSV2bHWLIFP8p05tocGJa6CEwdj9xom3EI/3m0iYKEJ3Hy/yr6JP7DGWlLRybPgZry8Gxm3nSofweepLOlYvFDehw6+tQwgBjNTxBNNSK+wAEc24I+Nm6wCY= 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 1559735899430462.26017434734024; Wed, 5 Jun 2019 04:58:19 -0700 (PDT) Received: from localhost ([127.0.0.1]:39915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUYT-00071l-HA for importer@patchew.org; Wed, 05 Jun 2019 07:58:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUUQ-0003up-Ga for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUUM-0002rj-Sh for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUUL-0002mh-4s for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A35802F8BF3; Wed, 5 Jun 2019 11:53:40 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id C14855D6A9; Wed, 5 Jun 2019 11:53:33 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:16 +0200 Message-Id: <20190605115318.9972-4-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jun 2019 11:53:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] migration: Fix fd protocol for incoming defer 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: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Peter Xu , Markus Armbruster , Yury Kotov , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Yury Kotov Currently, incoming migration through fd supports only command-line case: E.g. fork(); fd =3D open(); exec("qemu ... -incoming fd:%d", fd); It's possible to use add-fd commands to pass fd for migration, but it's invalid case. add-fd works with fdset but not with particular fds. To work with getfd in incoming defer it's enough to use monitor_fd_param instead of strtol. monitor_fd_param supports both cases: * fd:123 * fd:fd_name (added by getfd). And also the use of monitor_fd_param improves error messages. Signed-off-by: Yury Kotov Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/fd.c | 8 +++++--- migration/fd.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/migration/fd.c b/migration/fd.c index a7c13df4ad..0a29ecdebf 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -52,12 +52,14 @@ static gboolean fd_accept_incoming_migration(QIOChannel= *ioc, return G_SOURCE_REMOVE; } =20 -void fd_start_incoming_migration(const char *infd, Error **errp) +void fd_start_incoming_migration(const char *fdname, Error **errp) { QIOChannel *ioc; - int fd; + int fd =3D monitor_fd_param(cur_mon, fdname, errp); + if (fd =3D=3D -1) { + return; + } =20 - fd =3D strtol(infd, NULL, 0); trace_migration_fd_incoming(fd); =20 ioc =3D qio_channel_new_fd(fd, errp); diff --git a/migration/fd.h b/migration/fd.h index a14a63ce2e..b901bc014e 100644 --- a/migration/fd.h +++ b/migration/fd.h @@ -16,7 +16,7 @@ =20 #ifndef QEMU_MIGRATION_FD_H #define QEMU_MIGRATION_FD_H -void fd_start_incoming_migration(const char *path, Error **errp); +void fd_start_incoming_migration(const char *fdname, Error **errp); =20 void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp); --=20 2.21.0 From nobody Thu May 2 18:01:29 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=1559735977; cv=none; d=zoho.com; s=zohoarc; b=k+0mkTIPAtuEZft+qXpKJcS0/7JpGuAWPAHtL1admCCvCpBcZmVbIyGCDYrp/lm2s1cw3kDcKA83MnHhoe+txZ+SMTOOkDZsSlaJTXCN5SHkc3fQXkUDHBgyQFKdURH4CC+j7lLYQWiaDh47DX2sjQ94kP7WJ3fawUwXhV0reiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735977; h=Content-Transfer-Encoding:Cc: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=yiz/5+GrI55inHnfSg366qPugdhvuNCN3Pn105776RM=; b=BtABSHeCKY1lMzmRLeEuJ4ilcPppojUI5waR8gELxDZ9xId8Zl7zvDoH4EloUKyO/Na6UqAoCQwKKwUfB+ybc4DdwkKwNJcIf43u7dn77UAJSFiwCsTluNuDMsCAJoiCqPk8lR1+AjKYmNpwAJCYDhPZVEQ4OA56lf3/d/LBZZc= 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 1559735977348898.366661892929; Wed, 5 Jun 2019 04:59:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:39926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUZl-0007vB-DN for importer@patchew.org; Wed, 05 Jun 2019 07:59:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUUW-00040k-E8 for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUUU-0002yJ-Ho for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:54:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59522) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUUS-0002nZ-Q4 for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:54:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A42A530860BD; Wed, 5 Jun 2019 11:53:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 041EC5D705; Wed, 5 Jun 2019 11:53:40 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:17 +0200 Message-Id: <20190605115318.9972-5-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 05 Jun 2019 11:53:46 +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 4/5] migration-test: Add a test for fd protocol 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: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Peter Xu , Markus Armbruster , Yury Kotov , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Yury Kotov Signed-off-by: Yury Kotov Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Signed-off-by: Juan Quintela --- tests/libqtest.c | 80 ++++++++++++++++++++++++++++++-- tests/libqtest.h | 51 ++++++++++++++++++++- tests/migration-test.c | 101 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 227 insertions(+), 5 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 546a875913..9b9b5f37fc 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -32,6 +32,7 @@ =20 #define MAX_IRQ 256 #define SOCKET_TIMEOUT 50 +#define SOCKET_MAX_FDS 16 =20 QTestState *global_qtest; =20 @@ -391,6 +392,40 @@ static void GCC_FMT_ATTR(2, 3) qtest_sendf(QTestState = *s, const char *fmt, ...) va_end(ap); } =20 +/* Sends a message and file descriptors to the socket. + * It's needed for qmp-commands like getfd/add-fd */ +static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, + const char *buf, size_t buf_size) +{ + ssize_t ret; + struct msghdr msg =3D { 0 }; + char control[CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)] =3D { 0 }; + size_t fdsize =3D sizeof(int) * fds_num; + struct cmsghdr *cmsg; + struct iovec iov =3D { .iov_base =3D (char *)buf, .iov_len =3D buf_siz= e }; + + msg.msg_iov =3D &iov; + msg.msg_iovlen =3D 1; + + if (fds && fds_num > 0) { + g_assert_cmpuint(fds_num, <, SOCKET_MAX_FDS); + + msg.msg_control =3D control; + msg.msg_controllen =3D CMSG_SPACE(fdsize); + + cmsg =3D CMSG_FIRSTHDR(&msg); + cmsg->cmsg_len =3D CMSG_LEN(fdsize); + cmsg->cmsg_level =3D SOL_SOCKET; + cmsg->cmsg_type =3D SCM_RIGHTS; + memcpy(CMSG_DATA(cmsg), fds, fdsize); + } + + do { + ret =3D sendmsg(socket_fd, &msg, 0); + } while (ret < 0 && errno =3D=3D EINTR); + g_assert_cmpint(ret, >, 0); +} + static GString *qtest_recv_line(QTestState *s) { GString *line; @@ -545,7 +580,8 @@ QDict *qtest_qmp_receive(QTestState *s) * in the case that they choose to discard all replies up until * a particular EVENT is received. */ -void qmp_fd_vsend(int fd, const char *fmt, va_list ap) +void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, + const char *fmt, va_list ap) { QObject *qobj; =20 @@ -569,25 +605,49 @@ void qmp_fd_vsend(int fd, const char *fmt, va_list ap) fprintf(stderr, "%s", str); } /* Send QMP request */ - socket_send(fd, str, qstring_get_length(qstr)); + if (fds && fds_num > 0) { + socket_send_fds(fd, fds, fds_num, str, qstring_get_length(qstr= )); + } else { + socket_send(fd, str, qstring_get_length(qstr)); + } =20 qobject_unref(qstr); qobject_unref(qobj); } } =20 +void qmp_fd_vsend(int fd, const char *fmt, va_list ap) +{ + qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); +} + +void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) +{ + qmp_fd_vsend_fds(s->qmp_fd, fds, fds_num, fmt, ap); +} + void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) { - qmp_fd_vsend(s->qmp_fd, fmt, ap); + qmp_fd_vsend_fds(s->qmp_fd, NULL, 0, fmt, ap); } =20 QDict *qmp_fdv(int fd, const char *fmt, va_list ap) { - qmp_fd_vsend(fd, fmt, ap); + qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); =20 return qmp_fd_receive(fd); } =20 +QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) +{ + qtest_qmp_vsend_fds(s, fds, fds_num, fmt, ap); + + /* Receive reply */ + return qtest_qmp_receive(s); +} + QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) { qtest_qmp_vsend(s, fmt, ap); @@ -616,6 +676,18 @@ void qmp_fd_send(int fd, const char *fmt, ...) va_end(ap); } =20 +QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, ...) +{ + va_list ap; + QDict *response; + + va_start(ap, fmt); + response =3D qtest_vqmp_fds(s, fds, fds_num, fmt, ap); + va_end(ap); + return response; +} + QDict *qtest_qmp(QTestState *s, const char *fmt, ...) { va_list ap; diff --git a/tests/libqtest.h b/tests/libqtest.h index 32d927755d..cadf1d4a03 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -84,6 +84,21 @@ QTestState *qtest_init_with_serial(const char *extra_arg= s, int *sock_fd); */ void qtest_quit(QTestState *s); =20 +/** + * qtest_qmp_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt...: QMP message to send to qemu, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * + * Sends a QMP message to QEMU with fds and returns the response. + */ +QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, ...) + GCC_FMT_ATTR(4, 5); + /** * qtest_qmp: * @s: #QTestState instance to operate on. @@ -120,7 +135,23 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt= , ...) GCC_FMT_ATTR(2, 3); =20 /** - * qtest_qmpv: + * qtest_vqmp_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU with fds and returns the response. + */ +QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) + GCC_FMT_ATTR(4, 0); + +/** + * qtest_vqmp: * @s: #QTestState instance to operate on. * @fmt: QMP message to send to QEMU, formatted like * qobject_from_jsonf_nofail(). See parse_escape() for what's @@ -132,6 +163,22 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt= , ...) QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); =20 +/** + * qtest_qmp_vsend_fds: + * @s: #QTestState instance to operate on. + * @fds: array of file descriptors + * @fds_num: number of elements in @fds + * @fmt: QMP message to send to QEMU, formatted like + * qobject_from_jsonf_nofail(). See parse_escape() for what's + * supported after '%'. + * @ap: QMP message arguments + * + * Sends a QMP message to QEMU and leaves the response in the stream. + */ +void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, + const char *fmt, va_list ap) + GCC_FMT_ATTR(4, 0); + /** * qtest_qmp_vsend: * @s: #QTestState instance to operate on. @@ -888,6 +935,8 @@ static inline int64_t clock_step(int64_t step) } =20 QDict *qmp_fd_receive(int fd); +void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, + const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0); void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); diff --git a/tests/migration-test.c b/tests/migration-test.c index bd3f5c3125..e0407576cb 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -174,6 +174,21 @@ static void stop_cb(void *opaque, const char *name, QD= ict *data) } } =20 +/* + * Events can get in the way of responses we are actually waiting for. + */ +GCC_FMT_ATTR(3, 4) +static QDict *wait_command_fd(QTestState *who, int fd, const char *command= , ...) +{ + va_list ap; + + va_start(ap, command); + qtest_qmp_vsend_fds(who, &fd, 1, command, ap); + va_end(ap); + + return qtest_qmp_receive_success(who, stop_cb, NULL); +} + /* * Events can get in the way of responses we are actually waiting for. */ @@ -480,6 +495,7 @@ static void migrate(QTestState *who, const char *uri, c= onst char *fmt, ...) qdict_put_str(args, "uri", uri); =20 rsp =3D qmp("{ 'execute': 'migrate', 'arguments': %p}", args); + g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); } @@ -1027,6 +1043,90 @@ static void test_precopy_tcp(void) g_free(uri); } =20 +static void test_migrate_fd_proto(void) +{ + QTestState *from, *to; + int ret; + int pair[2]; + QDict *rsp; + const char *error_desc; + + if (test_migrate_start(&from, &to, "defer", false, false)) { + return; + } + + /* + * We want to pick a speed slow enough that the test completes + * quickly, but that it doesn't complete precopy even on a slow + * machine, so also set the downtime. + */ + /* 1 ms should make it not converge */ + migrate_set_parameter(from, "downtime-limit", 1); + /* 1GB/s */ + migrate_set_parameter(from, "max-bandwidth", 1000000000); + + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + /* Create two connected sockets for migration */ + ret =3D socketpair(PF_LOCAL, SOCK_STREAM, 0, pair); + g_assert_cmpint(ret, =3D=3D, 0); + + /* Send the 1st socket to the target */ + rsp =3D wait_command_fd(to, pair[0], + "{ 'execute': 'getfd'," + " 'arguments': { 'fdname': 'fd-mig' }}"); + qobject_unref(rsp); + close(pair[0]); + + /* Start incoming migration from the 1st socket */ + rsp =3D wait_command(to, "{ 'execute': 'migrate-incoming'," + " 'arguments': { 'uri': 'fd:fd-mig' }}"); + qobject_unref(rsp); + + /* Send the 2nd socket to the target */ + rsp =3D wait_command_fd(from, pair[1], + "{ 'execute': 'getfd'," + " 'arguments': { 'fdname': 'fd-mig' }}"); + qobject_unref(rsp); + close(pair[1]); + + /* Start migration to the 2nd socket*/ + migrate(from, "fd:fd-mig", "{}"); + + wait_for_migration_pass(from); + + /* 300ms should converge */ + migrate_set_parameter(from, "downtime-limit", 300); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + qtest_qmp_eventwait(to, "RESUME"); + + /* Test closing fds */ + /* We assume, that QEMU removes named fd from its list, + * so this should fail */ + rsp =3D qtest_qmp(from, "{ 'execute': 'closefd'," + " 'arguments': { 'fdname': 'fd-mig' }}"); + g_assert_true(qdict_haskey(rsp, "error")); + error_desc =3D qdict_get_str(qdict_get_qdict(rsp, "error"), "desc"); + g_assert_cmpstr(error_desc, =3D=3D, "File descriptor named 'fd-mig' no= t found"); + qobject_unref(rsp); + + rsp =3D qtest_qmp(to, "{ 'execute': 'closefd'," + " 'arguments': { 'fdname': 'fd-mig' }}"); + g_assert_true(qdict_haskey(rsp, "error")); + error_desc =3D qdict_get_str(qdict_get_qdict(rsp, "error"), "desc"); + g_assert_cmpstr(error_desc, =3D=3D, "File descriptor named 'fd-mig' no= t found"); + qobject_unref(rsp); + + /* Complete migration */ + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + test_migrate_end(from, to, true); +} + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -1081,6 +1181,7 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); /* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */ qtest_add_func("/migration/xbzrle/unix", test_xbzrle_unix); + qtest_add_func("/migration/fd_proto", test_migrate_fd_proto); =20 ret =3D g_test_run(); =20 --=20 2.21.0 From nobody Thu May 2 18:01:29 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=1559735764; cv=none; d=zoho.com; s=zohoarc; b=VonQPJcuBgurxsuEH8WIpUI3GeLrj5/ZwT9vLpSHXBPxOqzRGUtIQ9X55pnbClCYvOpIMlIaRXdptp/ibStV6OfRaH1hXPj/0Jxv4ERC+mc7mEA9hvx4R7LI06duUKquCMFuiNfN5WTmnefhXtuFlW47DIpPn5G06KoQYxuEtz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735764; h=Content-Transfer-Encoding:Cc: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=Xzv+U81Z3+eLeTob08PUlXwX9zzw1TNegpXTkK+a5fQ=; b=OtxMOXlRIoJe8X0zTInHW6O8AuDD7oh2ibtKLTfGs40nnnFeJWUEzpmI9dkE2KqnkT9WyxlZoJf/IipllEl7ejXfvsV9imjjSsUFkrRYk7oFsy3yF8wzaX+8vvQyumtlqOnYBzwmlFK4siiVHFaq5zh53Qm4B7BBVzNKFa3w20w= 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 1559735764178804.9761898218933; Wed, 5 Jun 2019 04:56:04 -0700 (PDT) Received: from localhost ([127.0.0.1]:39890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUWL-0004zw-Lr for importer@patchew.org; Wed, 05 Jun 2019 07:55:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUUK-0003pj-MH for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUUG-0002km-RN for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46588) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUUG-0002jj-Js for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 481E185546; Wed, 5 Jun 2019 11:53:46 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 038115D71A; Wed, 5 Jun 2019 11:53:43 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:18 +0200 Message-Id: <20190605115318.9972-6-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 05 Jun 2019 11:53: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 5/5] migratioin/ram: leave RAMBlock->bmap blank on allocating 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: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang During migration, we would sync bitmap from ram_list.dirty_memory to RAMBlock.bmap in cpu_physical_memory_sync_dirty_bitmap(). Since we set RAMBlock.bmap and ram_list.dirty_memory both to all 1, this means at the first round this sync is meaningless and is a duplicated work. Leaving RAMBlock->bmap blank on allocating would have a side effect on migration_dirty_pages, since it is calculated from the result of cpu_physical_memory_sync_dirty_bitmap(). To keep it right, we need to set migration_dirty_pages to 0 in ram_state_init(). Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 03a9cce9f9..082aea9d23 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3173,11 +3173,11 @@ static int ram_state_init(RAMState **rsp) QSIMPLEQ_INIT(&(*rsp)->src_page_requests); =20 /* - * Count the total number of pages used by ram blocks not including any - * gaps due to alignment or unplugs. + * This must match with the initial values of dirty bitmap. + * Currently we initialize the dirty bitmap to all zeros so + * here the total dirty page count is zero. */ - (*rsp)->migration_dirty_pages =3D ram_bytes_total() >> TARGET_PAGE_BIT= S; - + (*rsp)->migration_dirty_pages =3D 0; ram_state_reset(*rsp); =20 return 0; @@ -3192,8 +3192,16 @@ static void ram_list_init_bitmaps(void) if (ram_bytes_total()) { RAMBLOCK_FOREACH_NOT_IGNORED(block) { pages =3D block->max_length >> TARGET_PAGE_BITS; + /* + * The initial dirty bitmap for migration must be set with all + * ones to make sure we'll migrate every guest RAM page to + * destination. + * Here we didn't set RAMBlock.bmap simply because it is alrea= dy + * set in ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION] in + * ram_block_add, and that's where we'll sync the dirty bitmap= s. + * Here setting RAMBlock.bmap would be fine too but not necess= ary. + */ block->bmap =3D bitmap_new(pages); - bitmap_set(block->bmap, 0, pages); if (migrate_postcopy_ram()) { block->unsentmap =3D bitmap_new(pages); bitmap_set(block->unsentmap, 0, pages); --=20 2.21.0