From nobody Fri Apr 19 23:20:54 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 1496345114264537.980290662382; Thu, 1 Jun 2017 12:25:14 -0700 (PDT) Received: from localhost ([::1]:46344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVia-0005S6-NI for importer@patchew.org; Thu, 01 Jun 2017 15:25:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVh2-0004NO-60 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVh0-0004qR-JH for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh0-0004px-9z for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56393BB9C1 for ; Thu, 1 Jun 2017 19:23:33 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6D045C685; Thu, 1 Jun 2017 19:23:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 56393BB9C1 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 56393BB9C1 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:13 +0200 Message-Id: <20170601192327.29712-2-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Jun 2017 19:23:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/15] migration: Use savevm_handlers instead of loadvm copy X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" There is no reason for having the loadvm_handlers at all. There is only one use, and we can use the savevm handlers. We will remove the loadvm handlers on a following patch. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert -- - Added load_version_id: version_id read from the stream (laurent) - Added load_section_id: section_id read from the stream (dave) --- migration/savevm.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index a2d4f9c..07646f4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -272,7 +272,11 @@ typedef struct SaveStateEntry { int instance_id; int alias_id; int version_id; + /* version id read from the stream */ + int load_version_id; int section_id; + /* section id read from the stream */ + int load_section_id; SaveVMHandlers *ops; const VMStateDescription *vmsd; void *opaque; @@ -1813,7 +1817,7 @@ struct LoadStateEntry { * Returns: true if the footer was good * false if there is a problem (and calls error_report to say why) */ -static bool check_section_footer(QEMUFile *f, LoadStateEntry *le) +static bool check_section_footer(QEMUFile *f, SaveStateEntry *se) { uint8_t read_mark; uint32_t read_section_id; @@ -1826,15 +1830,15 @@ static bool check_section_footer(QEMUFile *f, LoadS= tateEntry *le) read_mark =3D qemu_get_byte(f); =20 if (read_mark !=3D QEMU_VM_SECTION_FOOTER) { - error_report("Missing section footer for %s", le->se->idstr); + error_report("Missing section footer for %s", se->idstr); return false; } =20 read_section_id =3D qemu_get_be32(f); - if (read_section_id !=3D le->section_id) { + if (read_section_id !=3D se->load_section_id) { error_report("Mismatched section id in footer for %s -" " read 0x%x expected 0x%x", - le->se->idstr, read_section_id, le->section_id); + se->idstr, read_section_id, se->load_section_id); return false; } =20 @@ -1887,6 +1891,8 @@ qemu_loadvm_section_start_full(QEMUFile *f, Migration= IncomingState *mis) version_id, idstr, se->version_id); return -EINVAL; } + se->load_version_id =3D version_id; + se->load_section_id =3D section_id; =20 /* Validate if it is a device's state */ if (xen_enabled() && se->is_ram) { @@ -1902,13 +1908,13 @@ qemu_loadvm_section_start_full(QEMUFile *f, Migrati= onIncomingState *mis) le->version_id =3D version_id; QLIST_INSERT_HEAD(&mis->loadvm_handlers, le, entry); =20 - ret =3D vmstate_load(f, le->se, le->version_id); + ret =3D vmstate_load(f, se, se->load_version_id); if (ret < 0) { error_report("error while loading state for instance 0x%x of" " device '%s'", instance_id, idstr); return ret; } - if (!check_section_footer(f, le)) { + if (!check_section_footer(f, se)) { return -EINVAL; } =20 @@ -1919,29 +1925,29 @@ static int qemu_loadvm_section_part_end(QEMUFile *f, MigrationIncomingState *mis) { uint32_t section_id; - LoadStateEntry *le; + SaveStateEntry *se; int ret; =20 section_id =3D qemu_get_be32(f); =20 trace_qemu_loadvm_state_section_partend(section_id); - QLIST_FOREACH(le, &mis->loadvm_handlers, entry) { - if (le->section_id =3D=3D section_id) { + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { + if (se->load_section_id =3D=3D section_id) { break; } } - if (le =3D=3D NULL) { + if (se =3D=3D NULL) { error_report("Unknown savevm section %d", section_id); return -EINVAL; } =20 - ret =3D vmstate_load(f, le->se, le->version_id); + ret =3D vmstate_load(f, se, se->load_version_id); if (ret < 0) { error_report("error while loading state section id %d(%s)", - section_id, le->se->idstr); + section_id, se->idstr); return ret; } - if (!check_section_footer(f, le)) { + if (!check_section_footer(f, se)) { return -EINVAL; } =20 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345119546813.5191891866202; Thu, 1 Jun 2017 12:25:19 -0700 (PDT) Received: from localhost ([::1]:46346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVig-0005W0-5T for importer@patchew.org; Thu, 01 Jun 2017 15:25:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVh3-0004NY-Hr for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVh2-0004rD-Fp for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34326) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh2-0004qk-7C for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BAA7C057FA6 for ; Thu, 1 Jun 2017 19:23:35 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8B4287942; Thu, 1 Jun 2017 19:23:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2BAA7C057FA6 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 2BAA7C057FA6 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:14 +0200 Message-Id: <20170601192327.29712-3-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 01 Jun 2017 19:23:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/15] migration: loadvm handlers are not used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" So we remove all traces of them. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 5 ----- include/migration/vmstate.h | 2 -- include/qemu/typedefs.h | 1 - migration/migration.c | 2 -- migration/savevm.c | 26 -------------------------- 5 files changed, 36 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 0e807b6..d1a353a 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -50,8 +50,6 @@ enum mig_rp_message_type { MIG_RP_MSG_MAX }; =20 -typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head; - /* State for the incoming migration */ struct MigrationIncomingState { QEMUFile *from_src_file; @@ -89,9 +87,6 @@ struct MigrationIncomingState { /* The coroutine we should enter (back) after failover */ Coroutine *migration_incoming_co; QemuSemaphore colo_incoming_sem; - - /* See savevm.c */ - LoadStateEntry_Head loadvm_handlers; }; =20 MigrationIncomingState *migration_incoming_get_current(void); diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f97411d..6689562 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1020,8 +1020,6 @@ extern const VMStateInfo vmstate_info_qtailq; =20 #define SELF_ANNOUNCE_ROUNDS 5 =20 -void loadvm_free_handlers(MigrationIncomingState *mis); - int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, void *opaque, int version_id); void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 33a6aa1..51958bf 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -39,7 +39,6 @@ typedef struct I2SCodec I2SCodec; typedef struct ISABus ISABus; typedef struct ISADevice ISADevice; typedef struct IsaDma IsaDma; -typedef struct LoadStateEntry LoadStateEntry; typedef struct MACAddr MACAddr; typedef struct MachineClass MachineClass; typedef struct MachineState MachineState; diff --git a/migration/migration.c b/migration/migration.c index 7087d1a..c3218cd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -122,7 +122,6 @@ MigrationIncomingState *migration_incoming_get_current(= void) if (!once) { mis_current.state =3D MIGRATION_STATUS_NONE; memset(&mis_current, 0, sizeof(MigrationIncomingState)); - QLIST_INIT(&mis_current.loadvm_handlers); qemu_mutex_init(&mis_current.rp_mutex); qemu_event_init(&mis_current.main_thread_load_event, false); once =3D true; @@ -135,7 +134,6 @@ void migration_incoming_state_destroy(void) struct MigrationIncomingState *mis =3D migration_incoming_get_current(= ); =20 qemu_event_destroy(&mis->main_thread_load_event); - loadvm_free_handlers(mis); } =20 =20 diff --git a/migration/savevm.c b/migration/savevm.c index 07646f4..d96209b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1804,13 +1804,6 @@ static int loadvm_process_command(QEMUFile *f) return 0; } =20 -struct LoadStateEntry { - QLIST_ENTRY(LoadStateEntry) entry; - SaveStateEntry *se; - int section_id; - int version_id; -}; - /* * Read a footer off the wire and check that it matches the expected secti= on * @@ -1846,22 +1839,11 @@ static bool check_section_footer(QEMUFile *f, SaveS= tateEntry *se) return true; } =20 -void loadvm_free_handlers(MigrationIncomingState *mis) -{ - LoadStateEntry *le, *new_le; - - QLIST_FOREACH_SAFE(le, &mis->loadvm_handlers, entry, new_le) { - QLIST_REMOVE(le, entry); - g_free(le); - } -} - static int qemu_loadvm_section_start_full(QEMUFile *f, MigrationIncomingState *mis) { uint32_t instance_id, version_id, section_id; SaveStateEntry *se; - LoadStateEntry *le; char idstr[256]; int ret; =20 @@ -1900,14 +1882,6 @@ qemu_loadvm_section_start_full(QEMUFile *f, Migratio= nIncomingState *mis) return -EINVAL; } =20 - /* Add entry */ - le =3D g_malloc0(sizeof(*le)); - - le->se =3D se; - le->section_id =3D section_id; - le->version_id =3D version_id; - QLIST_INSERT_HEAD(&mis->loadvm_handlers, le, entry); - ret =3D vmstate_load(f, se, se->load_version_id); if (ret < 0) { error_report("error while loading state for instance 0x%x of" --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345264068399.1093961451668; Thu, 1 Jun 2017 12:27:44 -0700 (PDT) Received: from localhost ([::1]:46359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVl0-0007kn-O5 for importer@patchew.org; Thu, 01 Jun 2017 15:27:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVh4-0004OK-Sa for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVh4-0004rp-3P for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34382) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh3-0004rT-To for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECCADC0587C1 for ; Thu, 1 Jun 2017 19:23:36 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E62C53CC2; Thu, 1 Jun 2017 19:23:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ECCADC0587C1 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 ECCADC0587C1 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:15 +0200 Message-Id: <20170601192327.29712-4-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 01 Jun 2017 19:23:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/15] migration: Remove section_id parameter from vmstate_load X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" Everything else assumes that we always load a device from its own savevm handler. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- migration/savevm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index d96209b..2d1d4bc 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -746,13 +746,13 @@ void vmstate_unregister(DeviceState *dev, const VMSta= teDescription *vmsd, } } =20 -static int vmstate_load(QEMUFile *f, SaveStateEntry *se, int version_id) +static int vmstate_load(QEMUFile *f, SaveStateEntry *se) { trace_vmstate_load(se->idstr, se->vmsd ? se->vmsd->name : "(old)"); if (!se->vmsd) { /* Old style */ - return se->ops->load_state(f, se->opaque, version_id); + return se->ops->load_state(f, se->opaque, se->load_version_id); } - return vmstate_load_state(f, se->vmsd, se->opaque, version_id); + return vmstate_load_state(f, se->vmsd, se->opaque, se->load_version_id= ); } =20 static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, QJSON = *vmdesc) @@ -1882,7 +1882,7 @@ qemu_loadvm_section_start_full(QEMUFile *f, Migration= IncomingState *mis) return -EINVAL; } =20 - ret =3D vmstate_load(f, se, se->load_version_id); + ret =3D vmstate_load(f, se); if (ret < 0) { error_report("error while loading state for instance 0x%x of" " device '%s'", instance_id, idstr); @@ -1915,7 +1915,7 @@ qemu_loadvm_section_part_end(QEMUFile *f, MigrationIn= comingState *mis) return -EINVAL; } =20 - ret =3D vmstate_load(f, se, se->load_version_id); + ret =3D vmstate_load(f, se); if (ret < 0) { error_report("error while loading state section id %d(%s)", section_id, se->idstr); --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345393938840.9562586759137; Thu, 1 Jun 2017 12:29:53 -0700 (PDT) Received: from localhost ([::1]:46370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVn6-0001De-GU for importer@patchew.org; Thu, 01 Jun 2017 15:29:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVh6-0004QB-Lg for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVh5-0004tL-S0 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39280) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh5-0004sr-MZ for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B641C804F5 for ; Thu, 1 Jun 2017 19:23:38 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C0BE53CDC; Thu, 1 Jun 2017 19:23:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B641C804F5 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 B641C804F5 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:16 +0200 Message-Id: <20170601192327.29712-5-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 01 Jun 2017 19:23:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/15] migration: fix leak of src file on dst X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" From: Peter Xu The return path channel is possibly leaked. Fix it. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index c3218cd..b90e399 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -133,6 +133,11 @@ void migration_incoming_state_destroy(void) { struct MigrationIncomingState *mis =3D migration_incoming_get_current(= ); =20 + if (mis->to_src_file) { + qemu_fclose(mis->to_src_file); + mis->to_src_file =3D NULL; + } + qemu_event_destroy(&mis->main_thread_load_event); } =20 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345264296795.2102166839354; Thu, 1 Jun 2017 12:27:44 -0700 (PDT) Received: from localhost ([::1]:46358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVkz-0007gv-St for importer@patchew.org; Thu, 01 Jun 2017 15:27:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVh8-0004Ry-RM for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVh7-0004u8-V1 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55176) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh7-0004tp-Ol for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B914837E72 for ; Thu, 1 Jun 2017 19:23:40 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1598787941; Thu, 1 Jun 2017 19:23:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B914837E72 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 B914837E72 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:17 +0200 Message-Id: <20170601192327.29712-6-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 01 Jun 2017 19:23:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/15] migration: shut src return path unconditionally X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" From: Peter Xu We were do the shutting off only for postcopy. Now we do this as long as the source return path is there. Moving the cleanup of from_src_file there too. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 8 +++++++- migration/postcopy-ram.c | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b90e399..5d9ccf1 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -134,10 +134,17 @@ void migration_incoming_state_destroy(void) struct MigrationIncomingState *mis =3D migration_incoming_get_current(= ); =20 if (mis->to_src_file) { + /* Tell source that we are done */ + migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) = !=3D 0); qemu_fclose(mis->to_src_file); mis->to_src_file =3D NULL; } =20 + if (mis->from_src_file) { + qemu_fclose(mis->from_src_file); + mis->from_src_file =3D NULL; + } + qemu_event_destroy(&mis->main_thread_load_event); } =20 @@ -435,7 +442,6 @@ static void process_incoming_migration_co(void *opaque) exit(EXIT_FAILURE); } =20 - qemu_fclose(f); free_xbzrle_decoded_buf(); =20 mis->bh =3D qemu_bh_new(process_incoming_migration_bh, mis); diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 3f9ae1b..5ceb623 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -333,7 +333,6 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingStat= e *mis) } =20 postcopy_state_set(POSTCOPY_INCOMING_END); - migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) !=3D= 0); =20 if (mis->postcopy_tmp_page) { munmap(mis->postcopy_tmp_page, mis->largest_page_size); --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345500158108.74317173960912; Thu, 1 Jun 2017 12:31:40 -0700 (PDT) Received: from localhost ([::1]:46380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVoo-0002uo-7Q for importer@patchew.org; Thu, 01 Jun 2017 15:31:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhC-0004W2-4z for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhA-0004v6-5u for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36110) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVh9-0004uV-St for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DC597F3F8 for ; Thu, 1 Jun 2017 19:23:42 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 179E853CC2; Thu, 1 Jun 2017 19:23:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9DC597F3F8 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 9DC597F3F8 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:18 +0200 Message-Id: <20170601192327.29712-7-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 01 Jun 2017 19:23:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/15] migration: Remove unneeded includes of migration/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: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- hw/core/qdev.c | 1 - include/hw/acpi/memory_hotplug.h | 1 - include/hw/acpi/pcihp.h | 1 - include/hw/pci/shpc.h | 1 - target/alpha/cpu.c | 1 - target/hppa/cpu.c | 1 - target/s390x/cpu.c | 1 - target/tilegx/cpu.c | 1 - 8 files changed, 8 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 71ff95f..0ce45a2 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -37,7 +37,6 @@ #include "hw/boards.h" #include "hw/sysbus.h" #include "qapi-event.h" -#include "migration/vmstate.h" =20 bool qdev_hotplug =3D false; static bool qdev_hot_added =3D false; diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotp= lug.h index db8ebc9..77c6576 100644 --- a/include/hw/acpi/memory_hotplug.h +++ b/include/hw/acpi/memory_hotplug.h @@ -3,7 +3,6 @@ =20 #include "hw/qdev-core.h" #include "hw/acpi/acpi.h" -#include "migration/vmstate.h" #include "hw/acpi/aml-build.h" =20 /** diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index 04528b7..8a65f99 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -28,7 +28,6 @@ #define HW_ACPI_PCIHP_H =20 #include "hw/acpi/acpi.h" -#include "migration/vmstate.h" #include "hw/hotplug.h" =20 #define ACPI_PCIHP_IO_BASE_PROP "acpi-pcihp-io-base" diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h index b208554..71e836b 100644 --- a/include/hw/pci/shpc.h +++ b/include/hw/pci/shpc.h @@ -3,7 +3,6 @@ =20 #include "qemu-common.h" #include "exec/memory.h" -#include "migration/vmstate.h" #include "hw/hotplug.h" #include "hw/pci/pci.h" =20 diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index b4f9798..8186c9d 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -23,7 +23,6 @@ #include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" -#include "migration/vmstate.h" #include "exec/exec-all.h" =20 =20 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1d791d0..30299e9 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -22,7 +22,6 @@ #include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" -#include "migration/vmstate.h" #include "exec/exec-all.h" =20 =20 diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index a69005d..accef03 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -32,7 +32,6 @@ #include "qemu/error-report.h" #include "trace.h" #include "qapi/visitor.h" -#include "migration/vmstate.h" #include "exec/exec-all.h" #ifndef CONFIG_USER_ONLY #include "hw/hw.h" diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index d90e38e..4532639 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -23,7 +23,6 @@ #include "cpu.h" #include "qemu-common.h" #include "hw/qdev-properties.h" -#include "migration/vmstate.h" #include "linux-user/syscall_defs.h" #include "exec/exec-all.h" =20 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345136473298.63580980180143; Thu, 1 Jun 2017 12:25:36 -0700 (PDT) Received: from localhost ([::1]:46352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGViv-0005kj-QZ for importer@patchew.org; Thu, 01 Jun 2017 15:25:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhE-0004Xw-BM for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhB-0004wR-S4 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34738) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhB-0004vk-Je for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B82CC0587C9 for ; Thu, 1 Jun 2017 19:23:44 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDED68794F; Thu, 1 Jun 2017 19:23:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B82CC0587C9 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 9B82CC0587C9 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:19 +0200 Message-Id: <20170601192327.29712-8-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 01 Jun 2017 19:23:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/15] migration: Split qemu-file.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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" Split the file into public and internal interfaces. I have to rename the external one because we can't have two include files with the same name in the same directory. Build system gets confused. The only exported functions are the ones that handle basic types. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- hw/i2c/i2c-ddc.c | 1 + hw/intc/s390_flic.c | 1 - hw/intc/s390_flic_kvm.c | 1 - hw/s390x/s390-skeys.c | 1 - include/hw/hw.h | 2 +- include/migration/qemu-file-types.h | 164 +++++++++++++++++++++++= ++++ migration/block.c | 2 +- migration/colo.c | 2 +- migration/migration.c | 2 +- migration/postcopy-ram.c | 2 +- migration/qemu-file-channel.c | 3 +- migration/qemu-file.c | 2 +- {include/migration =3D> migration}/qemu-file.h | 157 +--------------------= ---- migration/ram.c | 2 +- migration/rdma.c | 2 +- migration/savevm.c | 1 + migration/socket.c | 2 +- migration/vmstate-types.c | 3 +- migration/vmstate.c | 2 +- tests/test-vmstate.c | 3 +- 20 files changed, 186 insertions(+), 169 deletions(-) create mode 100644 include/migration/qemu-file-types.h rename {include/migration =3D> migration}/qemu-file.h (62%) diff --git a/hw/i2c/i2c-ddc.c b/hw/i2c/i2c-ddc.c index 66899d7..6b92e95 100644 --- a/hw/i2c/i2c-ddc.c +++ b/hw/i2c/i2c-ddc.c @@ -17,6 +17,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu-common.h" #include "qemu/log.h" #include "hw/i2c/i2c.h" #include "hw/i2c/i2c-ddc.h" diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 711c114..a26e906 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "hw/sysbus.h" -#include "migration/qemu-file.h" #include "hw/s390x/s390_flic.h" #include "trace.h" #include "hw/qdev.h" diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index cc44bc4..b4c61d8 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -17,7 +17,6 @@ #include "qemu/error-report.h" #include "hw/sysbus.h" #include "sysemu/kvm.h" -#include "migration/qemu-file.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/adapter.h" #include "trace.h" diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index e2d4e1a..619152c 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "hw/boards.h" #include "qmp-commands.h" -#include "migration/qemu-file.h" #include "hw/s390x/storage-keys.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" diff --git a/include/hw/hw.h b/include/hw/hw.h index af9eae1..ab4950c 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -11,7 +11,7 @@ #include "exec/memory.h" #include "hw/irq.h" #include "migration/vmstate.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-types.h" #include "qemu/module.h" #include "sysemu/reset.h" =20 diff --git a/include/migration/qemu-file-types.h b/include/migration/qemu-f= ile-types.h new file mode 100644 index 0000000..bd6d7dd --- /dev/null +++ b/include/migration/qemu-file-types.h @@ -0,0 +1,164 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#ifndef QEMU_FILE_H +#define QEMU_FILE_H + +void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, size_t size); +void qemu_put_byte(QEMUFile *f, int v); + +#define qemu_put_sbyte qemu_put_byte + +void qemu_put_be16(QEMUFile *f, unsigned int v); +void qemu_put_be32(QEMUFile *f, unsigned int v); +void qemu_put_be64(QEMUFile *f, uint64_t v); +size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); + +int qemu_get_byte(QEMUFile *f); + +static inline unsigned int qemu_get_ubyte(QEMUFile *f) +{ + return (unsigned int)qemu_get_byte(f); +} + +#define qemu_get_sbyte qemu_get_byte + +unsigned int qemu_get_be16(QEMUFile *f); +unsigned int qemu_get_be32(QEMUFile *f); +uint64_t qemu_get_be64(QEMUFile *f); + +static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv) +{ + qemu_put_be64(f, *pv); +} + +static inline void qemu_put_be32s(QEMUFile *f, const uint32_t *pv) +{ + qemu_put_be32(f, *pv); +} + +static inline void qemu_put_be16s(QEMUFile *f, const uint16_t *pv) +{ + qemu_put_be16(f, *pv); +} + +static inline void qemu_put_8s(QEMUFile *f, const uint8_t *pv) +{ + qemu_put_byte(f, *pv); +} + +static inline void qemu_get_be64s(QEMUFile *f, uint64_t *pv) +{ + *pv =3D qemu_get_be64(f); +} + +static inline void qemu_get_be32s(QEMUFile *f, uint32_t *pv) +{ + *pv =3D qemu_get_be32(f); +} + +static inline void qemu_get_be16s(QEMUFile *f, uint16_t *pv) +{ + *pv =3D qemu_get_be16(f); +} + +static inline void qemu_get_8s(QEMUFile *f, uint8_t *pv) +{ + *pv =3D qemu_get_byte(f); +} + +/* Signed versions for type safety */ +static inline void qemu_put_sbe16(QEMUFile *f, int v) +{ + qemu_put_be16(f, (unsigned int)v); +} + +static inline void qemu_put_sbe32(QEMUFile *f, int v) +{ + qemu_put_be32(f, (unsigned int)v); +} + +static inline void qemu_put_sbe64(QEMUFile *f, int64_t v) +{ + qemu_put_be64(f, (uint64_t)v); +} + +static inline int qemu_get_sbe16(QEMUFile *f) +{ + return (int)qemu_get_be16(f); +} + +static inline int qemu_get_sbe32(QEMUFile *f) +{ + return (int)qemu_get_be32(f); +} + +static inline int64_t qemu_get_sbe64(QEMUFile *f) +{ + return (int64_t)qemu_get_be64(f); +} + +static inline void qemu_put_s8s(QEMUFile *f, const int8_t *pv) +{ + qemu_put_8s(f, (const uint8_t *)pv); +} + +static inline void qemu_put_sbe16s(QEMUFile *f, const int16_t *pv) +{ + qemu_put_be16s(f, (const uint16_t *)pv); +} + +static inline void qemu_put_sbe32s(QEMUFile *f, const int32_t *pv) +{ + qemu_put_be32s(f, (const uint32_t *)pv); +} + +static inline void qemu_put_sbe64s(QEMUFile *f, const int64_t *pv) +{ + qemu_put_be64s(f, (const uint64_t *)pv); +} + +static inline void qemu_get_s8s(QEMUFile *f, int8_t *pv) +{ + qemu_get_8s(f, (uint8_t *)pv); +} + +static inline void qemu_get_sbe16s(QEMUFile *f, int16_t *pv) +{ + qemu_get_be16s(f, (uint16_t *)pv); +} + +static inline void qemu_get_sbe32s(QEMUFile *f, int32_t *pv) +{ + qemu_get_be32s(f, (uint32_t *)pv); +} + +static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv) +{ + qemu_get_be64s(f, (uint64_t *)pv); +} + +int qemu_file_rate_limit(QEMUFile *f); + +#endif diff --git a/migration/block.c b/migration/block.c index 13f90d3..3e27499 100644 --- a/migration/block.c +++ b/migration/block.c @@ -26,7 +26,7 @@ #include "migration/block.h" #include "migration/migration.h" #include "sysemu/blockdev.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "migration/vmstate.h" #include "sysemu/block-backend.h" =20 diff --git a/migration/colo.c b/migration/colo.c index 3dd1390..4f1f3b8 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -15,7 +15,7 @@ #include "sysemu/sysemu.h" #include "qemu-file-channel.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "savevm.h" #include "migration/colo.h" #include "migration/block.h" diff --git a/migration/migration.c b/migration/migration.c index 5d9ccf1..97bbb9f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -21,7 +21,7 @@ #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "migration/vmstate.h" #include "sysemu/sysemu.h" #include "block/block.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 5ceb623..71f4389 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -21,7 +21,7 @@ #include "qemu-common.h" #include "exec/target_page.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "savevm.h" #include "postcopy-ram.h" #include "sysemu/sysemu.h" diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c index dc991c9..e202d73 100644 --- a/migration/qemu-file-channel.c +++ b/migration/qemu-file-channel.c @@ -24,7 +24,8 @@ =20 #include "qemu/osdep.h" #include "qemu-file-channel.h" -#include "migration/qemu-file.h" +#include "exec/cpu-common.h" +#include "qemu-file.h" #include "io/channel-socket.h" #include "qemu/iov.h" =20 diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 195fa94..ab26f4e 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -29,7 +29,7 @@ #include "qemu/sockets.h" #include "qemu/coroutine.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "trace.h" =20 #define IO_BUF_SIZE 32768 diff --git a/include/migration/qemu-file.h b/migration/qemu-file.h similarity index 62% rename from include/migration/qemu-file.h rename to migration/qemu-file.h index b5ac800..49fd697 100644 --- a/include/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -22,11 +22,8 @@ * THE SOFTWARE. */ =20 -#ifndef QEMU_FILE_H -#define QEMU_FILE_H - -#include "qemu-common.h" -#include "exec/cpu-common.h" +#ifndef MIGRATION_QEMU_FILE_H +#define MIGRATION_QEMU_FILE_H =20 /* Read a chunk of data from a file at the given position. The pos argume= nt * can be ignored if the file is only be used for streaming. The number of @@ -122,8 +119,6 @@ int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); int64_t qemu_ftell(QEMUFile *f); int64_t qemu_ftell_fast(QEMUFile *f); -void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, size_t size); -void qemu_put_byte(QEMUFile *f, int v); /* * put_buffer without copying the buffer. * The buffer should be available till it is sent asynchronously. @@ -133,19 +128,9 @@ void qemu_put_buffer_async(QEMUFile *f, const uint8_t = *buf, size_t size, bool qemu_file_mode_is_not_valid(const char *mode); bool qemu_file_is_writable(QEMUFile *f); =20 +#include "migration/qemu-file-types.h" =20 -static inline void qemu_put_ubyte(QEMUFile *f, unsigned int v) -{ - qemu_put_byte(f, (int)v); -} - -#define qemu_put_sbyte qemu_put_byte - -void qemu_put_be16(QEMUFile *f, unsigned int v); -void qemu_put_be32(QEMUFile *f, unsigned int v); -void qemu_put_be64(QEMUFile *f, uint64_t v); size_t qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t of= fset); -size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); size_t qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size); ssize_t qemu_put_compression_data(QEMUFile *f, const uint8_t *p, size_t si= ze, int level); @@ -157,22 +142,8 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_sr= c); * previously peeked +n-1. */ int qemu_peek_byte(QEMUFile *f, int offset); -int qemu_get_byte(QEMUFile *f); void qemu_file_skip(QEMUFile *f, int size); void qemu_update_position(QEMUFile *f, size_t size); - -static inline unsigned int qemu_get_ubyte(QEMUFile *f) -{ - return (unsigned int)qemu_get_byte(f); -} - -#define qemu_get_sbyte qemu_get_byte - -unsigned int qemu_get_be16(QEMUFile *f); -unsigned int qemu_get_be32(QEMUFile *f); -uint64_t qemu_get_be64(QEMUFile *f); - -int qemu_file_rate_limit(QEMUFile *f); void qemu_file_reset_rate_limit(QEMUFile *f); void qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate); int64_t qemu_file_get_rate_limit(QEMUFile *f); @@ -183,127 +154,7 @@ QEMUFile *qemu_file_get_return_path(QEMUFile *f); void qemu_fflush(QEMUFile *f); void qemu_file_set_blocking(QEMUFile *f, bool block); =20 -static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv) -{ - qemu_put_be64(f, *pv); -} - -static inline void qemu_put_be32s(QEMUFile *f, const uint32_t *pv) -{ - qemu_put_be32(f, *pv); -} - -static inline void qemu_put_be16s(QEMUFile *f, const uint16_t *pv) -{ - qemu_put_be16(f, *pv); -} - -static inline void qemu_put_8s(QEMUFile *f, const uint8_t *pv) -{ - qemu_put_byte(f, *pv); -} - -static inline void qemu_get_be64s(QEMUFile *f, uint64_t *pv) -{ - *pv =3D qemu_get_be64(f); -} - -static inline void qemu_get_be32s(QEMUFile *f, uint32_t *pv) -{ - *pv =3D qemu_get_be32(f); -} - -static inline void qemu_get_be16s(QEMUFile *f, uint16_t *pv) -{ - *pv =3D qemu_get_be16(f); -} - -static inline void qemu_get_8s(QEMUFile *f, uint8_t *pv) -{ - *pv =3D qemu_get_byte(f); -} - -// Signed versions for type safety -static inline void qemu_put_sbuffer(QEMUFile *f, const int8_t *buf, size_t= size) -{ - qemu_put_buffer(f, (const uint8_t *)buf, size); -} - -static inline void qemu_put_sbe16(QEMUFile *f, int v) -{ - qemu_put_be16(f, (unsigned int)v); -} - -static inline void qemu_put_sbe32(QEMUFile *f, int v) -{ - qemu_put_be32(f, (unsigned int)v); -} - -static inline void qemu_put_sbe64(QEMUFile *f, int64_t v) -{ - qemu_put_be64(f, (uint64_t)v); -} - -static inline size_t qemu_get_sbuffer(QEMUFile *f, int8_t *buf, int size) -{ - return qemu_get_buffer(f, (uint8_t *)buf, size); -} - -static inline int qemu_get_sbe16(QEMUFile *f) -{ - return (int)qemu_get_be16(f); -} - -static inline int qemu_get_sbe32(QEMUFile *f) -{ - return (int)qemu_get_be32(f); -} - -static inline int64_t qemu_get_sbe64(QEMUFile *f) -{ - return (int64_t)qemu_get_be64(f); -} - -static inline void qemu_put_s8s(QEMUFile *f, const int8_t *pv) -{ - qemu_put_8s(f, (const uint8_t *)pv); -} - -static inline void qemu_put_sbe16s(QEMUFile *f, const int16_t *pv) -{ - qemu_put_be16s(f, (const uint16_t *)pv); -} - -static inline void qemu_put_sbe32s(QEMUFile *f, const int32_t *pv) -{ - qemu_put_be32s(f, (const uint32_t *)pv); -} - -static inline void qemu_put_sbe64s(QEMUFile *f, const int64_t *pv) -{ - qemu_put_be64s(f, (const uint64_t *)pv); -} - -static inline void qemu_get_s8s(QEMUFile *f, int8_t *pv) -{ - qemu_get_8s(f, (uint8_t *)pv); -} - -static inline void qemu_get_sbe16s(QEMUFile *f, int16_t *pv) -{ - qemu_get_be16s(f, (uint16_t *)pv); -} - -static inline void qemu_get_sbe32s(QEMUFile *f, int32_t *pv) -{ - qemu_get_be32s(f, (uint32_t *)pv); -} - -static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv) -{ - qemu_get_be64s(f, (uint64_t *)pv); -} - size_t qemu_get_counted_string(QEMUFile *f, char buf[256]); =20 + #endif diff --git a/migration/ram.c b/migration/ram.c index 26e03a5..390f714 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -37,7 +37,7 @@ #include "qemu/main-loop.h" #include "xbzrle.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "migration/vmstate.h" #include "postcopy-ram.h" #include "exec/address-spaces.h" diff --git a/migration/rdma.c b/migration/rdma.c index 166cd60..4cb5bf8 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 "qemu-file.h" #include "exec/cpu-common.h" #include "qemu-file-channel.h" #include "qemu/error-report.h" diff --git a/migration/savevm.c b/migration/savevm.c index 2d1d4bc..bb3f9ec 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "qemu/timer.h" #include "migration/migration.h" #include "qemu-file-channel.h" +#include "qemu-file.h" #include "savevm.h" #include "postcopy-ram.h" #include "qapi/qmp/qerror.h" diff --git a/migration/socket.c b/migration/socket.c index 53f9d61..3f8ffc9 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -21,7 +21,7 @@ #include "qapi/error.h" #include "channel.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "io/channel-socket.h" #include "trace.h" =20 diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c index cc95e47..7287c6b 100644 --- a/migration/vmstate-types.c +++ b/migration/vmstate-types.c @@ -12,8 +12,9 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "exec/cpu-common.h" +#include "qemu-file.h" #include "migration/migration.h" -#include "migration/qemu-file.h" #include "migration/vmstate.h" #include "qemu/error-report.h" #include "qemu/queue.h" diff --git a/migration/vmstate.c b/migration/vmstate.c index ff54531..51a19b6 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -13,8 +13,8 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "migration/migration.h" -#include "migration/qemu-file.h" #include "migration/vmstate.h" +#include "qemu-file.h" #include "qemu/bitops.h" #include "qemu/error-report.h" #include "trace.h" diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 25389bc..c52aff9 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -27,7 +27,8 @@ #include "qemu-common.h" #include "migration/migration.h" #include "migration/vmstate.h" -#include "migration/qemu-file.h" +#include "migration/qemu-file-types.h" +#include "../migration/qemu-file.h" #include "../migration/qemu-file-channel.h" #include "qemu/coroutine.h" #include "io/channel-file.h" --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345583280610.9172860768584; Thu, 1 Jun 2017 12:33:03 -0700 (PDT) Received: from localhost ([::1]:46384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVq8-0003y4-MQ for importer@patchew.org; Thu, 01 Jun 2017 15:33:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhF-0004Yl-8C for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhE-0004y0-2b for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhD-0004xW-Po for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBDCDC0467DC for ; Thu, 1 Jun 2017 19:23:46 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDD5A53CC2; Thu, 1 Jun 2017 19:23:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBDCDC0467DC 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 CBDCDC0467DC From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:20 +0200 Message-Id: <20170601192327.29712-9-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Jun 2017 19:23:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 | 4 ---- migration/exec.c | 1 + migration/exec.h | 26 ++++++++++++++++++++++++++ migration/migration.c | 1 + 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 migration/exec.h diff --git a/include/migration/migration.h b/include/migration/migration.h index d1a353a..d04f045 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -163,10 +163,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 57a9335..9077024 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -21,6 +21,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "channel.h" +#include "exec.h" #include "migration/migration.h" #include "io/channel-command.h" #include "trace.h" diff --git a/migration/exec.h b/migration/exec.h new file mode 100644 index 0000000..b210ffd --- /dev/null +++ b/migration/exec.h @@ -0,0 +1,26 @@ +/* + * QEMU live migration + * + * Copyright IBM, Corp. 2008 + * Copyright Dell MessageOne 2008 + * Copyright Red Hat, Inc. 2015-2016 + * + * Authors: + * Anthony Liguori + * Charles Duffy + * Daniel P. Berrange + * + * 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. + */ + +#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/migration/migration.c b/migration/migration.c index 97bbb9f..c400388 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -18,6 +18,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "migration/blocker.h" +#include "exec.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 14963452831381022.8917846832022; Thu, 1 Jun 2017 12:28:03 -0700 (PDT) Received: from localhost ([::1]:46360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVlJ-000817-KP for importer@patchew.org; Thu, 01 Jun 2017 15:28:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhL-0004eO-Kc for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhI-00052m-BW for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhI-00052K-38 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D0D1C04B935 for ; Thu, 1 Jun 2017 19:23:51 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29D2787957; Thu, 1 Jun 2017 19:23:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1D0D1C04B935 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 1D0D1C04B935 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:21 +0200 Message-Id: <20170601192327.29712-10-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Jun 2017 19:23:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 | 4 ---- migration/fd.c | 1 + migration/fd.h | 23 +++++++++++++++++++++++ migration/migration.c | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 migration/fd.h diff --git a/include/migration/migration.h b/include/migration/migration.h index d04f045..d249c13 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -171,10 +171,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 05e0a5c..0077a50 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -18,6 +18,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "channel.h" +#include "fd.h" #include "migration/migration.h" #include "monitor/monitor.h" #include "io/channel-util.h" diff --git a/migration/fd.h b/migration/fd.h new file mode 100644 index 0000000..a14a63c --- /dev/null +++ b/migration/fd.h @@ -0,0 +1,23 @@ +/* + * QEMU live migration via generic fd + * + * Copyright Red Hat, Inc. 2009-2016 + * + * Authors: + * Chris Lalancette + * Daniel P. Berrange + * + * 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. + */ + +#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/migration/migration.c b/migration/migration.c index c400388..ec93f7a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -19,6 +19,7 @@ #include "qemu/main-loop.h" #include "migration/blocker.h" #include "exec.h" +#include "fd.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345263052393.8045716705403; Thu, 1 Jun 2017 12:27:43 -0700 (PDT) Received: from localhost ([::1]:46357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVky-0007db-DA for importer@patchew.org; Thu, 01 Jun 2017 15:27:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhL-0004eM-Jy for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhK-00053T-7R for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhJ-00053C-Uf for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 003CFC0587CA for ; Thu, 1 Jun 2017 19:23:53 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 700A88794F; Thu, 1 Jun 2017 19:23:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 003CFC0587CA 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 003CFC0587CA From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:22 +0200 Message-Id: <20170601192327.29712-11-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 01 Jun 2017 19:23: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] [PULL 10/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 | 8 -------- migration/migration.c | 1 + migration/socket.c | 1 + migration/socket.h | 28 ++++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 migration/socket.h diff --git a/include/migration/migration.h b/include/migration/migration.h index d249c13..9d311ed 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -163,14 +163,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/migration/migration.c b/migration/migration.c index ec93f7a..e6e36fa 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -20,6 +20,7 @@ #include "migration/blocker.h" #include "exec.h" #include "fd.h" +#include "socket.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" diff --git a/migration/socket.c b/migration/socket.c index 3f8ffc9..85bfdcc 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -20,6 +20,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "channel.h" +#include "socket.h" #include "migration/migration.h" #include "qemu-file.h" #include "io/channel-socket.h" diff --git a/migration/socket.h b/migration/socket.h new file mode 100644 index 0000000..6b91e9d --- /dev/null +++ b/migration/socket.h @@ -0,0 +1,28 @@ +/* + * QEMU live migration via socket + * + * Copyright Red Hat, Inc. 2009-2016 + * + * Authors: + * Chris Lalancette + * Daniel P. Berrange + * + * 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. + */ + +#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 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345393436599.9162077544482; Thu, 1 Jun 2017 12:29:53 -0700 (PDT) Received: from localhost ([::1]:46369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVn6-0001D4-2E for importer@patchew.org; Thu, 01 Jun 2017 15:29:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhN-0004g6-IB for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhM-00054w-B8 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37444) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhM-00054J-1w for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12AC13D959 for ; Thu, 1 Jun 2017 19:23:55 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 520448794F; Thu, 1 Jun 2017 19:23:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 12AC13D959 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 12AC13D959 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:23 +0200 Message-Id: <20170601192327.29712-12-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 01 Jun 2017 19:23:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 10 ---------- migration/channel.c | 1 + migration/migration.c | 1 - migration/tls.c | 1 + migration/tls.h | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 migration/tls.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 9d311ed..29fda5b 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -18,7 +18,6 @@ #include "qemu-common.h" #include "qemu/thread.h" #include "qemu/notify.h" -#include "io/channel.h" #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" @@ -152,15 +151,6 @@ void migration_fd_process_incoming(QEMUFile *f); =20 void qemu_start_incoming_migration(const char *uri, Error **errp); =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/migration/channel.c b/migration/channel.c index 2e78905cc..eae1d9e 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "channel.h" +#include "tls.h" #include "migration/migration.h" #include "qemu-file-channel.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index e6e36fa..fe6dc18 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -43,7 +43,6 @@ #include "exec/address-spaces.h" #include "exec/target_page.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 34ad121..bae9aca 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "channel.h" #include "migration/migration.h" +#include "tls.h" #include "io/channel-tls.h" #include "crypto/tlscreds.h" #include "qemu/error-report.h" diff --git a/migration/tls.h b/migration/tls.h new file mode 100644 index 0000000..cdd7000 --- /dev/null +++ b/migration/tls.h @@ -0,0 +1,34 @@ +/* + * QEMU migration TLS support + * + * Copyright (c) 2015 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + * + */ + +#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 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345674212644.8970027373301; Thu, 1 Jun 2017 12:34:34 -0700 (PDT) Received: from localhost ([::1]:46388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVrc-0004pl-5u for importer@patchew.org; Thu, 01 Jun 2017 15:34:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhP-0004i8-Jb for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhO-00056n-IK for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40640) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhO-00055o-Bm for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:23:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 613F47FD44 for ; Thu, 1 Jun 2017 19:23:57 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 658AB87951; Thu, 1 Jun 2017 19:23:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 613F47FD44 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 613F47FD44 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:24 +0200 Message-Id: <20170601192327.29712-13-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 01 Jun 2017 19:23: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] [PULL 12/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 | 4 ---- migration/migration.c | 1 + migration/rdma.c | 1 + migration/rdma.h | 25 +++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 migration/rdma.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 29fda5b..8d29bc9 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -153,10 +153,6 @@ void qemu_start_incoming_migration(const char *uri, Er= ror **errp); =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/migration/migration.c b/migration/migration.c index fe6dc18..ec79aff 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -21,6 +21,7 @@ #include "exec.h" #include "fd.h" #include "socket.h" +#include "rdma.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" diff --git a/migration/rdma.c b/migration/rdma.c index 4cb5bf8..fab30ea 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 "rdma.h" #include "migration/migration.h" #include "qemu-file.h" #include "exec/cpu-common.h" diff --git a/migration/rdma.h b/migration/rdma.h new file mode 100644 index 0000000..de2ba09 --- /dev/null +++ b/migration/rdma.h @@ -0,0 +1,25 @@ +/* + * RDMA protocol and interfaces + * + * Copyright IBM, Corp. 2010-2013 + * Copyright Red Hat, Inc. 2015-2016 + * + * Authors: + * Michael R. Hines + * Jiuxing Liu + * Daniel P. Berrange + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * later. 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 --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345410692643.3695440047063; Thu, 1 Jun 2017 12:30:10 -0700 (PDT) Received: from localhost ([::1]:46372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVnN-0001S6-9U for importer@patchew.org; Thu, 01 Jun 2017 15:30:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhR-0004kN-TS for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhQ-000590-IE for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40478) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhQ-00058K-AG for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5774A142A66 for ; Thu, 1 Jun 2017 19:23:59 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id B157F87951; Thu, 1 Jun 2017 19:23:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5774A142A66 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 5774A142A66 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:25 +0200 Message-Id: <20170601192327.29712-14-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 01 Jun 2017 19:23: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] [PULL 13/15] migration: Create include for migration snapshots X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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" Start removing migration code from sysemu/sysemu.h. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 5 +++-- include/block/block_int.h | 4 ++-- include/migration/snapshot.h | 21 +++++++++++++++++++++ include/sysemu/sysemu.h | 3 --- migration/savevm.c | 5 +++-- replay/replay-snapshot.c | 5 +++-- vl.c | 3 ++- 7 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 include/migration/snapshot.h diff --git a/hmp.c b/hmp.c index 20f5dab..ad72390 100644 --- a/hmp.c +++ b/hmp.c @@ -42,6 +42,7 @@ #include "qemu/error-report.h" #include "exec/ramlist.h" #include "hw/intc/intc.h" +#include "migration/snapshot.h" =20 #ifdef CONFIG_SPICE #include @@ -1284,7 +1285,7 @@ void hmp_loadvm(Monitor *mon, const QDict *qdict) =20 vm_stop(RUN_STATE_RESTORE_VM); =20 - if (load_vmstate(name, &err) =3D=3D 0 && saved_vm_running) { + if (load_snapshot(name, &err) =3D=3D 0 && saved_vm_running) { vm_start(); } hmp_handle_error(mon, &err); @@ -1294,7 +1295,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict) { Error *err =3D NULL; =20 - save_vmstate(qdict_get_try_str(qdict, "name"), &err); + save_snapshot(qdict_get_try_str(qdict, "name"), &err); hmp_handle_error(mon, &err); } =20 diff --git a/include/block/block_int.h b/include/block/block_int.h index e5eb473..cb78c4f 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -601,8 +601,8 @@ struct BlockDriverState { int copy_on_read; =20 /* If we are reading a disk image, give its size in sectors. - * Generally read-only; it is written to by load_vmstate and save_vmst= ate, - * but the block layer is quiescent during those. + * Generally read-only; it is written to by load_snapshot and + * save_snaphost, but the block layer is quiescent during those. */ int64_t total_sectors; =20 diff --git a/include/migration/snapshot.h b/include/migration/snapshot.h new file mode 100644 index 0000000..c85b6ec --- /dev/null +++ b/include/migration/snapshot.h @@ -0,0 +1,21 @@ +/* + * QEMU snapshots + * + * Copyright (c) 2004-2008 Fabrice Bellard + * Copyright (c) 2009-2015 Red Hat Inc + * + * Authors: + * Juan Quintela + * + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_MIGRATION_SNAPSHOT_H +#define QEMU_MIGRATION_SNAPSHOT_H + +int save_snapshot(const char *name, Error **errp); +int load_snapshot(const char *name, Error **errp); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 723c8dc..9841a52 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -92,9 +92,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 -int save_vmstate(const char *name, Error **errp); -int load_vmstate(const char *name, Error **errp); - void qemu_announce_self(void); =20 extern int autostart; diff --git a/migration/savevm.c b/migration/savevm.c index bb3f9ec..f2664f3 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -35,6 +35,7 @@ #include "sysemu/sysemu.h" #include "qemu/timer.h" #include "migration/migration.h" +#include "migration/snapshot.h" #include "qemu-file-channel.h" #include "qemu-file.h" #include "savevm.h" @@ -2067,7 +2068,7 @@ int qemu_loadvm_state(QEMUFile *f) return ret; } =20 -int save_vmstate(const char *name, Error **errp) +int save_snapshot(const char *name, Error **errp) { BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn1, *sn =3D &sn1, old_sn1, *old_sn =3D &old_sn1; @@ -2224,7 +2225,7 @@ void qmp_xen_load_devices_state(const char *filename,= Error **errp) migration_incoming_state_destroy(); } =20 -int load_vmstate(const char *name, Error **errp) +int load_snapshot(const char *name, Error **errp) { BlockDriverState *bs, *bs_vm_state; QEMUSnapshotInfo sn; diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index c75cd38..a4ded29 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -19,6 +19,7 @@ #include "qapi/qmp/qstring.h" #include "qemu/error-report.h" #include "migration/vmstate.h" +#include "migration/snapshot.h" =20 static void replay_pre_save(void *opaque) { @@ -66,13 +67,13 @@ void replay_vmstate_init(void) =20 if (replay_snapshot) { if (replay_mode =3D=3D REPLAY_MODE_RECORD) { - if (save_vmstate(replay_snapshot, &err) !=3D 0) { + if (save_snapshot(replay_snapshot, &err) !=3D 0) { error_report_err(err); error_report("Could not create snapshot for icount record"= ); exit(1); } } else if (replay_mode =3D=3D REPLAY_MODE_PLAY) { - if (load_vmstate(replay_snapshot, &err) !=3D 0) { + if (load_snapshot(replay_snapshot, &err) !=3D 0) { error_report_err(err); error_report("Could not load snapshot for icount replay"); exit(1); diff --git a/vl.c b/vl.c index 993690d..86f6c71 100644 --- a/vl.c +++ b/vl.c @@ -87,6 +87,7 @@ int main(int argc, char **argv) #include "sysemu/blockdev.h" #include "hw/block/block.h" #include "migration/block.h" +#include "migration/snapshot.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" #include "hw/audio/soundhw.h" @@ -4722,7 +4723,7 @@ int main(int argc, char **argv, char **envp) replay_vmstate_init(); } else if (loadvm) { Error *local_err =3D NULL; - if (load_vmstate(loadvm, &local_err) < 0) { + if (load_snapshot(loadvm, &local_err) < 0) { error_report_err(local_err); autostart =3D 0; } --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345767292905.3430132719292; Thu, 1 Jun 2017 12:36:07 -0700 (PDT) Received: from localhost ([::1]:46401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVt7-00066B-TG for importer@patchew.org; Thu, 01 Jun 2017 15:36:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhV-0004nJ-8V for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhT-0005Af-2h for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41242) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhS-00059w-Qe for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBFD3BB9CF for ; Thu, 1 Jun 2017 19:24:01 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A91E653CC2; Thu, 1 Jun 2017 19:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBFD3BB9CF 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 CBFD3BB9CF From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:26 +0200 Message-Id: <20170601192327.29712-15-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Jun 2017 19:24:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/15] 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 functions are internal except for ram_mig_init(). Create migration/misc.h for this kind of functions. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 38 ----------------------- include/migration/misc.h | 21 +++++++++++++ migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/ram.c | 2 ++ migration/ram.h | 70 +++++++++++++++++++++++++++++++++++++++= ++++ migration/rdma.c | 2 +- migration/savevm.c | 1 + vl.c | 1 + 9 files changed, 98 insertions(+), 39 deletions(-) create mode 100644 include/migration/misc.h create mode 100644 migration/ram.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 8d29bc9..79b5484 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -171,38 +171,6 @@ bool migration_in_postcopy(void); bool migration_in_postcopy_after_devices(MigrationState *); 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, - unsigned long pages); -/* 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); - bool migrate_release_ram(void); bool migrate_postcopy_ram(void); bool migrate_zero_blocks(void); @@ -213,8 +181,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(void); bool migrate_use_block_incremental(void); =20 @@ -253,7 +219,6 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t bl= ock_offset, ram_addr_t offset, size_t size, uint64_t *bytes_sent); =20 -void ram_mig_init(void); void savevm_skip_section_footers(void); void register_global_state(void); void global_state_set_optional(void); @@ -261,7 +226,4 @@ void savevm_skip_configuration(void); int global_state_store(void); void global_state_store_running(void); =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); #endif diff --git a/include/migration/misc.h b/include/migration/misc.h new file mode 100644 index 0000000..0b37714 --- /dev/null +++ b/include/migration/misc.h @@ -0,0 +1,21 @@ +/* + * QEMU migration miscellaneus exported 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 MIGRATION_MISC_H +#define MIGRATION_MISC_H + +/* migration/ram.c */ + +void ram_mig_init(void); + +#endif diff --git a/migration/migration.c b/migration/migration.c index ec79aff..6e5afa4 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -22,6 +22,7 @@ #include "fd.h" #include "socket.h" #include "rdma.h" +#include "ram.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 71f4389..9c41887 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -24,6 +24,7 @@ #include "qemu-file.h" #include "savevm.h" #include "postcopy-ram.h" +#include "ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" #include "qemu/error-report.h" diff --git a/migration/ram.c b/migration/ram.c index 390f714..f387e9c 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -36,7 +36,9 @@ #include "qemu/timer.h" #include "qemu/main-loop.h" #include "xbzrle.h" +#include "ram.h" #include "migration/migration.h" +#include "migration/misc.h" #include "qemu-file.h" #include "migration/vmstate.h" #include "postcopy-ram.h" diff --git a/migration/ram.h b/migration/ram.h new file mode 100644 index 0000000..c9563d1 --- /dev/null +++ b/migration/ram.h @@ -0,0 +1,70 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2003-2008 Fabrice Bellard + * Copyright (c) 2011-2015 Red Hat Inc + * + * Authors: + * Juan Quintela + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#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, + unsigned long pages); +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/rdma.c b/migration/rdma.c index fab30ea..e446c6f 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -20,7 +20,7 @@ #include "rdma.h" #include "migration/migration.h" #include "qemu-file.h" -#include "exec/cpu-common.h" +#include "ram.h" #include "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 f2664f3..9c320f5 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "qemu/timer.h" #include "migration/migration.h" #include "migration/snapshot.h" +#include "ram.h" #include "qemu-file-channel.h" #include "qemu-file.h" #include "savevm.h" diff --git a/vl.c b/vl.c index 86f6c71..13deeba 100644 --- a/vl.c +++ b/vl.c @@ -87,6 +87,7 @@ int main(int argc, char **argv) #include "sysemu/blockdev.h" #include "hw/block/block.h" #include "migration/block.h" +#include "migration/misc.h" #include "migration/snapshot.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" --=20 2.9.4 From nobody Fri Apr 19 23:20:54 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 1496345502336889.4753707109115; Thu, 1 Jun 2017 12:31:42 -0700 (PDT) Received: from localhost ([::1]:46381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVoo-0002us-Q6 for importer@patchew.org; Thu, 01 Jun 2017 15:31:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGVhW-0004oR-Fr for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGVhV-0005C1-CZ for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGVhV-0005BL-4i for qemu-devel@nongnu.org; Thu, 01 Jun 2017 15:24:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C1E5C04B30E for ; Thu, 1 Jun 2017 19:24:04 +0000 (UTC) Received: from secure.mitica (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28BCE53CC2; Thu, 1 Jun 2017 19:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2C1E5C04B30E 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 2C1E5C04B30E From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 21:23:27 +0200 Message-Id: <20170601192327.29712-16-quintela@redhat.com> In-Reply-To: <20170601192327.29712-1-quintela@redhat.com> References: <20170601192327.29712-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Jun 2017 19:24:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/15] migration: Move include/migration/block.h into migration/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@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 functions were internal, except blk_mig_init() that is exported in misc.h now. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/misc.h | 8 ++++++++ migration/block.c | 3 ++- {include/migration =3D> migration}/block.h | 2 -- migration/colo.c | 2 +- migration/migration.c | 2 +- vl.c | 1 - 6 files changed, 12 insertions(+), 6 deletions(-) rename {include/migration =3D> migration}/block.h (93%) diff --git a/include/migration/misc.h b/include/migration/misc.h index 0b37714..d7892b7 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -18,4 +18,12 @@ =20 void ram_mig_init(void); =20 +/* migration/block.c */ + +#ifdef CONFIG_LIVE_BLOCK_MIGRATION +void blk_mig_init(void); +#else +static inline void blk_mig_init(void) {} +#endif + #endif diff --git a/migration/block.c b/migration/block.c index 3e27499..4d8c2e9 100644 --- a/migration/block.c +++ b/migration/block.c @@ -23,7 +23,8 @@ #include "qemu/cutils.h" #include "qemu/queue.h" #include "qemu/timer.h" -#include "migration/block.h" +#include "block.h" +#include "migration/misc.h" #include "migration/migration.h" #include "sysemu/blockdev.h" #include "qemu-file.h" diff --git a/include/migration/block.h b/migration/block.h similarity index 93% rename from include/migration/block.h rename to migration/block.h index 28cff53..22ebe94 100644 --- a/include/migration/block.h +++ b/migration/block.h @@ -15,14 +15,12 @@ #define MIGRATION_BLOCK_H =20 #ifdef CONFIG_LIVE_BLOCK_MIGRATION -void blk_mig_init(void); int blk_mig_active(void); uint64_t blk_mig_bytes_transferred(void); uint64_t blk_mig_bytes_remaining(void); uint64_t blk_mig_bytes_total(void); =20 #else -static inline void blk_mig_init(void) { } static inline int blk_mig_active(void) { return false; diff --git a/migration/colo.c b/migration/colo.c index 4f1f3b8..111b715 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -18,7 +18,7 @@ #include "qemu-file.h" #include "savevm.h" #include "migration/colo.h" -#include "migration/block.h" +#include "block.h" #include "io/channel-buffer.h" #include "trace.h" #include "qemu/error-report.h" diff --git a/migration/migration.c b/migration/migration.c index 6e5afa4..48c94c9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -34,7 +34,7 @@ #include "qapi/util.h" #include "qemu/sockets.h" #include "qemu/rcu.h" -#include "migration/block.h" +#include "block.h" #include "postcopy-ram.h" #include "qemu/thread.h" #include "qmp-commands.h" diff --git a/vl.c b/vl.c index 13deeba..80b86c0 100644 --- a/vl.c +++ b/vl.c @@ -86,7 +86,6 @@ int main(int argc, char **argv) #include "qemu/log.h" #include "sysemu/blockdev.h" #include "hw/block/block.h" -#include "migration/block.h" #include "migration/misc.h" #include "migration/snapshot.h" #include "sysemu/tpm.h" --=20 2.9.4