From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459372392872.4526898812491; Mon, 17 Apr 2017 13:02:52 -0700 (PDT) Received: from localhost ([::1]:38547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CrK-0007Gw-TR for importer@patchew.org; Mon, 17 Apr 2017 16:02:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpP-0005yQ-KT for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpM-0004Lo-HJ for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39270) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpM-0004LJ-At for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 654988047B for ; Mon, 17 Apr 2017 20:00:45 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F35317CF2; Mon, 17 Apr 2017 20:00:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 654988047B Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 654988047B From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:23 +0200 Message-Id: <20170417200041.2451-2-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 17 Apr 2017 20:00:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 01/19] migration: to_dst_file at that point is NULL 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have just arrived as: migration.c: qemu_migrate() .... s =3D migrate_init() <- puts it to NULL .... {tcp,unix}_start_outgoing_migration -> socket_outgoing_migration migration_channel_connect() sets to_dst_file if tls is enabled, we do another round through migrate_channel_tls_connect(), but we only set it up if there is no error. So we don't need the assignation. I am removing it to remove in the follwing patches the knowledge about MigrationState in that two files. Signed-off-by: Juan Quintela --- migration/socket.c | 1 - migration/tls.c | 1 - 2 files changed, 2 deletions(-) diff --git a/migration/socket.c b/migration/socket.c index 13966f1..dc88812 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -79,7 +79,6 @@ static void socket_outgoing_migration(QIOTask *task, =20 if (qio_task_propagate_error(task, &err)) { trace_migration_socket_outgoing_error(error_get_pretty(err)); - data->s->to_dst_file =3D NULL; migrate_fd_error(data->s, err); error_free(err); } else { diff --git a/migration/tls.c b/migration/tls.c index 45bec44..a33ecb7 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -116,7 +116,6 @@ static void migration_tls_outgoing_handshake(QIOTask *t= ask, =20 if (qio_task_propagate_error(task, &err)) { trace_migration_tls_outgoing_handshake_error(error_get_pretty(err)= ); - s->to_dst_file =3D NULL; migrate_fd_error(s, err); error_free(err); } else { --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459370422782.9047273772912; Mon, 17 Apr 2017 13:02:50 -0700 (PDT) Received: from localhost ([::1]:38544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CrI-0007E7-8R for importer@patchew.org; Mon, 17 Apr 2017 16:02:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpP-0005yO-Jj for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpN-0004Mb-Gs for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39298) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpN-0004LO-Au for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAE7C8047E for ; Mon, 17 Apr 2017 20:00:46 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id B647E5DC19; Mon, 17 Apr 2017 20:00:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAE7C8047E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BAE7C8047E From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:24 +0200 Message-Id: <20170417200041.2451-3-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 17 Apr 2017 20:00: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] [PATCH 02/19] migration: They are called vmstate_foo, move them to vmstate.c 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/savevm.c | 17 ----------------- migration/vmstate.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index cc9c086..c47b209 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -45,7 +45,6 @@ #include "qemu/sockets.h" #include "qemu/queue.h" #include "sysemu/cpus.h" -#include "exec/memory.h" #include "qmp-commands.h" #include "trace.h" #include "qemu/bitops.h" @@ -2465,19 +2464,3 @@ void hmp_info_snapshots(Monitor *mon, const QDict *q= dict) g_free(global_snapshots); =20 } - -void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev) -{ - qemu_ram_set_idstr(mr->ram_block, - memory_region_name(mr), dev); -} - -void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev) -{ - qemu_ram_unset_idstr(mr->ram_block); -} - -void vmstate_register_ram_global(MemoryRegion *mr) -{ - vmstate_register_ram(mr, NULL); -} diff --git a/migration/vmstate.c b/migration/vmstate.c index 8a71349..174c490 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "qemu-common.h" +#include "exec/memory.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "migration/vmstate.h" @@ -1127,3 +1128,18 @@ bool vmstate_device_is_migratable(const VMStateDescr= iption *vmsd) return true; } =20 +void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev) +{ + qemu_ram_set_idstr(mr->ram_block, + memory_region_name(mr), dev); +} + +void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev) +{ + qemu_ram_unset_idstr(mr->ram_block); +} + +void vmstate_register_ram_global(MemoryRegion *mr) +{ + vmstate_register_ram(mr, NULL); +} --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459524850414.32643101652866; Mon, 17 Apr 2017 13:05:24 -0700 (PDT) Received: from localhost ([::1]:38555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Ctn-0000wr-D9 for importer@patchew.org; Mon, 17 Apr 2017 16:05:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpP-0005yK-J0 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpN-0004MU-Co for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52876) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpN-0004Lk-3o for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04AA34E35B for ; Mon, 17 Apr 2017 20:00:48 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A41D179F8; Mon, 17 Apr 2017 20:00:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04AA34E35B Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 04AA34E35B From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:25 +0200 Message-Id: <20170417200041.2451-4-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Apr 2017 20:00:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 03/19] migration: Split migration/channel.c for channel operations 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/channel.h | 25 ++++++++++++++++ include/migration/migration.h | 7 ----- migration/Makefile.objs | 2 +- migration/channel.c | 69 +++++++++++++++++++++++++++++++++++++++= ++++ migration/exec.c | 1 + migration/fd.c | 1 + migration/migration.c | 50 ------------------------------- migration/socket.c | 1 + migration/tls.c | 1 + 9 files changed, 99 insertions(+), 58 deletions(-) create mode 100644 include/migration/channel.h create mode 100644 migration/channel.c diff --git a/include/migration/channel.h b/include/migration/channel.h new file mode 100644 index 0000000..618acb7 --- /dev/null +++ b/include/migration/channel.h @@ -0,0 +1,25 @@ +/* + * QEMU live migration channel functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_CHANNEL_H +#define QEMU_MIGRATION_CHANNEL_H + +#include "io/channel.h" + +void migration_channel_process_incoming(MigrationState *s, + QIOChannel *ioc); + +void migration_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname); +#endif diff --git a/include/migration/migration.h b/include/migration/migration.h index fabfb32..3f54a7c 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -183,17 +183,10 @@ void migrate_set_state(int *state, int old_state, int= new_state); =20 void migration_fd_process_incoming(QEMUFile *f); =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc); - void migration_tls_channel_process_incoming(MigrationState *s, QIOChannel *ioc, Error **errp); =20 -void migration_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname); - void migration_tls_channel_connect(MigrationState *s, QIOChannel *ioc, const char *hostname, diff --git a/migration/Makefile.objs b/migration/Makefile.objs index 480dd49..c83ca92 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,5 +1,5 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o -common-obj-y +=3D tls.o +common-obj-y +=3D tls.o channel.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o common-obj-y +=3D vmstate.o common-obj-y +=3D qemu-file.o diff --git a/migration/channel.c b/migration/channel.c new file mode 100644 index 0000000..c66c6db --- /dev/null +++ b/migration/channel.c @@ -0,0 +1,69 @@ +/* + * QEMU live migration + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "migration/channel.h" +#include "migration/migration.h" +#include "trace.h" +#include "qapi/error.h" +#include "io/channel-tls.h" + +void migration_channel_process_incoming(MigrationState *s, + QIOChannel *ioc) +{ + trace_migration_set_incoming_channel( + ioc, object_get_typename(OBJECT(ioc))); + + 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_process_incoming(s, ioc, &local_err); + if (local_err) { + error_report_err(local_err); + } + } else { + QEMUFile *f =3D qemu_fopen_channel_input(ioc); + migration_fd_process_incoming(f); + } +} + + +void migration_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname) +{ + trace_migration_set_outgoing_channel( + ioc, object_get_typename(OBJECT(ioc)), hostname); + + 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); + + s->to_dst_file =3D f; + + migrate_fd_connect(s); + } +} diff --git a/migration/exec.c b/migration/exec.c index 9157721..7d13fc3 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "migration/channel.h" #include "migration/migration.h" #include "io/channel-command.h" #include "trace.h" diff --git a/migration/fd.c b/migration/fd.c index 58cb51a..f9c230e 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -17,6 +17,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "migration/channel.h" #include "migration/migration.h" #include "monitor/monitor.h" #include "io/channel-util.h" diff --git a/migration/migration.c b/migration/migration.c index d3fe93d..17d22eb 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -463,56 +463,6 @@ void migration_fd_process_incoming(QEMUFile *f) qemu_coroutine_enter(co); } =20 - -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc) -{ - trace_migration_set_incoming_channel( - ioc, object_get_typename(OBJECT(ioc))); - - 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_process_incoming(s, ioc, &local_err); - if (local_err) { - error_report_err(local_err); - } - } else { - QEMUFile *f =3D qemu_fopen_channel_input(ioc); - migration_fd_process_incoming(f); - } -} - - -void migration_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname) -{ - trace_migration_set_outgoing_channel( - ioc, object_get_typename(OBJECT(ioc)), hostname); - - 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); - - s->to_dst_file =3D f; - - migrate_fd_connect(s); - } -} - - /* * Send a message on the return channel back to the source * of the migration. diff --git a/migration/socket.c b/migration/socket.c index dc88812..7171635 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -19,6 +19,7 @@ #include "qemu-common.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "migration/channel.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "io/channel-socket.h" diff --git a/migration/tls.c b/migration/tls.c index a33ecb7..4ee3349 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "migration/channel.h" #include "migration/migration.h" #include "io/channel-tls.h" #include "crypto/tlscreds.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459370379866.6024455866259; Mon, 17 Apr 2017 13:02:50 -0700 (PDT) Received: from localhost ([::1]:38545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CrI-0007FB-T0 for importer@patchew.org; Mon, 17 Apr 2017 16:02:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpP-0005yP-JX for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpO-0004Mp-Ma for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56184) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpO-0004Mg-DY for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A43E8FCE2 for ; Mon, 17 Apr 2017 20:00:49 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55B5017CF2; Mon, 17 Apr 2017 20:00:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4A43E8FCE2 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4A43E8FCE2 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:26 +0200 Message-Id: <20170417200041.2451-5-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 17 Apr 2017 20:00:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 04/19] migration: Remove MigrationState from migration_channel_incomming() 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" All callers were calling migrate_get_current(), so do it inside the functio= n. Signed-off-by: Juan Quintela --- include/migration/channel.h | 3 +-- migration/channel.c | 5 +++-- migration/exec.c | 2 +- migration/fd.c | 2 +- migration/socket.c | 3 +-- migration/tls.c | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/migration/channel.h b/include/migration/channel.h index 618acb7..fbc4bfb 100644 --- a/include/migration/channel.h +++ b/include/migration/channel.h @@ -16,8 +16,7 @@ =20 #include "io/channel.h" =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc); +void migration_channel_process_incoming(QIOChannel *ioc); =20 void migration_channel_connect(MigrationState *s, QIOChannel *ioc, diff --git a/migration/channel.c b/migration/channel.c index c66c6db..6f11a1a 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -20,9 +20,10 @@ #include "qapi/error.h" #include "io/channel-tls.h" =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc) +void migration_channel_process_incoming(QIOChannel *ioc) { + MigrationState *s =3D migrate_get_current(); + trace_migration_set_incoming_channel( ioc, object_get_typename(OBJECT(ioc))); =20 diff --git a/migration/exec.c b/migration/exec.c index 7d13fc3..2779c9c 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -48,7 +48,7 @@ static gboolean exec_accept_incoming_migration(QIOChannel= *ioc, GIOCondition condition, gpointer opaque) { - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); return FALSE; /* unregister */ } diff --git a/migration/fd.c b/migration/fd.c index f9c230e..fba3852 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -48,7 +48,7 @@ static gboolean fd_accept_incoming_migration(QIOChannel *= ioc, GIOCondition condition, gpointer opaque) { - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); return FALSE; /* unregister */ } diff --git a/migration/socket.c b/migration/socket.c index 7171635..b06cde3 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -149,8 +149,7 @@ static gboolean socket_accept_incoming_migration(QIOCha= nnel *ioc, trace_migration_socket_incoming_accepted(); =20 qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-incoming"); - migration_channel_process_incoming(migrate_get_current(), - QIO_CHANNEL(sioc)); + migration_channel_process_incoming(QIO_CHANNEL(sioc)); object_unref(OBJECT(sioc)); =20 out: diff --git a/migration/tls.c b/migration/tls.c index 4ee3349..2b28ebd 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -73,7 +73,7 @@ static void migration_tls_incoming_handshake(QIOTask *tas= k, error_report_err(err); } else { trace_migration_tls_incoming_handshake_complete(); - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); } object_unref(OBJECT(ioc)); } --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459519162743.5479928055943; Mon, 17 Apr 2017 13:05:19 -0700 (PDT) Received: from localhost ([::1]:38552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cth-0000rw-Sz for importer@patchew.org; Mon, 17 Apr 2017 16:05:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpQ-0005zG-NH for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpP-0004NR-TC for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35552) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpP-0004Mx-O2 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:51 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94FB0C05005F for ; Mon, 17 Apr 2017 20:00:50 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D4255DC19; Mon, 17 Apr 2017 20:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 94FB0C05005F Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 94FB0C05005F From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:27 +0200 Message-Id: <20170417200041.2451-6-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 17 Apr 2017 20:00:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 05/19] migration: Export exec.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/exec.h | 20 ++++++++++++++++++++ include/migration/migration.h | 4 ---- migration/exec.c | 2 +- migration/migration.c | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 include/migration/exec.h diff --git a/include/migration/exec.h b/include/migration/exec.h new file mode 100644 index 0000000..c97a7e9 --- /dev/null +++ b/include/migration/exec.h @@ -0,0 +1,20 @@ +/* + * QEMU live migration exec functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_EXEC_H +#define QEMU_MIGRATION_EXEC_H +void exec_start_incoming_migration(const char *host_port, Error **errp); + +void exec_start_outgoing_migration(MigrationState *s, const char *host_por= t, + Error **errp); +#endif diff --git a/include/migration/migration.h b/include/migration/migration.h index 3f54a7c..eb0150b 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -194,10 +194,6 @@ void migration_tls_channel_connect(MigrationState *s, =20 uint64_t migrate_max_downtime(void); =20 -void exec_start_incoming_migration(const char *host_port, Error **errp); - -void exec_start_outgoing_migration(MigrationState *s, const char *host_por= t, Error **errp); - void tcp_start_incoming_migration(const char *host_port, Error **errp); =20 void tcp_start_outgoing_migration(MigrationState *s, const char *host_port= , Error **errp); diff --git a/migration/exec.c b/migration/exec.c index 2779c9c..1a2d5c2 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -21,7 +21,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "migration/channel.h" -#include "migration/migration.h" +#include "migration/exec.h" #include "io/channel-command.h" #include "trace.h" =20 diff --git a/migration/migration.c b/migration/migration.c index 17d22eb..076c42a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -21,6 +21,7 @@ #include "migration/machine.h" #include "migration/state.h" #include "migration/init.h" +#include "migration/exec.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459679214273.8692249529631; Mon, 17 Apr 2017 13:07:59 -0700 (PDT) Received: from localhost ([::1]:38565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CwG-00033T-49 for importer@patchew.org; Mon, 17 Apr 2017 16:07:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpS-0005zs-13 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpR-0004OA-4t for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpQ-0004Nj-Vf for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB2ED8124F for ; Mon, 17 Apr 2017 20:00:51 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5CEE17CF2; Mon, 17 Apr 2017 20:00:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DB2ED8124F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DB2ED8124F From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:28 +0200 Message-Id: <20170417200041.2451-7-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 17 Apr 2017 20:00:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 06/19] migration: Export fd.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/fd.h | 20 ++++++++++++++++++++ include/migration/migration.h | 4 ---- migration/fd.c | 2 +- migration/migration.c | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 include/migration/fd.h diff --git a/include/migration/fd.h b/include/migration/fd.h new file mode 100644 index 0000000..4ec3298 --- /dev/null +++ b/include/migration/fd.h @@ -0,0 +1,20 @@ +/* + * QEMU live migration fd functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_FD_H +#define QEMU_MIGRATION_FD_H +void fd_start_incoming_migration(const char *path, Error **errp); + +void fd_start_outgoing_migration(MigrationState *s, const char *fdname, + Error **errp); +#endif diff --git a/include/migration/migration.h b/include/migration/migration.h index eb0150b..077b75b 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -202,10 +202,6 @@ void unix_start_incoming_migration(const char *path, E= rror **errp); =20 void unix_start_outgoing_migration(MigrationState *s, const char *path, Er= ror **errp); =20 -void fd_start_incoming_migration(const char *path, Error **errp); - -void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Er= ror **errp); - void rdma_start_outgoing_migration(void *opaque, const char *host_port, Er= ror **errp); =20 void rdma_start_incoming_migration(const char *host_port, Error **errp); diff --git a/migration/fd.c b/migration/fd.c index fba3852..78ebd5b 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -18,7 +18,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "migration/channel.h" -#include "migration/migration.h" +#include "migration/fd.h" #include "monitor/monitor.h" #include "io/channel-util.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index 076c42a..a608faa 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -22,6 +22,7 @@ #include "migration/state.h" #include "migration/init.h" #include "migration/exec.h" +#include "migration/fd.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459521505881.3520452418445; Mon, 17 Apr 2017 13:05:21 -0700 (PDT) Received: from localhost ([::1]:38554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Ctk-0000vD-4a for importer@patchew.org; Mon, 17 Apr 2017 16:05:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpT-00061V-JS for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpS-0004Oe-IU for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56232) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpS-0004OM-9q for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 325298FCE5 for ; Mon, 17 Apr 2017 20:00:53 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 399D05DC19; Mon, 17 Apr 2017 20:00:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 325298FCE5 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 325298FCE5 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:29 +0200 Message-Id: <20170417200041.2451-8-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 17 Apr 2017 20:00:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 07/19] migration: Export socket.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/migration.h | 8 -------- include/migration/socket.h | 25 +++++++++++++++++++++++++ migration/migration.c | 1 + migration/socket.c | 1 + 4 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 include/migration/socket.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 077b75b..0c6dae5 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -194,14 +194,6 @@ void migration_tls_channel_connect(MigrationState *s, =20 uint64_t migrate_max_downtime(void); =20 -void tcp_start_incoming_migration(const char *host_port, Error **errp); - -void tcp_start_outgoing_migration(MigrationState *s, const char *host_port= , Error **errp); - -void unix_start_incoming_migration(const char *path, Error **errp); - -void unix_start_outgoing_migration(MigrationState *s, const char *path, Er= ror **errp); - void rdma_start_outgoing_migration(void *opaque, const char *host_port, Er= ror **errp); =20 void rdma_start_incoming_migration(const char *host_port, Error **errp); diff --git a/include/migration/socket.h b/include/migration/socket.h new file mode 100644 index 0000000..800fde1 --- /dev/null +++ b/include/migration/socket.h @@ -0,0 +1,25 @@ +/* + * QEMU live migration socket functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_SOCKET_H +#define QEMU_MIGRATION_SOCKET_H +void tcp_start_incoming_migration(const char *host_port, Error **errp); + +void tcp_start_outgoing_migration(MigrationState *s, const char *host_port, + Error **errp); + +void unix_start_incoming_migration(const char *path, Error **errp); + +void unix_start_outgoing_migration(MigrationState *s, const char *path, + Error **errp); +#endif diff --git a/migration/migration.c b/migration/migration.c index a608faa..181839b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -23,6 +23,7 @@ #include "migration/init.h" #include "migration/exec.h" #include "migration/fd.h" +#include "migration/socket.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" diff --git a/migration/socket.c b/migration/socket.c index b06cde3..71a8439 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -20,6 +20,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "migration/channel.h" +#include "migration/socket.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "io/channel-socket.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459680351171.53849535193046; Mon, 17 Apr 2017 13:08:00 -0700 (PDT) Received: from localhost ([::1]:38566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CwI-00035U-KW for importer@patchew.org; Mon, 17 Apr 2017 16:07:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpU-00063q-Pa for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpT-0004QS-To for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52942) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpT-0004Om-L0 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E6224E024 for ; Mon, 17 Apr 2017 20:00:54 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84B1D179F8; Mon, 17 Apr 2017 20:00:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8E6224E024 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8E6224E024 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:30 +0200 Message-Id: <20170417200041.2451-9-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Apr 2017 20:00: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] [PATCH 08/19] migration: Export tls.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Just for the functions exported from tls.c. Notice that we can't remove the migration/migration.h include from tls.c because it access directly MigrationState for the tls params. Signed-off-by: Juan Quintela --- include/migration/migration.h | 9 --------- include/migration/tls.h | 27 +++++++++++++++++++++++++++ migration/channel.c | 1 + migration/migration.c | 1 - migration/tls.c | 1 + 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 include/migration/tls.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 0c6dae5..d6f2e94 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -183,15 +183,6 @@ void migrate_set_state(int *state, int old_state, int = new_state); =20 void migration_fd_process_incoming(QEMUFile *f); =20 -void migration_tls_channel_process_incoming(MigrationState *s, - QIOChannel *ioc, - Error **errp); - -void migration_tls_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname, - Error **errp); - uint64_t migrate_max_downtime(void); =20 void rdma_start_outgoing_migration(void *opaque, const char *host_port, Er= ror **errp); diff --git a/include/migration/tls.h b/include/migration/tls.h new file mode 100644 index 0000000..1d63263 --- /dev/null +++ b/include/migration/tls.h @@ -0,0 +1,27 @@ +/* + * QEMU live migration tls functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_TLS_H +#define QEMU_MIGRATION_TLS_H + +#include "io/channel.h" + +void migration_tls_channel_process_incoming(MigrationState *s, + QIOChannel *ioc, + Error **errp); + +void migration_tls_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname, + Error **errp); +#endif diff --git a/migration/channel.c b/migration/channel.c index 6f11a1a..10416e0 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -15,6 +15,7 @@ =20 #include "qemu/osdep.h" #include "migration/channel.h" +#include "migration/tls.h" #include "migration/migration.h" #include "trace.h" #include "qapi/error.h" diff --git a/migration/migration.c b/migration/migration.c index 181839b..ce34be5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -42,7 +42,6 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "io/channel-buffer.h" -#include "io/channel-tls.h" #include "migration/colo.h" =20 #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttli= ng */ diff --git a/migration/tls.c b/migration/tls.c index 2b28ebd..b9e1791 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "migration/channel.h" #include "migration/migration.h" +#include "migration/tls.h" #include "io/channel-tls.h" #include "crypto/tlscreds.h" #include "qemu/error-report.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149245981922693.8136952933595; Mon, 17 Apr 2017 13:10:19 -0700 (PDT) Received: from localhost ([::1]:38579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CyX-00050Z-Ql for importer@patchew.org; Mon, 17 Apr 2017 16:10:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpY-000671-0a for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpV-0004RB-9a for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpV-0004Qc-06 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D51D83DBC4 for ; Mon, 17 Apr 2017 20:00:55 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFAAB179F8; Mon, 17 Apr 2017 20:00:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D51D83DBC4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D51D83DBC4 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:31 +0200 Message-Id: <20170417200041.2451-10-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 17 Apr 2017 20:00:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 09/19] migration: Create block capabilities for shared and enable 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This two capabilites were added through the command line. Notice that we just created them. This is just the boilerplate. Signed-off-by: Juan Quintela Reviewed-by: Eric Blake --- include/migration/migration.h | 3 +++ migration/migration.c | 36 ++++++++++++++++++++++++++++++++++++ qapi-schema.json | 7 ++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index d6f2e94..5c78ae1 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -242,6 +242,9 @@ bool migrate_colo_enabled(void); =20 int64_t xbzrle_cache_resize(int64_t new_size); =20 +bool migrate_use_block_enabled(void); +bool migrate_use_block_shared(void); + bool migrate_use_compression(void); int migrate_compress_level(void); int migrate_compress_threads(void); diff --git a/migration/migration.c b/migration/migration.c index ce34be5..2f10657 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1151,6 +1151,16 @@ bool migration_is_blocked(Error **errp) return false; } =20 +static void migrate_set_block_shared(MigrationState *s) +{ + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED] =3D true; +} + +static void migrate_set_block_enabled(MigrationState *s) +{ + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] =3D true; +} + void qmp_migrate(const char *uri, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, Error **errp) @@ -1180,6 +1190,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool= blk, =20 s =3D migrate_init(¶ms); =20 + if (has_blk && blk) { + migrate_set_block_enabled(s); + } + + if (has_inc && inc) { + migrate_set_block_shared(s); + } + if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); #ifdef CONFIG_RDMA @@ -1375,6 +1393,24 @@ int64_t migrate_xbzrle_cache_size(void) return s->xbzrle_cache_size; } =20 +bool migrate_use_block_enabled(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED]; +} + +bool migrate_use_block_shared(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED]; +} + /* migration thread support */ /* * Something bad happened to the RP stream, mark an error diff --git a/qapi-schema.json b/qapi-schema.json index 01b087f..e963bb3 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -894,11 +894,16 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on the s= ource # during postcopy-ram migration. (since 2.9) # +# @block-enabled: enable block migration (Since 2.10) +# +# @block-shared: enable block shared migration (Since 2.10) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] } + 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', + 'block-enabled', 'block-shared' ] } =20 ## # @MigrationCapabilityStatus: --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459934005119.39016956051773; Mon, 17 Apr 2017 13:12:14 -0700 (PDT) Received: from localhost ([::1]:38590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0D0O-0006aY-Fm for importer@patchew.org; Mon, 17 Apr 2017 16:12:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpY-000670-0J for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpW-0004S4-KY for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36200) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpW-0004RN-B3 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36789C059754 for ; Mon, 17 Apr 2017 20:00:57 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3334E5DC19; Mon, 17 Apr 2017 20:00:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 36789C059754 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 36789C059754 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:32 +0200 Message-Id: <20170417200041.2451-11-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 17 Apr 2017 20:00:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 10/19] migration: Remove use of old MigrationParams 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have change in the previous patch to use migration capabilities for it. Notice that we continue using the old command line flags from migrate command from the time being. Remove the set_params method as now it is empty. Signed-off-by: Juan Quintela --- include/migration/migration.h | 2 -- migration/block.c | 17 ++--------------- migration/colo.c | 3 --- migration/migration.c | 8 +++++--- migration/savevm.c | 2 -- 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 5c78ae1..09d3188 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -41,8 +41,6 @@ extern int only_migratable; =20 struct MigrationParams { - bool blk; - bool shared; }; =20 /* Messages sent on the return path from destination to source */ diff --git a/migration/block.c b/migration/block.c index 7734ff7..9490343 100644 --- a/migration/block.c +++ b/migration/block.c @@ -94,9 +94,6 @@ typedef struct BlkMigBlock { } BlkMigBlock; =20 typedef struct BlkMigState { - /* Written during setup phase. Can be read without a lock. */ - int blk_enable; - int shared_base; QSIMPLEQ_HEAD(bmds_list, BlkMigDevState) bmds_list; int64_t total_sector_sum; bool zero_blocks; @@ -425,7 +422,7 @@ static int init_blk_migration(QEMUFile *f) bmds->bulk_completed =3D 0; bmds->total_sectors =3D sectors; bmds->completed_sectors =3D 0; - bmds->shared_base =3D block_mig_state.shared_base; + bmds->shared_base =3D migrate_use_block_shared(); =20 assert(i < num_bs); bmds_bs[i].bmds =3D bmds; @@ -963,22 +960,12 @@ static int block_load(QEMUFile *f, void *opaque, int = version_id) return 0; } =20 -static void block_set_params(const MigrationParams *params, void *opaque) -{ - block_mig_state.blk_enable =3D params->blk; - block_mig_state.shared_base =3D params->shared; - - /* shared base means that blk_enable =3D 1 */ - block_mig_state.blk_enable |=3D params->shared; -} - static bool block_is_active(void *opaque) { - return block_mig_state.blk_enable =3D=3D 1; + return migrate_use_block_enabled(); } =20 static SaveVMHandlers savevm_block_handlers =3D { - .set_params =3D block_set_params, .save_live_setup =3D block_save_setup, .save_live_iterate =3D block_save_iterate, .save_live_complete_precopy =3D block_save_complete, diff --git a/migration/colo.c b/migration/colo.c index eec1959..4c2365e 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -333,9 +333,6 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, goto out; } =20 - /* Disable block migration */ - s->params.blk =3D 0; - s->params.shared =3D 0; qemu_savevm_state_header(fb); qemu_savevm_state_begin(fb, &s->params); qemu_mutex_lock_iothread(); diff --git a/migration/migration.c b/migration/migration.c index 2f10657..39b4a41 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -743,6 +743,10 @@ void qmp_migrate_set_capabilities(MigrationCapabilityS= tatusList *params, s->enabled_capabilities[cap->value->capability] =3D cap->value->st= ate; } =20 + if (s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED]) { + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] =3D tr= ue; + } + if (migrate_postcopy_ram()) { if (migrate_use_compression()) { /* The decompression threads asynchronously write into RAM @@ -1170,9 +1174,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, MigrationParams params; const char *p; =20 - params.blk =3D has_blk && blk; - params.shared =3D has_inc && inc; - if (migration_is_setup_or_active(s->state) || s->state =3D=3D MIGRATION_STATUS_CANCELLING || s->state =3D=3D MIGRATION_STATUS_COLO) { @@ -1195,6 +1196,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, } =20 if (has_inc && inc) { + migrate_set_block_enabled(s); migrate_set_block_shared(s); } =20 diff --git a/migration/savevm.c b/migration/savevm.c index c47b209..c4435e1 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1237,8 +1237,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) { int ret; MigrationParams params =3D { - .blk =3D 0, - .shared =3D 0 }; MigrationState *ms =3D migrate_init(¶ms); MigrationStatus status; --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459862099353.84934532133616; Mon, 17 Apr 2017 13:11:02 -0700 (PDT) Received: from localhost ([::1]:38585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CzE-0005cZ-IZ for importer@patchew.org; Mon, 17 Apr 2017 16:11:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CpY-00067x-Vp for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpX-0004SH-Tr for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpX-0004S8-Ki for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:00:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C832C059727 for ; Mon, 17 Apr 2017 20:00:58 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85C42179F8; Mon, 17 Apr 2017 20:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7C832C059727 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7C832C059727 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:33 +0200 Message-Id: <20170417200041.2451-12-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 17 Apr 2017 20:00:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 11/19] migration: Remove old MigrationParams 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not used anymore after moving block migration to use capabilities. Signed-off-by: Juan Quintela --- include/migration/migration.h | 10 +++------- include/migration/vmstate.h | 1 - include/qemu/typedefs.h | 1 - include/sysemu/sysemu.h | 3 +-- migration/colo.c | 2 +- migration/migration.c | 8 +++----- migration/savevm.c | 16 +++------------- 7 files changed, 11 insertions(+), 30 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 09d3188..3353de1 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -40,9 +40,6 @@ /* for vl.c */ extern int only_migratable; =20 -struct MigrationParams { -}; - /* Messages sent on the return path from destination to source */ enum mig_rp_message_type { MIG_RP_MSG_INVALID =3D 0, /* Must be 0 */ @@ -132,12 +129,10 @@ struct MigrationState QEMUBH *cleanup_bh; QEMUFile *to_dst_file; =20 - /* New style params from 'migrate-set-parameters' */ + /* params from 'migrate-set-parameters' */ MigrationParameters parameters; =20 int state; - /* Old style params from 'migrate' command */ - MigrationParams params; =20 /* State related to return path */ struct { @@ -191,7 +186,8 @@ void migrate_fd_error(MigrationState *s, const Error *e= rror); =20 void migrate_fd_connect(MigrationState *s); =20 -MigrationState *migrate_init(const MigrationParams *params); +MigrationState *migrate_init(void); + bool migration_is_blocked(Error **errp); /* True if outgoing migration has entered postcopy phase */ bool migration_in_postcopy(void); diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 624aa0d..f4c5bed 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -37,7 +37,6 @@ typedef int LoadStateHandler(QEMUFile *f, void *opaque, i= nt version_id); =20 typedef struct SaveVMHandlers { /* This runs inside the iothread lock. */ - void (*set_params)(const MigrationParams *params, void * opaque); SaveStateHandler *save_state; =20 void (*cleanup)(void *opaque); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index e95f28c..7e6021c 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -48,7 +48,6 @@ typedef struct MemoryRegion MemoryRegion; typedef struct MemoryRegionCache MemoryRegionCache; typedef struct MemoryRegionSection MemoryRegionSection; typedef struct MigrationIncomingState MigrationIncomingState; -typedef struct MigrationParams MigrationParams; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; typedef struct MonitorDef MonitorDef; diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 16175f7..5f2f21d 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -105,8 +105,7 @@ enum qemu_vm_cmd { #define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) =20 bool qemu_savevm_state_blocked(Error **errp); -void qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params); +void qemu_savevm_state_begin(QEMUFile *f); void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); diff --git a/migration/colo.c b/migration/colo.c index 4c2365e..2924602 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -334,7 +334,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, } =20 qemu_savevm_state_header(fb); - qemu_savevm_state_begin(fb, &s->params); + qemu_savevm_state_begin(fb); qemu_mutex_lock_iothread(); qemu_savevm_state_complete_precopy(fb, false); qemu_mutex_unlock_iothread(); diff --git a/migration/migration.c b/migration/migration.c index 39b4a41..9ab66b6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1058,7 +1058,7 @@ bool migration_is_idle(void) return false; } =20 -MigrationState *migrate_init(const MigrationParams *params) +MigrationState *migrate_init(void) { MigrationState *s =3D migrate_get_current(); =20 @@ -1072,7 +1072,6 @@ MigrationState *migrate_init(const MigrationParams *p= arams) s->cleanup_bh =3D 0; s->to_dst_file =3D NULL; s->state =3D MIGRATION_STATUS_NONE; - s->params =3D *params; s->rp_state.from_dst_file =3D NULL; s->rp_state.error =3D false; s->mbps =3D 0.0; @@ -1171,7 +1170,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); - MigrationParams params; const char *p; =20 if (migration_is_setup_or_active(s->state) || @@ -1189,7 +1187,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, return; } =20 - s =3D migrate_init(¶ms); + s =3D migrate_init(); =20 if (has_blk && blk) { migrate_set_block_enabled(s); @@ -1917,7 +1915,7 @@ static void *migration_thread(void *opaque) qemu_savevm_send_postcopy_advise(s->to_dst_file); } =20 - qemu_savevm_state_begin(s->to_dst_file, &s->params); + qemu_savevm_state_begin(s->to_dst_file); =20 s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; current_active_state =3D MIGRATION_STATUS_ACTIVE; diff --git a/migration/savevm.c b/migration/savevm.c index c4435e1..96cf6db 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -970,21 +970,13 @@ void qemu_savevm_state_header(QEMUFile *f) =20 } =20 -void qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params) +void qemu_savevm_state_begin(QEMUFile *f) { SaveStateEntry *se; int ret; =20 trace_savevm_state_begin(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (!se->ops || !se->ops->set_params) { - continue; - } - se->ops->set_params(params, se->opaque); - } - - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->save_live_setup) { continue; } @@ -1236,9 +1228,7 @@ void qemu_savevm_state_cleanup(void) static int qemu_savevm_state(QEMUFile *f, Error **errp) { int ret; - MigrationParams params =3D { - }; - MigrationState *ms =3D migrate_init(¶ms); + MigrationState *ms =3D migrate_init(); MigrationStatus status; ms->to_dst_file =3D f; =20 @@ -1249,7 +1239,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) =20 qemu_mutex_unlock_iothread(); qemu_savevm_state_header(f); - qemu_savevm_state_begin(f, ¶ms); + qemu_savevm_state_begin(f); qemu_mutex_lock_iothread(); =20 while (qemu_file_get_error(f) =3D=3D 0) { --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149245952328236.262263462748365; Mon, 17 Apr 2017 13:05:23 -0700 (PDT) Received: from localhost ([::1]:38553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Ctl-0000uv-QK for importer@patchew.org; Mon, 17 Apr 2017 16:05:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpd-0006CY-Ez for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0CpZ-0004TD-7v for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0CpY-0004Sm-Ua for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC1102DC342 for ; Mon, 17 Apr 2017 20:00:59 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE09C179F8; Mon, 17 Apr 2017 20:00:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CC1102DC342 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CC1102DC342 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:34 +0200 Message-Id: <20170417200041.2451-13-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 17 Apr 2017 20:00:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 12/19] migration: Remove unneeded includes 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" I just removed includes that allow me to still compile everything. Signed-off-by: Juan Quintela --- include/migration/colo.h | 3 --- migration/block.c | 7 ------- migration/colo-comm.c | 1 - migration/colo-failover.c | 1 + migration/colo.c | 2 -- migration/exec.c | 1 - migration/fd.c | 1 - migration/migration.c | 5 ----- migration/postcopy-ram.c | 2 -- migration/qemu-file.c | 4 +--- migration/ram.c | 2 -- migration/rdma.c | 1 - migration/savevm.c | 5 ----- 13 files changed, 2 insertions(+), 33 deletions(-) diff --git a/include/migration/colo.h b/include/migration/colo.h index ba0bb6e..be6beba 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -14,9 +14,6 @@ #define QEMU_COLO_H =20 #include "qemu-common.h" -#include "qemu/coroutine_int.h" -#include "qemu/thread.h" -#include "qemu/main-loop.h" =20 bool colo_supported(void); void colo_info_init(void); diff --git a/migration/block.c b/migration/block.c index 9490343..0722837 100644 --- a/migration/block.c +++ b/migration/block.c @@ -15,17 +15,10 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" -#include "block/block.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" -#include "hw/hw.h" #include "qemu/cutils.h" -#include "qemu/queue.h" -#include "qemu/timer.h" #include "migration/block.h" #include "migration/migration.h" -#include "sysemu/blockdev.h" #include "sysemu/block-backend.h" =20 #define BLOCK_SIZE (1 << 20) diff --git a/migration/colo-comm.c b/migration/colo-comm.c index 3d91798..4161242 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include "migration/migration.h" #include "migration/colo.h" -#include "trace.h" =20 typedef struct { bool colo_requested; diff --git a/migration/colo-failover.c b/migration/colo-failover.c index cc229f5..1c0025b 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "migration/colo.h" #include "migration/failover.h" #include "qmp-commands.h" diff --git a/migration/colo.c b/migration/colo.c index 2924602..d455884 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -11,14 +11,12 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/timer.h" #include "sysemu/sysemu.h" #include "migration/migration.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" #include "qemu/error-report.h" -#include "qapi/error.h" #include "migration/failover.h" #include "replication.h" #include "qmp-commands.h" diff --git a/migration/exec.c b/migration/exec.c index 1a2d5c2..7939c95 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -19,7 +19,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" #include "migration/channel.h" #include "migration/exec.h" #include "io/channel-command.h" diff --git a/migration/fd.c b/migration/fd.c index 78ebd5b..ae41b06 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -16,7 +16,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" #include "migration/channel.h" #include "migration/fd.h" #include "monitor/monitor.h" diff --git a/migration/migration.c b/migration/migration.c index 9ab66b6..9990c46 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -16,7 +16,6 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "migration/blocker.h" #include "migration/machine.h" #include "migration/state.h" @@ -30,7 +29,6 @@ #include "block/block.h" #include "qapi/qmp/qerror.h" #include "qapi/util.h" -#include "qemu/sockets.h" #include "qemu/rcu.h" #include "migration/block.h" #include "migration/postcopy-ram.h" @@ -38,9 +36,6 @@ #include "qmp-commands.h" #include "trace.h" #include "qapi-event.h" -#include "qom/cpu.h" -#include "exec/memory.h" -#include "exec/address-spaces.h" #include "io/channel-buffer.h" #include "migration/colo.h" =20 diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 85fd8d7..11b24c6 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -17,8 +17,6 @@ */ =20 #include "qemu/osdep.h" - -#include "qemu-common.h" #include "migration/migration.h" #include "migration/postcopy-ram.h" #include "sysemu/sysemu.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 195fa94..460e536 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -26,10 +26,8 @@ #include "qemu-common.h" #include "qemu/error-report.h" #include "qemu/iov.h" -#include "qemu/sockets.h" -#include "qemu/coroutine.h" -#include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/migration.h" #include "trace.h" =20 #define IO_BUF_SIZE 32768 diff --git a/migration/ram.c b/migration/ram.c index 1bd8599..4f49622 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -33,13 +33,11 @@ #include "qemu/cutils.h" #include "qemu/bitops.h" #include "qemu/bitmap.h" -#include "qemu/timer.h" #include "qemu/main-loop.h" #include "migration/xbzrle.h" #include "migration/init.h" #include "migration/migration.h" #include "migration/postcopy-ram.h" -#include "exec/address-spaces.h" #include "migration/page_cache.h" #include "qemu/error-report.h" #include "trace.h" diff --git a/migration/rdma.c b/migration/rdma.c index 674ccab..94d4840 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -19,7 +19,6 @@ #include "qemu/cutils.h" #include "migration/migration.h" #include "migration/qemu-file.h" -#include "exec/cpu-common.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h" diff --git a/migration/savevm.c b/migration/savevm.c index 96cf6db..b03973a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -29,13 +29,10 @@ #include "qemu/osdep.h" #include "cpu.h" #include "hw/boards.h" -#include "hw/hw.h" -#include "hw/qdev.h" #include "hw/xen/xen.h" #include "net/net.h" #include "monitor/monitor.h" #include "sysemu/sysemu.h" -#include "qemu/timer.h" #include "audio/audio.h" #include "migration/machine.h" #include "migration/migration.h" @@ -43,11 +40,9 @@ #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/sockets.h" -#include "qemu/queue.h" #include "sysemu/cpus.h" #include "qmp-commands.h" #include "trace.h" -#include "qemu/bitops.h" #include "qemu/iov.h" #include "block/snapshot.h" #include "block/qapi.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492460042094775.8622312084176; Mon, 17 Apr 2017 13:14:02 -0700 (PDT) Received: from localhost ([::1]:38603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0D28-00081u-6w for importer@patchew.org; Mon, 17 Apr 2017 16:14:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpb-0006AX-8A for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpa-0004Ts-GQ for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58298) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpa-0004TO-7w for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 237DEA794 for ; Mon, 17 Apr 2017 20:01:01 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29B475DC19; Mon, 17 Apr 2017 20:00:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 237DEA794 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 237DEA794 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:35 +0200 Message-Id: <20170417200041.2451-14-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 17 Apr 2017 20:01: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] [PATCH 13/19] migration: Remove qemu-file.h from vmstate.h 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/hw/hw.h | 1 + include/migration/vmstate.h | 3 --- migration/block.c | 1 + migration/channel.c | 1 + migration/colo.c | 1 + migration/postcopy-ram.c | 1 + migration/ram.c | 1 + 7 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/hw/hw.h b/include/hw/hw.h index e22d4ce..af9eae1 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -11,6 +11,7 @@ #include "exec/memory.h" #include "hw/irq.h" #include "migration/vmstate.h" +#include "migration/qemu-file.h" #include "qemu/module.h" #include "sysemu/reset.h" =20 diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f4c5bed..1e6fcb5 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -27,9 +27,6 @@ #ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H =20 -#ifndef CONFIG_USER_ONLY -#include "migration/qemu-file.h" -#endif #include "migration/qjson.h" =20 typedef void SaveStateHandler(QEMUFile *f, void *opaque); diff --git a/migration/block.c b/migration/block.c index 0722837..e45a42d 100644 --- a/migration/block.c +++ b/migration/block.c @@ -19,6 +19,7 @@ #include "qemu/cutils.h" #include "migration/block.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "sysemu/block-backend.h" =20 #define BLOCK_SIZE (1 << 20) diff --git a/migration/channel.c b/migration/channel.c index 10416e0..04a26c5 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -17,6 +17,7 @@ #include "migration/channel.h" #include "migration/tls.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "trace.h" #include "qapi/error.h" #include "io/channel-tls.h" diff --git a/migration/colo.c b/migration/colo.c index d455884..e2eaccd 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "sysemu/sysemu.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 11b24c6..5aea2ff 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -18,6 +18,7 @@ =20 #include "qemu/osdep.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "migration/postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" diff --git a/migration/ram.c b/migration/ram.c index 4f49622..b0759ac 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -37,6 +37,7 @@ #include "migration/xbzrle.h" #include "migration/init.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "migration/postcopy-ram.h" #include "migration/page_cache.h" #include "qemu/error-report.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459683233173.30256499153006; Mon, 17 Apr 2017 13:08:03 -0700 (PDT) Received: from localhost ([::1]:38568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CwL-00037y-MD for importer@patchew.org; Mon, 17 Apr 2017 16:08:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpd-0006CC-67 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpc-0004VY-Cr for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39556) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpc-0004U8-7r for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 267818047E for ; Mon, 17 Apr 2017 20:01:03 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7472B5DC19; Mon, 17 Apr 2017 20:01:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 267818047E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 267818047E From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:36 +0200 Message-Id: <20170417200041.2451-15-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 17 Apr 2017 20:01:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 14/19] migration: Remove vmstate.h from migration.h 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 - migration/block.c | 1 + migration/colo-comm.c | 1 + migration/migration.c | 1 + migration/ram.c | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 3353de1..1451067 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -17,7 +17,6 @@ #include "qapi/qmp/qdict.h" #include "qemu-common.h" #include "qemu/thread.h" -#include "migration/vmstate.h" #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" diff --git a/migration/block.c b/migration/block.c index e45a42d..3048088 100644 --- a/migration/block.c +++ b/migration/block.c @@ -20,6 +20,7 @@ #include "migration/block.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "sysemu/block-backend.h" =20 #define BLOCK_SIZE (1 << 20) diff --git a/migration/colo-comm.c b/migration/colo-comm.c index 4161242..f11fa81 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "migration/migration.h" +#include "migration/vmstate.h" #include "migration/colo.h" =20 typedef struct { diff --git a/migration/migration.c b/migration/migration.c index 9990c46..c2c25fe 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -25,6 +25,7 @@ #include "migration/socket.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "sysemu/sysemu.h" #include "block/block.h" #include "qapi/qmp/qerror.h" diff --git a/migration/ram.c b/migration/ram.c index b0759ac..49e518f 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -38,6 +38,7 @@ #include "migration/init.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "migration/postcopy-ram.h" #include "migration/page_cache.h" #include "qemu/error-report.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459680489786.74307572157; Mon, 17 Apr 2017 13:08:00 -0700 (PDT) Received: from localhost ([::1]:38567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CwJ-00035a-0C for importer@patchew.org; Mon, 17 Apr 2017 16:07:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpi-0006HH-47 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpf-0004XR-3A for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53080) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpe-0004XL-QR for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3DD8627C8 for ; Mon, 17 Apr 2017 20:01:05 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77DAD4FA20; Mon, 17 Apr 2017 20:01:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B3DD8627C8 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B3DD8627C8 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:37 +0200 Message-Id: <20170417200041.2451-16-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Apr 2017 20:01:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 15/19] migration: Export qemu-file-channel.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/qemu-file-channel.h | 22 ++++++++++++++++++++++ include/migration/qemu-file.h | 3 --- migration/channel.c | 2 +- migration/colo.c | 2 +- migration/migration.c | 2 +- migration/qemu-file-channel.c | 2 +- migration/rdma.c | 2 +- migration/savevm.c | 1 + 8 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 include/migration/qemu-file-channel.h diff --git a/include/migration/qemu-file-channel.h b/include/migration/qemu= -file-channel.h new file mode 100644 index 0000000..bbbf36d --- /dev/null +++ b/include/migration/qemu-file-channel.h @@ -0,0 +1,22 @@ +/* + * QEMU migration blockers + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_FILE_CHANNEL_H +#define QEMU_FILE_CHANNEL_H + +#include "migration/qemu-file.h" +#include "io/channel.h" + +QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); +QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); +#endif diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 0cd648a..ec73647 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -27,7 +27,6 @@ =20 #include "qemu-common.h" #include "exec/cpu-common.h" -#include "io/channel.h" =20 =20 /* Read a chunk of data from a file at the given position. The pos argume= nt @@ -119,8 +118,6 @@ typedef struct QEMUFileHooks { } QEMUFileHooks; =20 QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops); -QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); -QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks); int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); diff --git a/migration/channel.c b/migration/channel.c index 04a26c5..e4a0443 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -17,7 +17,7 @@ #include "migration/channel.h" #include "migration/tls.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-channel.h" #include "trace.h" #include "qapi/error.h" #include "io/channel-tls.h" diff --git a/migration/colo.c b/migration/colo.c index e2eaccd..150ac6a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "sysemu/sysemu.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-channel.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index c2c25fe..6e32be0 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -24,7 +24,7 @@ #include "migration/fd.h" #include "migration/socket.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-channel.h" #include "migration/vmstate.h" #include "sysemu/sysemu.h" #include "block/block.h" diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c index 45c13f1..87e44ec 100644 --- a/migration/qemu-file-channel.c +++ b/migration/qemu-file-channel.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-channel.h" #include "io/channel-socket.h" #include "qemu/iov.h" =20 diff --git a/migration/rdma.c b/migration/rdma.c index 94d4840..d9a2d64 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -18,7 +18,7 @@ #include "qemu-common.h" #include "qemu/cutils.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-channel.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h" diff --git a/migration/savevm.c b/migration/savevm.c index b03973a..1e6cf79 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "audio/audio.h" #include "migration/machine.h" #include "migration/migration.h" +#include "migration/qemu-file-channel.h" #include "migration/postcopy-ram.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459976795169.87915612579877; Mon, 17 Apr 2017 13:12:56 -0700 (PDT) Received: from localhost ([::1]:38591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0D15-0007Bc-Bf for importer@patchew.org; Mon, 17 Apr 2017 16:12:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpi-0006Hl-MJ for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cph-0004Xp-I5 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cph-0004Xb-8R for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2756A61E4C for ; Mon, 17 Apr 2017 20:01:08 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13990179F8; Mon, 17 Apr 2017 20:01:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2756A61E4C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2756A61E4C From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:38 +0200 Message-Id: <20170417200041.2451-17-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 20:01:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 16/19] migration: Export ram.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 36 ----------------------------- include/migration/ram.h | 54 +++++++++++++++++++++++++++++++++++++++= ++++ migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/ram.c | 1 + migration/rdma.c | 1 + migration/savevm.c | 1 + 7 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 include/migration/ram.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 1451067..3e5d106 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -192,36 +192,6 @@ bool migration_is_blocked(Error **errp); bool migration_in_postcopy(void); MigrationState *migrate_get_current(void); =20 -void migrate_compress_threads_create(void); -void migrate_compress_threads_join(void); -void migrate_decompress_threads_create(void); -void migrate_decompress_threads_join(void); -uint64_t ram_bytes_remaining(void); -uint64_t ram_bytes_transferred(void); -uint64_t ram_bytes_total(void); -uint64_t ram_dirty_sync_count(void); -uint64_t ram_dirty_pages_rate(void); -uint64_t ram_postcopy_requests(void); -void free_xbzrle_decoded_buf(void); - -void acct_update_position(QEMUFile *f, size_t size, bool zero); - -uint64_t dup_mig_pages_transferred(void); -uint64_t norm_mig_pages_transferred(void); -uint64_t xbzrle_mig_bytes_transferred(void); -uint64_t xbzrle_mig_pages_transferred(void); -uint64_t xbzrle_mig_pages_overflow(void); -uint64_t xbzrle_mig_pages_cache_miss(void); -double xbzrle_mig_cache_miss_rate(void); - -void ram_handle_compressed(void *host, uint8_t ch, uint64_t size); -void ram_debug_dump_bitmap(unsigned long *todump, bool expected); -/* For outgoing discard bitmap */ -int ram_postcopy_send_discard_bitmap(MigrationState *ms); -/* For incoming postcopy discard */ -int ram_discard_range(const char *block_name, uint64_t start, size_t lengt= h); -int ram_postcopy_incoming_init(MigrationIncomingState *mis); -void ram_postcopy_migrated_memory_release(MigrationState *ms); =20 bool migrate_release_ram(void); bool migrate_postcopy_ram(void); @@ -233,8 +203,6 @@ int migrate_use_xbzrle(void); int64_t migrate_xbzrle_cache_size(void); bool migrate_colo_enabled(void); =20 -int64_t xbzrle_cache_resize(int64_t new_size); - bool migrate_use_block_enabled(void); bool migrate_use_block_shared(void); =20 @@ -273,10 +241,6 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t b= lock_offset, ram_addr_t offset, size_t size, uint64_t *bytes_sent); =20 -void migration_page_queue_free(void); -int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); -uint64_t ram_pagesize_summary(void); - PostcopyState postcopy_state_get(void); /* Set the state and return the old state */ PostcopyState postcopy_state_set(PostcopyState new_state); diff --git a/include/migration/ram.h b/include/migration/ram.h new file mode 100644 index 0000000..c3653b3 --- /dev/null +++ b/include/migration/ram.h @@ -0,0 +1,54 @@ +/* + * QEMU migration ram + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_RAM_H +#define QEMU_MIGRATION_RAM_H + +#include "qemu-common.h" +#include "exec/cpu-common.h" + +int64_t xbzrle_cache_resize(int64_t new_size); +uint64_t dup_mig_pages_transferred(void); +uint64_t norm_mig_pages_transferred(void); +uint64_t xbzrle_mig_bytes_transferred(void); +uint64_t xbzrle_mig_pages_transferred(void); +uint64_t xbzrle_mig_pages_cache_miss(void); +double xbzrle_mig_cache_miss_rate(void); +uint64_t xbzrle_mig_pages_overflow(void); +uint64_t ram_bytes_transferred(void); +uint64_t ram_bytes_remaining(void); +uint64_t ram_dirty_sync_count(void); +uint64_t ram_dirty_pages_rate(void); +uint64_t ram_postcopy_requests(void); +uint64_t ram_bytes_total(void); + +void migrate_compress_threads_create(void); +void migrate_compress_threads_join(void); +void migrate_decompress_threads_create(void); +void migrate_decompress_threads_join(void); + +uint64_t ram_pagesize_summary(void); +void migration_page_queue_free(void); +int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); +void acct_update_position(QEMUFile *f, size_t size, bool zero); +void free_xbzrle_decoded_buf(void); +void ram_debug_dump_bitmap(unsigned long *todump, bool expected); +void ram_postcopy_migrated_memory_release(MigrationState *ms); +/* For outgoing discard bitmap */ +int ram_postcopy_send_discard_bitmap(MigrationState *ms); +/* For incoming postcopy discard */ +int ram_discard_range(const char *block_name, uint64_t start, size_t lengt= h); +int ram_postcopy_incoming_init(MigrationIncomingState *mis); + +void ram_handle_compressed(void *host, uint8_t ch, uint64_t size); +#endif diff --git a/migration/migration.c b/migration/migration.c index 6e32be0..ba01ea2 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -23,6 +23,7 @@ #include "migration/exec.h" #include "migration/fd.h" #include "migration/socket.h" +#include "migration/ram.h" #include "migration/migration.h" #include "migration/qemu-file-channel.h" #include "migration/vmstate.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 5aea2ff..aec40c3 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/ram.h" #include "migration/postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" diff --git a/migration/ram.c b/migration/ram.c index 49e518f..eb1ec1b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -36,6 +36,7 @@ #include "qemu/main-loop.h" #include "migration/xbzrle.h" #include "migration/init.h" +#include "migration/ram.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "migration/vmstate.h" diff --git a/migration/rdma.c b/migration/rdma.c index d9a2d64..3b06fe6 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -18,6 +18,7 @@ #include "qemu-common.h" #include "qemu/cutils.h" #include "migration/migration.h" +#include "migration/ram.h" #include "migration/qemu-file-channel.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" diff --git a/migration/savevm.c b/migration/savevm.c index 1e6cf79..f628d01 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "audio/audio.h" #include "migration/machine.h" #include "migration/migration.h" +#include "migration/ram.h" #include "migration/qemu-file-channel.h" #include "migration/postcopy-ram.h" #include "qapi/qmp/qerror.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492460076594796.9018855749258; Mon, 17 Apr 2017 13:14:36 -0700 (PDT) Received: from localhost ([::1]:38604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0D2h-0008RL-1T for importer@patchew.org; Mon, 17 Apr 2017 16:14:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpj-0006IW-Ix for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpi-0004Ye-MD for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33698) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpi-0004Xt-H6 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C49A8050D for ; Mon, 17 Apr 2017 20:01:09 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77CE9179F8; Mon, 17 Apr 2017 20:01:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C49A8050D Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6C49A8050D From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:39 +0200 Message-Id: <20170417200041.2451-18-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 17 Apr 2017 20:01:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 17/19] migration: Export rdma.c functions in its own file 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- include/migration/migration.h | 4 ---- include/migration/rdma.h | 22 ++++++++++++++++++++++ migration/migration.c | 1 + migration/rdma.c | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 include/migration/rdma.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 3e5d106..64c1ff3 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -177,10 +177,6 @@ void migration_fd_process_incoming(QEMUFile *f); =20 uint64_t migrate_max_downtime(void); =20 -void rdma_start_outgoing_migration(void *opaque, const char *host_port, Er= ror **errp); - -void rdma_start_incoming_migration(const char *host_port, Error **errp); - void migrate_fd_error(MigrationState *s, const Error *error); =20 void migrate_fd_connect(MigrationState *s); diff --git a/include/migration/rdma.h b/include/migration/rdma.h new file mode 100644 index 0000000..d2cf481 --- /dev/null +++ b/include/migration/rdma.h @@ -0,0 +1,22 @@ +/* + * QEMU migration rdma functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_RDMA_H +#define QEMU_MIGRATION_RDMA_H + +void rdma_start_outgoing_migration(void *opaque, const char *host_port, + Error **errp); + +void rdma_start_incoming_migration(const char *host_port, Error **errp); + +#endif diff --git a/migration/migration.c b/migration/migration.c index ba01ea2..04aa9ad 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -23,6 +23,7 @@ #include "migration/exec.h" #include "migration/fd.h" #include "migration/socket.h" +#include "migration/rdma.h" #include "migration/ram.h" #include "migration/migration.h" #include "migration/qemu-file-channel.h" diff --git a/migration/rdma.c b/migration/rdma.c index 3b06fe6..2b4276b 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -17,6 +17,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "qemu/cutils.h" +#include "migration/rdma.h" #include "migration/migration.h" #include "migration/ram.h" #include "migration/qemu-file-channel.h" --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459818458845.0127302270746; Mon, 17 Apr 2017 13:10:18 -0700 (PDT) Received: from localhost ([::1]:38578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0CyW-0004zv-Va for importer@patchew.org; Mon, 17 Apr 2017 16:10:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpl-0006JK-FK for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpk-0004bO-IV for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60866) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpk-0004aC-D7 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49B4964361 for ; Mon, 17 Apr 2017 20:01:11 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFA085DC19; Mon, 17 Apr 2017 20:01:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 49B4964361 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 49B4964361 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:40 +0200 Message-Id: <20170417200041.2451-19-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 20:01: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] [PATCH 18/19] monitor: move hmp_savevm() to monitor.c 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" hmp_loadvm is already there, so be consistent. Signed-off-by: Juan Quintela --- include/sysemu/sysemu.h | 1 - migration/savevm.c | 5 ----- monitor.c | 5 +++++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 5f2f21d..146a0dc 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -75,7 +75,6 @@ void qemu_remove_exit_notifier(Notifier *notify); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 -void hmp_savevm(Monitor *mon, const QDict *qdict); int save_vmstate(Monitor *mon, const char *name); int load_vmstate(const char *name); void hmp_delvm(Monitor *mon, const QDict *qdict); diff --git a/migration/savevm.c b/migration/savevm.c index f628d01..cbd7e0d 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2156,11 +2156,6 @@ int save_vmstate(Monitor *mon, const char *name) return ret; } =20 -void hmp_savevm(Monitor *mon, const QDict *qdict) -{ - save_vmstate(mon, qdict_get_try_str(qdict, "name")); -} - void qmp_xen_save_devices_state(const char *filename, Error **errp) { QEMUFile *f; diff --git a/monitor.c b/monitor.c index ceb0489..2fca4fb 100644 --- a/monitor.c +++ b/monitor.c @@ -1854,6 +1854,11 @@ static void hmp_loadvm(Monitor *mon, const QDict *qd= ict) } } =20 +static void hmp_savevm(Monitor *mon, const QDict *qdict) +{ + save_vmstate(mon, qdict_get_try_str(qdict, "name")); +} + int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp) { mon_fd_t *monfd; --=20 2.9.3 From nobody Thu May 2 14:42:47 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.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492459933907136.74787814825584; Mon, 17 Apr 2017 13:12:13 -0700 (PDT) Received: from localhost ([::1]:38589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0D0O-0006aN-Gi for importer@patchew.org; Mon, 17 Apr 2017 16:12:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Cpn-0006KZ-1j for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Cpm-0004cM-0B for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58076) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0Cpl-0004bc-Nx for qemu-devel@nongnu.org; Mon, 17 Apr 2017 16:01:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F77188E60 for ; Mon, 17 Apr 2017 20:01:12 +0000 (UTC) Received: from secure.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A49B179F8; Mon, 17 Apr 2017 20:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8F77188E60 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8F77188E60 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 22:00:41 +0200 Message-Id: <20170417200041.2451-20-quintela@redhat.com> In-Reply-To: <20170417200041.2451-1-quintela@redhat.com> References: <20170417200041.2451-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 17 Apr 2017 20:01: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] [PATCH 19/19] monitor: remove monitor parameter from save_vmstate 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" load_vmstate() already use error_report, so be consistent. Signed-off-by: Juan Quintela --- include/sysemu/sysemu.h | 2 +- migration/savevm.c | 16 ++++++++-------- monitor.c | 2 +- replay/replay-snapshot.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 146a0dc..d2582fa 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -75,7 +75,7 @@ void qemu_remove_exit_notifier(Notifier *notify); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 -int save_vmstate(Monitor *mon, const char *name); +int save_vmstate(const char *name); int load_vmstate(const char *name); void hmp_delvm(Monitor *mon, const QDict *qdict); void hmp_info_snapshots(Monitor *mon, const QDict *qdict); diff --git a/migration/savevm.c b/migration/savevm.c index cbd7e0d..36a6002 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2055,7 +2055,7 @@ int qemu_loadvm_state(QEMUFile *f) return ret; } =20 -int save_vmstate(Monitor *mon, const char *name) +int save_vmstate(const char *name) { BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn1, *sn =3D &sn1, old_sn1, *old_sn =3D &old_sn1; @@ -2069,8 +2069,8 @@ int save_vmstate(Monitor *mon, const char *name) AioContext *aio_context; =20 if (!bdrv_all_can_snapshot(&bs)) { - monitor_printf(mon, "Device '%s' is writable but does not " - "support snapshots.\n", bdrv_get_device_name(bs)); + error_report("Device '%s' is writable but does not support snapsho= ts.", + bdrv_get_device_name(bs)); return ret; } =20 @@ -2087,7 +2087,7 @@ int save_vmstate(Monitor *mon, const char *name) =20 bs =3D bdrv_all_find_vmstate_bs(); if (bs =3D=3D NULL) { - monitor_printf(mon, "No block device can accept snapshots\n"); + error_report("No block device can accept snapshots"); return ret; } aio_context =3D bdrv_get_aio_context(bs); @@ -2096,7 +2096,7 @@ int save_vmstate(Monitor *mon, const char *name) =20 ret =3D global_state_store(); if (ret) { - monitor_printf(mon, "Error saving global state\n"); + error_report("Error saving global state"); return ret; } vm_stop(RUN_STATE_SAVE_VM); @@ -2128,7 +2128,7 @@ int save_vmstate(Monitor *mon, const char *name) /* save the VM state */ f =3D qemu_fopen_bdrv(bs, 1); if (!f) { - monitor_printf(mon, "Could not open VM state file\n"); + error_report("Could not open VM state file"); goto the_end; } ret =3D qemu_savevm_state(f, &local_err); @@ -2141,8 +2141,8 @@ int save_vmstate(Monitor *mon, const char *name) =20 ret =3D bdrv_all_create_snapshot(sn, bs, vm_state_size, &bs); if (ret < 0) { - monitor_printf(mon, "Error while creating snapshot on '%s'\n", - bdrv_get_device_name(bs)); + error_report("Error while creating snapshot on '%s'", + bdrv_get_device_name(bs)); goto the_end; } =20 diff --git a/monitor.c b/monitor.c index 2fca4fb..9e79a97 100644 --- a/monitor.c +++ b/monitor.c @@ -1856,7 +1856,7 @@ static void hmp_loadvm(Monitor *mon, const QDict *qdi= ct) =20 static void hmp_savevm(Monitor *mon, const QDict *qdict) { - save_vmstate(mon, qdict_get_try_str(qdict, "name")); + save_vmstate(qdict_get_try_str(qdict, "name")); } =20 int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp) diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index 65e2d37..8cced46 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -64,7 +64,7 @@ void replay_vmstate_init(void) { if (replay_snapshot) { if (replay_mode =3D=3D REPLAY_MODE_RECORD) { - if (save_vmstate(cur_mon, replay_snapshot) !=3D 0) { + if (save_vmstate(replay_snapshot) !=3D 0) { error_report("Could not create snapshot for icount record"= ); exit(1); } --=20 2.9.3