From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932330701691.3484470469016; Tue, 6 Feb 2018 07:52:10 -0800 (PST) Received: from localhost ([::1]:59504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5XV-0003bm-IT for importer@patchew.org; Tue, 06 Feb 2018 10:52:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Vh-0002Kw-3q for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Vg-0003lP-9J for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54460) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Vg-0003kK-2f for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:16 -0500 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 D08E79F735; Tue, 6 Feb 2018 15:50:14 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 991DE80DA; Tue, 6 Feb 2018 15:50:06 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:23 +0000 Message-Id: <20180206154936.13565-2-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.39]); Tue, 06 Feb 2018 15:50:15 +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] [PULL 01/14] migration: Allow migrate_fd_connect to take an Error * 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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" Allow whatever is performing the connection to pass migrate_fd_connect an error to indicate there was a problem during connection, an allow us to clean up. The caller must free the error. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/channel.c | 2 +- migration/migration.c | 7 ++++++- migration/migration.h | 2 +- migration/rdma.c | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/migration/channel.c b/migration/channel.c index 70ec7ea3b7..fdb7ddbd17 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -78,6 +78,6 @@ void migration_channel_connect(MigrationState *s, =20 s->to_dst_file =3D f; =20 - migrate_fd_connect(s); + migrate_fd_connect(s, NULL); } } diff --git a/migration/migration.c b/migration/migration.c index c99a4e62d7..1fbd304c66 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2378,10 +2378,15 @@ static void *migration_thread(void *opaque) return NULL; } =20 -void migrate_fd_connect(MigrationState *s) +void migrate_fd_connect(MigrationState *s, Error *error_in) { s->expected_downtime =3D s->parameters.downtime_limit; s->cleanup_bh =3D qemu_bh_new(migrate_fd_cleanup, s); + if (error_in) { + migrate_fd_error(s, error_in); + migrate_fd_cleanup(s); + return; + } =20 qemu_file_set_blocking(s->to_dst_file, true); qemu_file_set_rate_limit(s->to_dst_file, diff --git a/migration/migration.h b/migration/migration.h index 786d971ce2..d3b214e5ba 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -190,7 +190,7 @@ uint64_t migrate_max_downtime(void); void migrate_set_error(MigrationState *s, const Error *error); void migrate_fd_error(MigrationState *s, const Error *error); =20 -void migrate_fd_connect(MigrationState *s); +void migrate_fd_connect(MigrationState *s, Error *error_in); =20 MigrationState *migrate_init(void); bool migration_is_blocked(Error **errp); diff --git a/migration/rdma.c b/migration/rdma.c index 9d5a424011..da474fc19f 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3758,7 +3758,7 @@ void rdma_start_outgoing_migration(void *opaque, trace_rdma_start_outgoing_migration_after_rdma_connect(); =20 s->to_dst_file =3D qemu_fopen_rdma(rdma, "wb"); - migrate_fd_connect(s); + migrate_fd_connect(s, NULL); return; err: g_free(rdma); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932494965105.07711900151423; Tue, 6 Feb 2018 07:54:54 -0800 (PST) Received: from localhost ([::1]:59614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5a9-0005zt-Vp for importer@patchew.org; Tue, 06 Feb 2018 10:54:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Vs-0002UR-A1 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Vq-0003uF-4k for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34406) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Vp-0003tI-Qh for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:25 -0500 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 F15686A7C2; Tue, 6 Feb 2018 15:50:24 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08B375D6A8; Tue, 6 Feb 2018 15:50:14 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:24 +0000 Message-Id: <20180206154936.13565-3-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.27]); Tue, 06 Feb 2018 15:50:25 +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] [PULL 02/14] migration: Route errors down through migration_channel_connect 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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" Route async errors (especially from sockets) down through migration_channel_connect and on to migrate_fd_connect where they can be cleaned up. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/channel.c | 32 ++++++++++++++++---------------- migration/channel.h | 3 ++- migration/exec.c | 2 +- migration/fd.c | 2 +- migration/socket.c | 4 +--- migration/tls.c | 3 +-- migration/trace-events | 2 +- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/migration/channel.c b/migration/channel.c index fdb7ddbd17..c5eaf0fa0e 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -55,29 +55,29 @@ void migration_channel_process_incoming(QIOChannel *ioc) * @s: Current migration state * @ioc: Channel to which we are connecting * @hostname: Where we want to connect + * @error: Error indicating failure to connect, free'd here */ void migration_channel_connect(MigrationState *s, QIOChannel *ioc, - const char *hostname) + const char *hostname, + Error *error) { trace_migration_set_outgoing_channel( - ioc, object_get_typename(OBJECT(ioc)), hostname); + ioc, object_get_typename(OBJECT(ioc)), hostname, error); =20 - if (s->parameters.tls_creds && - *s->parameters.tls_creds && - !object_dynamic_cast(OBJECT(ioc), - TYPE_QIO_CHANNEL_TLS)) { - Error *local_err =3D NULL; - migration_tls_channel_connect(s, ioc, hostname, &local_err); - if (local_err) { - migrate_fd_error(s, local_err); - error_free(local_err); - } - } else { - QEMUFile *f =3D qemu_fopen_channel_output(ioc); + if (!error) { + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + migration_tls_channel_connect(s, ioc, hostname, &error); + } else { + QEMUFile *f =3D qemu_fopen_channel_output(ioc); =20 - s->to_dst_file =3D f; + s->to_dst_file =3D f; =20 - migrate_fd_connect(s, NULL); + } } + migrate_fd_connect(s, error); + error_free(error); } diff --git a/migration/channel.h b/migration/channel.h index e4b40579a1..67a461c28a 100644 --- a/migration/channel.h +++ b/migration/channel.h @@ -22,5 +22,6 @@ void migration_channel_process_incoming(QIOChannel *ioc); =20 void migration_channel_connect(MigrationState *s, QIOChannel *ioc, - const char *hostname); + const char *hostname, + Error *error_in); #endif diff --git a/migration/exec.c b/migration/exec.c index f3be1baf2e..c9537974ad 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -39,7 +39,7 @@ void exec_start_outgoing_migration(MigrationState *s, con= st char *command, Error } =20 qio_channel_set_name(ioc, "migration-exec-outgoing"); - migration_channel_connect(s, ioc, NULL); + migration_channel_connect(s, ioc, NULL, NULL); object_unref(OBJECT(ioc)); } =20 diff --git a/migration/fd.c b/migration/fd.c index 30de4b9847..6284a97cba 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -39,7 +39,7 @@ void fd_start_outgoing_migration(MigrationState *s, const= char *fdname, Error ** } =20 qio_channel_set_name(QIO_CHANNEL(ioc), "migration-fd-outgoing"); - migration_channel_connect(s, ioc, NULL); + migration_channel_connect(s, ioc, NULL, NULL); object_unref(OBJECT(ioc)); } =20 diff --git a/migration/socket.c b/migration/socket.c index 3a8232dd2d..e090097077 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -79,12 +79,10 @@ static void socket_outgoing_migration(QIOTask *task, =20 if (qio_task_propagate_error(task, &err)) { trace_migration_socket_outgoing_error(error_get_pretty(err)); - migrate_fd_error(data->s, err); - error_free(err); } else { trace_migration_socket_outgoing_connected(data->hostname); - migration_channel_connect(data->s, sioc, data->hostname); } + migration_channel_connect(data->s, sioc, data->hostname, err); object_unref(OBJECT(sioc)); } =20 diff --git a/migration/tls.c b/migration/tls.c index 026a008667..a29b35b33c 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -118,11 +118,10 @@ static void migration_tls_outgoing_handshake(QIOTask = *task, =20 if (qio_task_propagate_error(task, &err)) { trace_migration_tls_outgoing_handshake_error(error_get_pretty(err)= ); - migrate_fd_error(s, err); } else { trace_migration_tls_outgoing_handshake_complete(); - migration_channel_connect(s, ioc, NULL); } + migration_channel_connect(s, ioc, NULL, err); object_unref(OBJECT(ioc)); } =20 diff --git a/migration/trace-events b/migration/trace-events index 6f29fcc686..93961dea16 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -114,7 +114,7 @@ migrate_transferred(uint64_t tranferred, uint64_t time_= spent, double bandwidth, process_incoming_migration_co_end(int ret, int ps) "ret=3D%d postcopy-stat= e=3D%d" process_incoming_migration_co_postcopy_end_main(void) "" migration_set_incoming_channel(void *ioc, const char *ioctype) "ioc=3D%p i= octype=3D%s" -migration_set_outgoing_channel(void *ioc, const char *ioctype, const char = *hostname) "ioc=3D%p ioctype=3D%s hostname=3D%s" +migration_set_outgoing_channel(void *ioc, const char *ioctype, const char = *hostname, void *err) "ioc=3D%p ioctype=3D%s hostname=3D%s err=3D%p" =20 # migration/rdma.c qemu_rdma_accept_incoming_migration(void) "" --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932478241899.8638390010824; Tue, 6 Feb 2018 07:54:38 -0800 (PST) Received: from localhost ([::1]:59613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Zt-0005nS-Bc for importer@patchew.org; Tue, 06 Feb 2018 10:54:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5WA-0002nu-2L for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5W0-00047W-Hy for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Vz-00046i-Vl for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:36 -0500 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 2D72665D11; Tue, 6 Feb 2018 15:50:35 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45A105D6A8; Tue, 6 Feb 2018 15:50:25 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:25 +0000 Message-Id: <20180206154936.13565-4-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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]); Tue, 06 Feb 2018 15:50:35 +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] [PULL 03/14] migration/savevm.c: set MAX_VM_CMD_PACKAGED_SIZE to 1ul << 32 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Daniel Henrique Barboza MAX_VM_CMD_PACKAGED_SIZE is a constant used in qemu_savevm_send_packaged and loadvm_handle_cmd_packaged to determine whether a package is too big to be sent or received. qemu_savevm_send_packaged is called inside postcopy_start (migration/migration.c) to send the MigrationState in a single blob to the destination, using the MIG_CMD_PACKAGED subcommand, which will read it up using loadvm_handle_cmd_packaged. If the blob is larger than MAX_VM_CMD_PACKAGED_SIZE, an error is thrown and the postcopy migration is aborted. Both MAX_VM_CMD_PACKAGED_SIZE and MIG_CMD_PACKAGED were introduced by commit 11cf1d984b ("MIG_CMD_PACKAGED: Send a packaged chunk ..."). The constant has its original value of 1ul << 24 (16MB). The current MAX_VM_CMD_PACKAGED_SIZE value is not enough to support postcopy migration of bigger pseries guests. The blob size for a postcopy migration = of a pseries guest with the following setup: qemu-system-ppc64 --nographic -vga none -machine pseries,accel=3Dkvm -m 64G= \ -smp 1,maxcpus=3D32 -device virtio-blk-pci,drive=3Drootdisk \ -drive file=3Df27.qcow2,if=3Dnone,cache=3Dnone,format=3Dqcow2,id=3Drootdisk= \ -netdev user,id=3Du1 -net nic,netdev=3Du1 Goes around 12MB. Bumping the RAM to 128G makes the blob sizes goes to 20MB. With 256G the blob goes to 37MB - more than twice the current maximum size. At this moment the pseries machine can handle guests with up to 1TB of RAM, making this postcopy blob goes to 128MB of size approximately. Following the discussions made in [1], there is a need to understand what devices are aggressively consuming the blob in that manner and see if that can be mitigated. Until then, we can set MAX_VM_CMD_PACKAGED_SIZE to the maximum value allowed. Since the size is a 32 bit int variable, we can set it as 1ul << 32, giving a maximum blob size of 4G that is enough to support postcopy migration of 32TB RAM guests given the above constraints. [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-01/msg06313.html Signed-off-by: Daniel Henrique Barboza Reported-by: Balamuruhan S Reviewed-by: Juan Quintela Signed-off-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 b7908f62be..b8e9c532af 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -81,7 +81,7 @@ enum qemu_vm_cmd { MIG_CMD_MAX }; =20 -#define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) +#define MAX_VM_CMD_PACKAGED_SIZE UINT32_MAX static struct mig_cmd_args { ssize_t len; /* -1 =3D variable */ const char *name; --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932514962133.18983346667926; Tue, 6 Feb 2018 07:55:14 -0800 (PST) Received: from localhost ([::1]:59615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5aU-0006Lf-4x for importer@patchew.org; Tue, 06 Feb 2018 10:55:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5WF-0002sm-6X for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5WB-0004Gc-Eq for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50212) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5WB-0004Fx-8I for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:47 -0500 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 731DC19D39D; Tue, 6 Feb 2018 15:50:46 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7821F5D6A8; Tue, 6 Feb 2018 15:50:35 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:26 +0000 Message-Id: <20180206154936.13565-5-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.29]); Tue, 06 Feb 2018 15:50:46 +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] [PULL 04/14] migration: use s->threshold_size inside migration_update_counters 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Wei Wang Fixes: b15df1ae50 ("migration: cleanup stats update into function") The threshold size is changed to be recorded in s->threshold_size. Signed-off-by: Wei Wang Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1fbd304c66..44cbfb0ddd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2169,7 +2169,6 @@ static void migration_update_counters(MigrationState = *s, int64_t current_time) { uint64_t transferred, time_spent; - int64_t threshold_size; double bandwidth; =20 if (current_time < s->iteration_start_time + BUFFER_DELAY) { @@ -2179,7 +2178,7 @@ static void migration_update_counters(MigrationState = *s, transferred =3D qemu_ftell(s->to_dst_file) - s->iteration_initial_byte= s; time_spent =3D current_time - s->iteration_start_time; bandwidth =3D (double)transferred / time_spent; - threshold_size =3D bandwidth * s->parameters.downtime_limit; + s->threshold_size =3D bandwidth * s->parameters.downtime_limit; =20 s->mbps =3D (((double) transferred * 8.0) / ((double) time_spent / 1000.0)) / 1000.0 / 1000.0; @@ -2199,7 +2198,7 @@ static void migration_update_counters(MigrationState = *s, s->iteration_initial_bytes =3D qemu_ftell(s->to_dst_file); =20 trace_migrate_transferred(transferred, time_spent, - bandwidth, threshold_size); + bandwidth, s->threshold_size); } =20 /* Migration thread iteration status */ --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932667147220.05955915115487; Tue, 6 Feb 2018 07:57:47 -0800 (PST) Received: from localhost ([::1]:59696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5cr-00008v-8B for importer@patchew.org; Tue, 06 Feb 2018 10:57:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5WN-00031y-Gb for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5WJ-0004Q4-LH for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34808) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5WJ-0004PM-GF for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:55 -0500 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 A72CA68E39; Tue, 6 Feb 2018 15:50:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB7455D6A8; Tue, 6 Feb 2018 15:50:46 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:27 +0000 Message-Id: <20180206154936.13565-6-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.25]); Tue, 06 Feb 2018 15:50:54 +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] [PULL 05/14] migration: Drop current address parameter from save_zero_page() 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela It already has RAMBlock and offset, it can calculate it itself. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index cb1950f3eb..5a109efeda 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -907,11 +907,10 @@ static void migration_bitmap_sync(RAMState *rs) * @rs: current RAM state * @block: block that contains the page we want to send * @offset: offset inside the block for the page - * @p: pointer to the page */ -static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, - uint8_t *p) +static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset) { + uint8_t *p =3D block->host + offset; int pages =3D -1; =20 if (is_zero_range(p, TARGET_PAGE_SIZE)) { @@ -984,7 +983,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus= *pss, bool last_stage) } } } else { - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages > 0) { /* Must let xbzrle know, otherwise a previous (now 0'd) cached * page would be stale @@ -1160,7 +1159,7 @@ static int ram_save_compressed_page(RAMState *rs, Pag= eSearchStatus *pss, */ if (block !=3D rs->last_sent_block) { flush_compressed_data(rs); - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages =3D=3D -1) { /* Make sure the first page is sent out before other pages= */ bytes_xmit =3D save_page_header(rs, rs->f, block, offset | @@ -1180,7 +1179,7 @@ static int ram_save_compressed_page(RAMState *rs, Pag= eSearchStatus *pss, ram_release_pages(block->idstr, offset, pages); } } else { - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages =3D=3D -1) { pages =3D compress_page_with_multi_thread(rs, block, offse= t); } else { --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932858286976.3199915868046; Tue, 6 Feb 2018 08:00:58 -0800 (PST) Received: from localhost ([::1]:59874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5fy-0003Er-7k for importer@patchew.org; Tue, 06 Feb 2018 11:00:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5WS-00037M-KL for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5WQ-0004VF-71 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50698) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5WQ-0004Ud-1Y for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:02 -0500 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 3B8902C974D; Tue, 6 Feb 2018 15:51:01 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id F16AD5EDE6; Tue, 6 Feb 2018 15:50:54 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:28 +0000 Message-Id: <20180206154936.13565-7-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.29]); Tue, 06 Feb 2018 15:51:01 +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] [PULL 06/14] tests: Remove deprecated migration tests commands 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela We move to use migration_set_parameter() for everything. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 799e24ebc6..0428d450df 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -369,37 +369,20 @@ static void migrate_check_parameter(QTestState *who, = const char *parameter, QDECREF(rsp); } =20 -static void migrate_set_downtime(QTestState *who, const double value) +static void migrate_set_parameter(QTestState *who, const char *parameter, + const char *value) { QDict *rsp; gchar *cmd; - char *expected; - int64_t result_int; =20 - cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_downtime'," - "'arguments': { 'value': %g } }", value); + cmd =3D g_strdup_printf("{ 'execute': 'migrate-set-parameters'," + "'arguments': { '%s': %s } }", + parameter, value); rsp =3D qtest_qmp(who, cmd); g_free(cmd); g_assert(qdict_haskey(rsp, "return")); QDECREF(rsp); - result_int =3D value * 1000L; - expected =3D g_strdup_printf("%" PRId64, result_int); - migrate_check_parameter(who, "downtime-limit", expected); - g_free(expected); -} - -static void migrate_set_speed(QTestState *who, const char *value) -{ - QDict *rsp; - gchar *cmd; - - cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_speed'," - "'arguments': { 'value': %s } }", value); - rsp =3D qtest_qmp(who, cmd); - g_free(cmd); - g_assert(qdict_haskey(rsp, "return")); - QDECREF(rsp); - migrate_check_parameter(who, "max-bandwidth", value); + migrate_check_parameter(who, parameter, value); } =20 static void migrate_set_capability(QTestState *who, const char *capability, @@ -530,8 +513,8 @@ static void test_migrate(void) * quickly, but that it doesn't complete precopy even on a slow * machine, so also set the downtime. */ - migrate_set_speed(from, "100000000"); - migrate_set_downtime(from, 0.001); + migrate_set_parameter(from, "max-bandwidth", "100000000"); + migrate_set_parameter(from, "downtime-limit", "1"); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932706138794.7041041919003; Tue, 6 Feb 2018 07:58:26 -0800 (PST) Received: from localhost ([::1]:59698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5dV-0000fI-5n for importer@patchew.org; Tue, 06 Feb 2018 10:58:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Wk-0003NN-UW for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Wf-0004lB-BE for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Wf-0004jo-52 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:51:17 -0500 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 4A0152814A; Tue, 6 Feb 2018 15:51:16 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 845231711B; Tue, 6 Feb 2018 15:51:01 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:29 +0000 Message-Id: <20180206154936.13565-8-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.30]); Tue, 06 Feb 2018 15:51:16 +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] [PULL 07/14] tests: Consolidate accelerators declaration 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 0428d450df..3732682a29 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -422,27 +422,29 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, gchar *cmd_src, *cmd_dst; char *bootpath =3D g_strdup_printf("%s/bootsect", tmpfs); const char *arch =3D qtest_get_arch(); + const char *accel =3D "kvm:tcg"; =20 got_stop =3D false; =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { init_bootfile_x86(bootpath); - cmd_src =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 150M" + cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 150M" " -name pcsource,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,format=3Draw", - tmpfs, bootpath); - cmd_dst =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 150M" + accel, tmpfs, bootpath); + cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 150M" " -name pcdest,debug-threads=3Don" " -serial file:%s/dest_serial" " -drive file=3D%s,format=3Draw" " -incoming %s", - tmpfs, bootpath, uri); + accel, tmpfs, bootpath, uri); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - const char *accel; =20 /* On ppc64, the test only works with kvm-hv, but not with kvm-pr = */ - accel =3D access("/sys/module/kvm_hv", F_OK) ? "tcg" : "kvm:tcg"; + if (access("/sys/module/kvm_hv", F_OK)) { + accel =3D "tcg"; + } init_bootfile_ppc(bootpath); cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" " -name pcsource,debug-threads=3Don" --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517933178713270.8993182259062; Tue, 6 Feb 2018 08:06:18 -0800 (PST) Received: from localhost ([::1]:60441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5lB-00089E-NH for importer@patchew.org; Tue, 06 Feb 2018 11:06:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Xe-0004DR-Ju for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5XY-0005v5-TI for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5XY-0005uU-N0 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:12 -0500 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 C435478559; Tue, 6 Feb 2018 15:52:11 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93E425EE15; Tue, 6 Feb 2018 15:51:16 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:30 +0000 Message-Id: <20180206154936.13565-9-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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]); Tue, 06 Feb 2018 15:52:11 +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] [PULL 08/14] tests: Use consistent names for migration 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 3732682a29..ac4a916169 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -429,12 +429,12 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { init_bootfile_x86(bootpath); cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 150M" - " -name pcsource,debug-threads=3Don" + " -name source,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,format=3Draw", accel, tmpfs, bootpath); cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 150M" - " -name pcdest,debug-threads=3Don" + " -name target,debug-threads=3Don" " -serial file:%s/dest_serial" " -drive file=3D%s,format=3Draw" " -incoming %s", @@ -447,12 +447,12 @@ static void test_migrate_start(QTestState **from, QTe= stState **to, } init_bootfile_ppc(bootpath); cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" - " -name pcsource,debug-threads=3Don" + " -name source,debug-threads=3Don" " -serial file:%s/src_serial" " -drive file=3D%s,if=3Dpflash,format=3D= raw", accel, tmpfs, bootpath); cmd_dst =3D g_strdup_printf("-machine accel=3D%s -m 256M" - " -name pcdest,debug-threads=3Don" + " -name target,debug-threads=3Don" " -serial file:%s/dest_serial" " -incoming %s", accel, tmpfs, uri); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517933314632106.098027035639; Tue, 6 Feb 2018 08:08:34 -0800 (PST) Received: from localhost ([::1]:60994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5nK-00021Y-IQ for importer@patchew.org; Tue, 06 Feb 2018 11:08:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Y7-0004bI-AF for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Y2-0006Jr-Bu for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14107) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Y2-0006J9-4h for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:52:42 -0500 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 5438043A3E; Tue, 6 Feb 2018 15:52:41 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A61B5D6B4; Tue, 6 Feb 2018 15:52:11 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:31 +0000 Message-Id: <20180206154936.13565-10-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.30]); Tue, 06 Feb 2018 15:52:41 +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] [PULL 09/14] tests: Add deprecated commands migration test 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela We add deprecated commands on a new test, so we don't have to add it on normal tests. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index ac4a916169..2a0b651cd1 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -500,6 +500,51 @@ static void test_migrate_end(QTestState *from, QTestSt= ate *to) cleanup("dest_serial"); } =20 +static void deprecated_set_downtime(QTestState *who, const double value) +{ + QDict *rsp; + gchar *cmd; + char *expected; + int64_t result_int; + + cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_downtime'," + "'arguments': { 'value': %g } }", value); + rsp =3D qtest_qmp(who, cmd); + g_free(cmd); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); + result_int =3D value * 1000L; + expected =3D g_strdup_printf("%" PRId64, result_int); + migrate_check_parameter(who, "downtime-limit", expected); + g_free(expected); +} + +static void deprecated_set_speed(QTestState *who, const char *value) +{ + QDict *rsp; + gchar *cmd; + + cmd =3D g_strdup_printf("{ 'execute': 'migrate_set_speed'," + "'arguments': { 'value': %s } }", value); + rsp =3D qtest_qmp(who, cmd); + g_free(cmd); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); + migrate_check_parameter(who, "max-bandwidth", value); +} + +static void test_deprecated(void) +{ + QTestState *from; + + from =3D qtest_start(""); + + deprecated_set_downtime(from, 0.12345); + deprecated_set_speed(from, "12345"); + + qtest_quit(from); +} + static void test_migrate(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -563,6 +608,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); =20 qtest_add_func("/migration/postcopy/unix", test_migrate); + qtest_add_func("/migration/deprecated", test_deprecated); =20 ret =3D g_test_run(); =20 --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517933413634278.9883480421689; Tue, 6 Feb 2018 08:10:13 -0800 (PST) Received: from localhost ([::1]:32893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5oy-0003NL-Pt for importer@patchew.org; Tue, 06 Feb 2018 11:10:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5YM-0004n3-1t for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5YL-0006kd-4n for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52226) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5YK-0006k2-Ul for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:01 -0500 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 1E51043A3E; Tue, 6 Feb 2018 15:53:00 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D7155D6A8; Tue, 6 Feb 2018 15:52:41 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:32 +0000 Message-Id: <20180206154936.13565-11-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.30]); Tue, 06 Feb 2018 15:53:00 +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] [PULL 10/14] tests: Create migrate-start-postcopy command 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela This way, it is like the rest of commands Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 2a0b651cd1..26a792c3aa 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -416,6 +416,15 @@ static void migrate(QTestState *who, const char *uri) QDECREF(rsp); } =20 +static void migrate_start_postcopy(QTestState *who) +{ + QDict *rsp; + + rsp =3D wait_command(who, "{ 'execute': 'migrate-start-postcopy' }"); + g_assert(qdict_haskey(rsp, "return")); + QDECREF(rsp); +} + static void test_migrate_start(QTestState **from, QTestState **to, const char *uri) { @@ -549,7 +558,6 @@ static void test_migrate(void) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; - QDict *rsp; =20 test_migrate_start(&from, &to, uri); =20 @@ -570,9 +578,7 @@ static void test_migrate(void) =20 wait_for_migration_pass(from); =20 - rsp =3D wait_command(from, "{ 'execute': 'migrate-start-postcopy' }"); - g_assert(qdict_haskey(rsp, "return")); - QDECREF(rsp); + migrate_start_postcopy(from); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932553684720.275569643628; Tue, 6 Feb 2018 07:55:53 -0800 (PST) Received: from localhost ([::1]:59618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5b6-0006ve-Nw for importer@patchew.org; Tue, 06 Feb 2018 10:55:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Z7-0005VU-Bi for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Z1-0008Eu-HD for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42418) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Z1-0008DQ-BV for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:43 -0500 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 6434D73B22; Tue, 6 Feb 2018 15:53:42 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 685465D6A8; Tue, 6 Feb 2018 15:53:00 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:33 +0000 Message-Id: <20180206154936.13565-12-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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]); Tue, 06 Feb 2018 15:53:42 +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] [PULL 11/14] tests: Adjust sleeps for migration test 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Juan Quintela Also reorder code to not sleep when event already happened. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 26a792c3aa..9efad95749 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -268,10 +268,9 @@ static uint64_t get_migration_pass(QTestState *who) =20 static void wait_for_migration_complete(QTestState *who) { - QDict *rsp, *rsp_return; - bool completed; - - do { + while (true) { + QDict *rsp, *rsp_return; + bool completed; const char *status; =20 rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); @@ -280,8 +279,11 @@ static void wait_for_migration_complete(QTestState *wh= o) completed =3D strcmp(status, "completed") =3D=3D 0; g_assert_cmpstr(status, !=3D, "failed"); QDECREF(rsp); - usleep(1000 * 100); - } while (!completed); + if (completed) { + return; + } + usleep(1000); + } } =20 static void wait_for_migration_pass(QTestState *who) @@ -290,16 +292,13 @@ static void wait_for_migration_pass(QTestState *who) uint64_t pass; =20 /* Wait for the 1st sync */ - do { + while (!got_stop && !initial_pass) { + usleep(1000); initial_pass =3D get_migration_pass(who); - if (got_stop || initial_pass) { - break; - } - usleep(1000 * 100); - } while (true); + } =20 do { - usleep(1000 * 100); + usleep(1000); pass =3D get_migration_pass(who); } while (pass =3D=3D initial_pass && !got_stop); } @@ -489,13 +488,13 @@ static void test_migrate_end(QTestState *from, QTestS= tate *to) /* Destination still running, wait for a byte to change */ do { qtest_memread(to, start_address, &dest_byte_b, 1); - usleep(10 * 1000); + usleep(1000 * 10); } while (dest_byte_a =3D=3D dest_byte_b); =20 qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}"); /* With it stopped, check nothing changes */ qtest_memread(to, start_address, &dest_byte_c, 1); - sleep(1); + usleep(1000 * 200); qtest_memread(to, start_address, &dest_byte_d, 1); g_assert_cmpint(dest_byte_c, =3D=3D, dest_byte_d); =20 --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932904495938.3272290218456; Tue, 6 Feb 2018 08:01:44 -0800 (PST) Received: from localhost ([::1]:59983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5gl-000497-NE for importer@patchew.org; Tue, 06 Feb 2018 11:01:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5ZJ-0005mO-TU for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5ZD-0000Bs-TU for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35121) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5ZD-0000AE-NN for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:53:55 -0500 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 CA7A5C05FEC9; Tue, 6 Feb 2018 15:53:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A175D5D6A8; Tue, 6 Feb 2018 15:53:42 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:34 +0000 Message-Id: <20180206154936.13565-13-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.31]); Tue, 06 Feb 2018 15:53:54 +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] [PULL 12/14] migration: Recover block devices if failure in device state 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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" In e91d895 I added the new pause-before-switchover mechanism to allow migration completion to be delayed; this changes the last state prior to completion to MIGRATE_STATUS_DEVICE rather than MIGRATE_STATUS_ACTIVE. Fix the failure path in migration_completion to recover the block devices if it fails in MIGRATE_STATUS_DEVICE, not just the MIGRATE_STATUS_ACTIVE that it previously had. This corresponds to rh bz: https://bugzilla.redhat.com/show_bug.cgi?id=3D1538494 whose symptom is an occasional source crash on a failed migration. Fixes: e91d8951d59d483f085f Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 44cbfb0ddd..0fdb2e410d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2122,7 +2122,8 @@ fail_invalidate: /* If not doing postcopy, vm_start() will be called: let's regain * control on images. */ - if (s->state =3D=3D MIGRATION_STATUS_ACTIVE) { + if (s->state =3D=3D MIGRATION_STATUS_ACTIVE || + s->state =3D=3D MIGRATION_STATUS_DEVICE) { Error *local_err =3D NULL; =20 qemu_mutex_lock_iothread(); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932739468361.6872593145986; Tue, 6 Feb 2018 07:58:59 -0800 (PST) Received: from localhost ([::1]:59700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5e6-0001Gv-8B for importer@patchew.org; Tue, 06 Feb 2018 10:58:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Zb-00061E-2x for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5ZV-0000aa-FY for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5ZV-0000Zy-A7 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:13 -0500 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 7362F15567; Tue, 6 Feb 2018 15:54:12 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20E1B5D6A8; Tue, 6 Feb 2018 15:53:54 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:35 +0000 Message-Id: <20180206154936.13565-14-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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.29]); Tue, 06 Feb 2018 15:54:12 +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] [PULL 13/14] migration: Don't leak IO channels 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Ross Lagerwall Since qemu_fopen_channel_{in,out}put take references on the underlying IO channels, make sure to release our references to them. Signed-off-by: Ross Lagerwall Message-Id: <20171101142526.1006-2-ross.lagerwall@citrix.com> Reviewed-by: Daniel P. Berrange Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index b8e9c532af..b024ee3b22 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2266,6 +2266,7 @@ void qmp_xen_save_devices_state(const char *filename,= bool has_live, bool live, } qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state"); f =3D qemu_fopen_channel_output(QIO_CHANNEL(ioc)); + object_unref(OBJECT(ioc)); ret =3D qemu_save_device_state(f); qemu_fclose(f); if (ret < 0) { @@ -2313,6 +2314,7 @@ void qmp_xen_load_devices_state(const char *filename,= Error **errp) } qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-load-state"); f =3D qemu_fopen_channel_input(QIO_CHANNEL(ioc)); + object_unref(OBJECT(ioc)); =20 ret =3D qemu_loadvm_state(f); qemu_fclose(f); --=20 2.14.3 From nobody Thu May 2 14:04:40 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517933096179643.8774490325304; Tue, 6 Feb 2018 08:04:56 -0800 (PST) Received: from localhost ([::1]:60409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5jm-00072K-RI for importer@patchew.org; Tue, 06 Feb 2018 11:04:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Zl-0006BP-01 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Zk-0000ja-0t for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44448) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Zj-0000it-On for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:54:27 -0500 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 D654F3E507; Tue, 6 Feb 2018 15:54:26 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD0A15EE01; Tue, 6 Feb 2018 15:54:12 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:36 +0000 Message-Id: <20180206154936.13565-15-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> 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]); Tue, 06 Feb 2018 15:54:26 +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] [PULL 14/14] migration: incoming postcopy advise sanity checks 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, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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: Greg Kurz If postcopy-ram was set on the source but not on the destination, migration doesn't occur, the destination prints an error and boots the guest: qemu-system-ppc64: Expected vmdescription section, but got 0 We end up with two running instances. This behaviour was introduced in 2.11 by commit 58110f0acb1a "migration: split common postcopy out of ram postcopy" to prepare ground for the upcoming dirty bitmap postcopy support. It adds a new case where the source may send an empty postcopy advise because dirty bitmap doesn't need to check page sizes like RAM postcopy does. If the source has enabled postcopy-ram, then it sends an advise with the page size values. If the destination hasn't enabled postcopy-ram, then loadvm_postcopy_handle_advise() leaves the page size values on the stream and returns. This confuses qemu_loadvm_state() later on and causes the destination to start execution. As discussed several times, postcopy-ram should be enabled both sides to be functional. This patch changes the destination to perform some extra checks on the advise length to ensure this is the case. Otherwise an error is returned and migration is aborted. Reported-by: Balamuruhan S Signed-off-by: Greg Kurz Reviewed-by: Daniel Henrique Barboza Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert Message-Id: <151791621042.19120.3103118434734245776.stgit@bahia> Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index b024ee3b22..f202c3de3a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1376,7 +1376,8 @@ static int qemu_loadvm_state_main(QEMUFile *f, Migrat= ionIncomingState *mis); * *might* happen - it might be skipped if precopy transferred everything * quickly. */ -static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis) +static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis, + uint16_t len) { PostcopyState ps =3D postcopy_state_set(POSTCOPY_INCOMING_ADVISE); uint64_t remote_pagesize_summary, local_pagesize_summary, remote_tps; @@ -1387,8 +1388,22 @@ static int loadvm_postcopy_handle_advise(MigrationIn= comingState *mis) return -1; } =20 - if (!migrate_postcopy_ram()) { + switch (len) { + case 0: + if (migrate_postcopy_ram()) { + error_report("RAM postcopy is enabled but have 0 byte advise"); + return -EINVAL; + } return 0; + case 8 + 8: + if (!migrate_postcopy_ram()) { + error_report("RAM postcopy is disabled but have 16 byte advise= "); + return -EINVAL; + } + break; + default: + error_report("CMD_POSTCOPY_ADVISE invalid length (%d)", len); + return -EINVAL; } =20 if (!postcopy_ram_supported_by_host(mis)) { @@ -1807,7 +1822,7 @@ static int loadvm_process_command(QEMUFile *f) return loadvm_handle_cmd_packaged(mis); =20 case MIG_CMD_POSTCOPY_ADVISE: - return loadvm_postcopy_handle_advise(mis); + return loadvm_postcopy_handle_advise(mis, len); =20 case MIG_CMD_POSTCOPY_LISTEN: return loadvm_postcopy_handle_listen(mis); --=20 2.14.3