From nobody Tue May 7 18:24:26 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 1493158169602467.7470689754841; Tue, 25 Apr 2017 15:09:29 -0700 (PDT) Received: from localhost ([::1]:51552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38eG-0001tI-4i for importer@patchew.org; Tue, 25 Apr 2017 18:09:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38Zx-0006mo-Bl for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38Zu-0004km-Nt for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35258) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38Zu-0004k5-Dq for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:04:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 678C981F07 for ; Tue, 25 Apr 2017 22:04:57 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B0B21714D; Tue, 25 Apr 2017 22:04:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 678C981F07 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 678C981F07 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:11 +0200 Message-Id: <20170425220451.6028-2-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Apr 2017 22:04:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 01/41] migration: Create migration/blocker.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" This allows us to remove lots of includes of migration/migration.h Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- block/qcow.c | 2 +- block/vdi.c | 2 +- block/vhdx.c | 2 +- block/vmdk.c | 2 +- block/vpc.c | 2 +- block/vvfat.c | 2 +- hw/9pfs/9p.c | 2 +- hw/display/qxl.c | 2 +- hw/display/virtio-gpu.c | 2 +- hw/intc/arm_gic_kvm.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 2 +- hw/misc/ivshmem.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/virtio/vhost.c | 2 +- include/migration/blocker.h | 35 +++++++++++++++++++++++++++= ++++ include/migration/migration.h | 18 ---------------- migration/migration.c | 1 + migration/ram.c | 2 +- migration/xbzrle.c | 2 +- {include/migration =3D> migration}/xbzrle.h | 0 stubs/migr-blocker.c | 2 +- target/i386/kvm.c | 2 +- tests/test-xbzrle.c | 2 +- 24 files changed, 56 insertions(+), 38 deletions(-) create mode 100644 include/migration/blocker.h rename {include/migration =3D> migration}/xbzrle.h (100%) diff --git a/block/qcow.c b/block/qcow.c index 9d6ac83..48e852c 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -32,7 +32,7 @@ #include #include "qapi/qmp/qerror.h" #include "crypto/cipher.h" -#include "migration/migration.h" +#include "migration/blocker.h" =20 /**************************************************************/ /* QEMU COW block driver with compression and encryption support */ diff --git a/block/vdi.c b/block/vdi.c index 9b4f70e..5f7b29f 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -55,7 +55,7 @@ #include "sysemu/block-backend.h" #include "qemu/module.h" #include "qemu/bswap.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/coroutine.h" #include "qemu/cutils.h" #include "qemu/uuid.h" diff --git a/block/vhdx.c b/block/vhdx.c index 052a753..6128b7b 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -24,7 +24,7 @@ #include "qemu/crc32c.h" #include "qemu/bswap.h" #include "block/vhdx.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/uuid.h" =20 /* Options for VHDX creation */ diff --git a/block/vmdk.c b/block/vmdk.c index a9bd22b..f09f0b2 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -31,7 +31,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/bswap.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/cutils.h" #include =20 diff --git a/block/vpc.c b/block/vpc.c index f591d4b..cb2d4cf 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -28,7 +28,7 @@ #include "block/block_int.h" #include "sysemu/block-backend.h" #include "qemu/module.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/bswap.h" #include "qemu/uuid.h" =20 diff --git a/block/vvfat.c b/block/vvfat.c index b509d55..3fcc59c 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -28,7 +28,7 @@ #include "block/block_int.h" #include "qemu/module.h" #include "qemu/bswap.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qstring.h" diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index c80ba67..ab3e22f 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -23,7 +23,7 @@ #include "9p-xattr.h" #include "coth.h" #include "trace.h" -#include "migration/migration.h" +#include "migration/blocker.h" =20 int open_fd_hw; int total_open_fd; diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 4d94cec..ad09bb9 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -26,7 +26,7 @@ #include "qemu/queue.h" #include "qemu/atomic.h" #include "sysemu/sysemu.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "trace.h" =20 #include "qxl.h" diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index e1056f3..8ad27f3 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -19,7 +19,7 @@ #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-gpu.h" #include "hw/virtio/virtio-bus.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/log.h" #include "qapi/error.h" =20 diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index ec952ec..af5cd36 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -24,7 +24,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "sysemu/kvm.h" #include "kvm_arm.h" #include "gic_internal.h" diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index bd4f3aa..a0441d6 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -24,7 +24,7 @@ #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "kvm_arm.h" -#include "migration/migration.h" +#include "migration/blocker.h" =20 #define TYPE_KVM_ARM_ITS "arm-its-kvm" #define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_I= TS) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 19aab56..4ee2baa 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -28,7 +28,7 @@ #include "kvm_arm.h" #include "gicv3_internal.h" #include "vgic_common.h" -#include "migration/migration.h" +#include "migration/blocker.h" =20 #ifdef DEBUG_GICV3_KVM #define DPRINTF(fmt, ...) \ diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 82ce837..475e36a 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -25,7 +25,7 @@ #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "sysemu/kvm.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "qemu/error-report.h" #include "qemu/event_notifier.h" #include "qom/object_interfaces.h" diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index f53bc17..0558737 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -21,7 +21,7 @@ #include "qemu/error-report.h" #include "qemu/queue.h" #include "monitor/monitor.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "hw/virtio/vhost-scsi.h" #include "hw/virtio/vhost.h" #include "hw/virtio/virtio-scsi.h" diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 0001e60..03a46a7 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -25,7 +25,7 @@ #include "exec/address-spaces.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "sysemu/dma.h" =20 /* enabled until disconnected backend stabilizes */ diff --git a/include/migration/blocker.h b/include/migration/blocker.h new file mode 100644 index 0000000..acd2701 --- /dev/null +++ b/include/migration/blocker.h @@ -0,0 +1,35 @@ +/* + * QEMU migration blockers + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef MIGRATION_BLOCKER_H +#define MIGRATION_BLOCKER_H + +/** + * @migrate_add_blocker - prevent migration from proceeding + * + * @reason - an error to be returned whenever migration is attempted + * + * @errp - [out] The reason (if any) we cannot block migration right now. + * + * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set. + */ +int migrate_add_blocker(Error *reason, Error **errp); + +/** + * @migrate_del_blocker - remove a blocking error from migration + * + * @reason - the error blocking migration + */ +void migrate_del_blocker(Error *reason); + +#endif diff --git a/include/migration/migration.h b/include/migration/migration.h index 9579280..02b074f 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -267,24 +267,6 @@ int ram_discard_range(const char *block_name, uint64_t= start, size_t length); int ram_postcopy_incoming_init(MigrationIncomingState *mis); void ram_postcopy_migrated_memory_release(MigrationState *ms); =20 -/** - * @migrate_add_blocker - prevent migration from proceeding - * - * @reason - an error to be returned whenever migration is attempted - * - * @errp - [out] The reason (if any) we cannot block migration right now. - * - * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set. - */ -int migrate_add_blocker(Error *reason, Error **errp); - -/** - * @migrate_del_blocker - remove a blocking error from migration - * - * @reason - the error blocking migration - */ -void migrate_del_blocker(Error *reason); - bool migrate_release_ram(void); bool migrate_postcopy_ram(void); bool migrate_zero_blocks(void); diff --git a/migration/migration.c b/migration/migration.c index f094079..8625a6c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -17,6 +17,7 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" +#include "migration/blocker.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" diff --git a/migration/ram.c b/migration/ram.c index 5428026..4e562be 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -35,7 +35,7 @@ #include "qemu/bitmap.h" #include "qemu/timer.h" #include "qemu/main-loop.h" -#include "migration/xbzrle.h" +#include "xbzrle.h" #include "migration/migration.h" #include "migration/postcopy-ram.h" #include "exec/address-spaces.h" diff --git a/migration/xbzrle.c b/migration/xbzrle.c index 421bca0..1ba482d 100644 --- a/migration/xbzrle.c +++ b/migration/xbzrle.c @@ -12,7 +12,7 @@ */ #include "qemu/osdep.h" #include "qemu/cutils.h" -#include "migration/xbzrle.h" +#include "xbzrle.h" =20 /* page =3D zrun nzrun diff --git a/include/migration/xbzrle.h b/migration/xbzrle.h similarity index 100% rename from include/migration/xbzrle.h rename to migration/xbzrle.h diff --git a/stubs/migr-blocker.c b/stubs/migr-blocker.c index a5ba18f..2b64ac9 100644 --- a/stubs/migr-blocker.c +++ b/stubs/migr-blocker.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qemu-common.h" -#include "migration/migration.h" +#include "migration/blocker.h" =20 int migrate_add_blocker(Error *reason, Error **errp) { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 55865db..011d4a5 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -43,7 +43,7 @@ #include "standard-headers/asm-x86/hyperv.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" -#include "migration/migration.h" +#include "migration/blocker.h" #include "exec/memattrs.h" #include "trace.h" =20 diff --git a/tests/test-xbzrle.c b/tests/test-xbzrle.c index d97b5eb..f5e08de 100644 --- a/tests/test-xbzrle.c +++ b/tests/test-xbzrle.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/cutils.h" -#include "include/migration/xbzrle.h" +#include "../migration/xbzrle.h" =20 #define PAGE_SIZE 4096 =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158169963421.05918326057974; Tue, 25 Apr 2017 15:09:29 -0700 (PDT) Received: from localhost ([::1]:51553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38eG-0001tl-K3 for importer@patchew.org; Tue, 25 Apr 2017 18:09:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38Zy-0006mp-5C for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38Zw-0004m5-Bk for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38Zw-0004l9-2q for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1470380481 for ; Tue, 25 Apr 2017 22:04:59 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA5801714C; Tue, 25 Apr 2017 22:04:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1470380481 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1470380481 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:12 +0200 Message-Id: <20170425220451.6028-3-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Apr 2017 22:04:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 02/41] migration: Split migration/channel.c for channel operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" Create an include for its exported functions. Signed-off-by: Juan Quintela --- include/migration/migration.h | 7 ----- migration/Makefile.objs | 2 +- migration/channel.c | 69 +++++++++++++++++++++++++++++++++++++++= ++++ migration/channel.h | 25 ++++++++++++++++ migration/exec.c | 1 + migration/fd.c | 1 + migration/migration.c | 50 ------------------------------- migration/socket.c | 1 + migration/tls.c | 1 + 9 files changed, 99 insertions(+), 58 deletions(-) create mode 100644 migration/channel.c create mode 100644 migration/channel.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 02b074f..bb81433 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -179,17 +179,10 @@ void migration_fd_process_incoming(QEMUFile *f); =20 void qemu_start_incoming_migration(const char *uri, Error **errp); =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc); - void migration_tls_channel_process_incoming(MigrationState *s, QIOChannel *ioc, Error **errp); =20 -void migration_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname); - void migration_tls_channel_connect(MigrationState *s, QIOChannel *ioc, const char *hostname, diff --git a/migration/Makefile.objs b/migration/Makefile.objs index 480dd49..c83ca92 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,5 +1,5 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o -common-obj-y +=3D tls.o +common-obj-y +=3D tls.o channel.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o common-obj-y +=3D vmstate.o common-obj-y +=3D qemu-file.o diff --git a/migration/channel.c b/migration/channel.c new file mode 100644 index 0000000..6104de5 --- /dev/null +++ b/migration/channel.c @@ -0,0 +1,69 @@ +/* + * QEMU live migration + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "channel.h" +#include "migration/migration.h" +#include "trace.h" +#include "qapi/error.h" +#include "io/channel-tls.h" + +void migration_channel_process_incoming(MigrationState *s, + QIOChannel *ioc) +{ + trace_migration_set_incoming_channel( + ioc, object_get_typename(OBJECT(ioc))); + + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + Error *local_err =3D NULL; + migration_tls_channel_process_incoming(s, ioc, &local_err); + if (local_err) { + error_report_err(local_err); + } + } else { + QEMUFile *f =3D qemu_fopen_channel_input(ioc); + migration_fd_process_incoming(f); + } +} + + +void migration_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname) +{ + trace_migration_set_outgoing_channel( + ioc, object_get_typename(OBJECT(ioc)), hostname); + + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + Error *local_err =3D NULL; + migration_tls_channel_connect(s, ioc, hostname, &local_err); + if (local_err) { + migrate_fd_error(s, local_err); + error_free(local_err); + } + } else { + QEMUFile *f =3D qemu_fopen_channel_output(ioc); + + s->to_dst_file =3D f; + + migrate_fd_connect(s); + } +} diff --git a/migration/channel.h b/migration/channel.h new file mode 100644 index 0000000..618acb7 --- /dev/null +++ b/migration/channel.h @@ -0,0 +1,25 @@ +/* + * QEMU live migration channel functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_CHANNEL_H +#define QEMU_MIGRATION_CHANNEL_H + +#include "io/channel.h" + +void migration_channel_process_incoming(MigrationState *s, + QIOChannel *ioc); + +void migration_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname); +#endif diff --git a/migration/exec.c b/migration/exec.c index 9157721..203f587 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "channel.h" #include "migration/migration.h" #include "io/channel-command.h" #include "trace.h" diff --git a/migration/fd.c b/migration/fd.c index 58cb51a..05e0a5c 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -17,6 +17,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "channel.h" #include "migration/migration.h" #include "monitor/monitor.h" #include "io/channel-util.h" diff --git a/migration/migration.c b/migration/migration.c index 8625a6c..8c873c7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -460,56 +460,6 @@ void migration_fd_process_incoming(QEMUFile *f) qemu_coroutine_enter(co); } =20 - -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc) -{ - trace_migration_set_incoming_channel( - ioc, object_get_typename(OBJECT(ioc))); - - if (s->parameters.tls_creds && - *s->parameters.tls_creds && - !object_dynamic_cast(OBJECT(ioc), - TYPE_QIO_CHANNEL_TLS)) { - Error *local_err =3D NULL; - migration_tls_channel_process_incoming(s, ioc, &local_err); - if (local_err) { - error_report_err(local_err); - } - } else { - QEMUFile *f =3D qemu_fopen_channel_input(ioc); - migration_fd_process_incoming(f); - } -} - - -void migration_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname) -{ - trace_migration_set_outgoing_channel( - ioc, object_get_typename(OBJECT(ioc)), hostname); - - if (s->parameters.tls_creds && - *s->parameters.tls_creds && - !object_dynamic_cast(OBJECT(ioc), - TYPE_QIO_CHANNEL_TLS)) { - Error *local_err =3D NULL; - migration_tls_channel_connect(s, ioc, hostname, &local_err); - if (local_err) { - migrate_fd_error(s, local_err); - error_free(local_err); - } - } else { - QEMUFile *f =3D qemu_fopen_channel_output(ioc); - - s->to_dst_file =3D f; - - migrate_fd_connect(s); - } -} - - /* * Send a message on the return channel back to the source * of the migration. diff --git a/migration/socket.c b/migration/socket.c index dc88812..99bd7e7 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -19,6 +19,7 @@ #include "qemu-common.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "channel.h" #include "migration/migration.h" #include "migration/qemu-file.h" #include "io/channel-socket.h" diff --git a/migration/tls.c b/migration/tls.c index a33ecb7..34ad121 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "channel.h" #include "migration/migration.h" #include "io/channel-tls.h" #include "crypto/tlscreds.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158018281548.5952001039336; Tue, 25 Apr 2017 15:06:58 -0700 (PDT) Received: from localhost ([::1]:51545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38bo-00083H-PK for importer@patchew.org; Tue, 25 Apr 2017 18:06:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38Zy-0006mr-U4 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38Zx-0004nJ-Vj for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44150) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38Zx-0004mR-Nv for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B504DC05680F for ; Tue, 25 Apr 2017 22:05:00 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 663E61714C; Tue, 25 Apr 2017 22:04:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B504DC05680F 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 B504DC05680F From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:13 +0200 Message-Id: <20170425220451.6028-4-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 25 Apr 2017 22:05:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 03/41] migration: Remove MigrationState from migration_channel_incomming() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 callers were calling migrate_get_current(), so do it inside the functio= n. Signed-off-by: Juan Quintela --- migration/channel.c | 5 +++-- migration/channel.h | 3 +-- migration/exec.c | 2 +- migration/fd.c | 2 +- migration/socket.c | 3 +-- migration/tls.c | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/migration/channel.c b/migration/channel.c index 6104de5..acb4dd6 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -20,9 +20,10 @@ #include "qapi/error.h" #include "io/channel-tls.h" =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc) +void migration_channel_process_incoming(QIOChannel *ioc) { + MigrationState *s =3D migrate_get_current(); + trace_migration_set_incoming_channel( ioc, object_get_typename(OBJECT(ioc))); =20 diff --git a/migration/channel.h b/migration/channel.h index 618acb7..fbc4bfb 100644 --- a/migration/channel.h +++ b/migration/channel.h @@ -16,8 +16,7 @@ =20 #include "io/channel.h" =20 -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc); +void migration_channel_process_incoming(QIOChannel *ioc); =20 void migration_channel_connect(MigrationState *s, QIOChannel *ioc, diff --git a/migration/exec.c b/migration/exec.c index 203f587..405d0ab 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -48,7 +48,7 @@ static gboolean exec_accept_incoming_migration(QIOChannel= *ioc, GIOCondition condition, gpointer opaque) { - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); return FALSE; /* unregister */ } diff --git a/migration/fd.c b/migration/fd.c index 05e0a5c..ccaa806 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -48,7 +48,7 @@ static gboolean fd_accept_incoming_migration(QIOChannel *= ioc, GIOCondition condition, gpointer opaque) { - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); return FALSE; /* unregister */ } diff --git a/migration/socket.c b/migration/socket.c index 99bd7e7..a49cf44 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -149,8 +149,7 @@ static gboolean socket_accept_incoming_migration(QIOCha= nnel *ioc, trace_migration_socket_incoming_accepted(); =20 qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-incoming"); - migration_channel_process_incoming(migrate_get_current(), - QIO_CHANNEL(sioc)); + migration_channel_process_incoming(QIO_CHANNEL(sioc)); object_unref(OBJECT(sioc)); =20 out: diff --git a/migration/tls.c b/migration/tls.c index 34ad121..b4cb8fe 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -73,7 +73,7 @@ static void migration_tls_incoming_handshake(QIOTask *tas= k, error_report_err(err); } else { trace_migration_tls_incoming_handshake_complete(); - migration_channel_process_incoming(migrate_get_current(), ioc); + migration_channel_process_incoming(ioc); } object_unref(OBJECT(ioc)); } --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158316966945.6711434739851; Tue, 25 Apr 2017 15:11:56 -0700 (PDT) Received: from localhost ([::1]:51566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38gd-0003zc-9I for importer@patchew.org; Tue, 25 Apr 2017 18:11:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38a2-0006pJ-PD for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38a1-0004qM-EP for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39938) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38a1-0004pV-5I for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C74519D38F for ; Tue, 25 Apr 2017 22:05:04 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11B241714C; Tue, 25 Apr 2017 22:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C74519D38F 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 1C74519D38F From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:14 +0200 Message-Id: <20170425220451.6028-5-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 25 Apr 2017 22:05: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] [PATCH 04/41] migration: Export qemu-file-channel.c functions in its own file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 --- include/migration/migration.h | 1 + include/migration/qemu-file.h | 4 ---- migration/channel.c | 1 + migration/colo.c | 1 + migration/migration.c | 1 + migration/qemu-file-channel.c | 1 + migration/qemu-file-channel.h | 21 +++++++++++++++++++++ migration/rdma.c | 1 + migration/savevm.c | 1 + tests/test-vmstate.c | 1 + 10 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 migration/qemu-file-channel.h diff --git a/include/migration/migration.h b/include/migration/migration.h index bb81433..d465624 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -19,6 +19,7 @@ #include "qemu/thread.h" #include "qemu/notify.h" #include "migration/vmstate.h" +#include "io/channel.h" #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 0cd648a..b5ac800 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -27,8 +27,6 @@ =20 #include "qemu-common.h" #include "exec/cpu-common.h" -#include "io/channel.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 @@ -119,8 +117,6 @@ typedef struct QEMUFileHooks { } QEMUFileHooks; =20 QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops); -QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); -QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks); int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); diff --git a/migration/channel.c b/migration/channel.c index acb4dd6..d9b51de 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "channel.h" #include "migration/migration.h" +#include "qemu-file-channel.h" #include "trace.h" #include "qapi/error.h" #include "io/channel-tls.h" diff --git a/migration/colo.c b/migration/colo.c index 75e8807..cd9e767 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu-file-channel.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index 8c873c7..dd8c9d5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -19,6 +19,7 @@ #include "qemu/main-loop.h" #include "migration/blocker.h" #include "migration/migration.h" +#include "qemu-file-channel.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" #include "block/block.h" diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c index 45c13f1..dc991c9 100644 --- a/migration/qemu-file-channel.c +++ b/migration/qemu-file-channel.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu-file-channel.h" #include "migration/qemu-file.h" #include "io/channel-socket.h" #include "qemu/iov.h" diff --git a/migration/qemu-file-channel.h b/migration/qemu-file-channel.h new file mode 100644 index 0000000..d1bd5ff --- /dev/null +++ b/migration/qemu-file-channel.h @@ -0,0 +1,21 @@ +/* + * QEMU migration file channel operations + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_FILE_CHANNEL_H +#define QEMU_FILE_CHANNEL_H + +#include "io/channel.h" + +QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); +QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); +#endif diff --git a/migration/rdma.c b/migration/rdma.c index fe0a4b5..fffe2d6 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -20,6 +20,7 @@ #include "migration/migration.h" #include "migration/qemu-file.h" #include "exec/cpu-common.h" +#include "qemu-file-channel.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h" diff --git a/migration/savevm.c b/migration/savevm.c index 97c6908..7a07ea6 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "sysemu/sysemu.h" #include "qemu/timer.h" #include "migration/migration.h" +#include "qemu-file-channel.h" #include "migration/postcopy-ram.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index f694a89..1c13570 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -27,6 +27,7 @@ #include "qemu-common.h" #include "migration/migration.h" #include "migration/vmstate.h" +#include "../migration/qemu-file-channel.h" #include "qemu/coroutine.h" #include "io/channel-file.h" =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158466761749.947713358032; Tue, 25 Apr 2017 15:14:26 -0700 (PDT) Received: from localhost ([::1]:51574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38j3-0006Ip-7f for importer@patchew.org; Tue, 25 Apr 2017 18:14:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38a7-0006v3-0m for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38a2-0004sq-Uf for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38a2-0004rA-PK for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC8243D97B for ; Tue, 25 Apr 2017 22:05:05 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DEF51756E; Tue, 25 Apr 2017 22:05:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BC8243D97B 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 BC8243D97B From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:15 +0200 Message-Id: <20170425220451.6028-6-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:05:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 05/41] migration: Remove migration.h from colo.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" migration.h is not included in any includes now. Signed-off-by: Juan Quintela --- include/migration/colo.h | 1 - migration/colo-comm.c | 3 ++- migration/colo.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/migration/colo.h b/include/migration/colo.h index 2bbff9e..ba0bb6e 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -14,7 +14,6 @@ #define QEMU_COLO_H =20 #include "qemu-common.h" -#include "migration/migration.h" #include "qemu/coroutine_int.h" #include "qemu/thread.h" #include "qemu/main-loop.h" diff --git a/migration/colo-comm.c b/migration/colo-comm.c index 20b60ec..3d91798 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -12,7 +12,8 @@ */ =20 #include "qemu/osdep.h" -#include +#include "migration/migration.h" +#include "migration/colo.h" #include "trace.h" =20 typedef struct { diff --git a/migration/colo.c b/migration/colo.c index cd9e767..fb00310 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -14,6 +14,7 @@ #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "qemu-file-channel.h" +#include "migration/migration.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158026674834.1994914436849; Tue, 25 Apr 2017 15:07:06 -0700 (PDT) Received: from localhost ([::1]:51546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38bx-0008An-0P for importer@patchew.org; Tue, 25 Apr 2017 18:07:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38a7-0006v2-0b for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38a4-0004yf-JA for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36140) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38a4-0004wY-Dv for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:08 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E38880044 for ; Tue, 25 Apr 2017 22:05:07 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D6BA17566; Tue, 25 Apr 2017 22:05:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6E38880044 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 6E38880044 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:16 +0200 Message-Id: <20170425220451.6028-7-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 22:05:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 06/41] migration: Move colo.h to 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" There are functions only used by migration code. Signed-off-by: Juan Quintela --- MAINTAINERS | 2 +- migration/colo-comm.c | 2 +- migration/colo-failover.c | 2 +- {include/migration =3D> migration}/colo.h | 0 migration/migration.c | 2 +- migration/ram.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename {include/migration =3D> migration}/colo.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index cae3b09..3560ba2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1535,7 +1535,7 @@ COLO Framework M: zhanghailiang S: Maintained F: migration/colo* -F: include/migration/colo.h +F: migration/colo.h F: include/migration/failover.h F: docs/COLO-FT.txt =20 diff --git a/migration/colo-comm.c b/migration/colo-comm.c index 3d91798..9b35027 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -13,7 +13,7 @@ =20 #include "qemu/osdep.h" #include "migration/migration.h" -#include "migration/colo.h" +#include "colo.h" #include "trace.h" =20 typedef struct { diff --git a/migration/colo-failover.c b/migration/colo-failover.c index cc229f5..29b8d63 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -11,7 +11,7 @@ */ =20 #include "qemu/osdep.h" -#include "migration/colo.h" +#include "colo.h" #include "migration/failover.h" #include "qmp-commands.h" #include "qapi/qmp/qerror.h" diff --git a/include/migration/colo.h b/migration/colo.h similarity index 100% rename from include/migration/colo.h rename to migration/colo.h diff --git a/migration/migration.c b/migration/migration.c index dd8c9d5..fe30227 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -38,7 +38,7 @@ #include "exec/address-spaces.h" #include "io/channel-buffer.h" #include "io/channel-tls.h" -#include "migration/colo.h" +#include "colo.h" =20 #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttli= ng */ =20 diff --git a/migration/ram.c b/migration/ram.c index 4e562be..47e66f4 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -44,7 +44,7 @@ #include "trace.h" #include "exec/ram_addr.h" #include "qemu/rcu_queue.h" -#include "migration/colo.h" +#include "colo.h" =20 /***********************************************************/ /* ram save/restore */ --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158086506962.5820331877461; Tue, 25 Apr 2017 15:08:06 -0700 (PDT) Received: from localhost ([::1]:51547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38cv-0000m2-7q for importer@patchew.org; Tue, 25 Apr 2017 18:08:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38a7-0006v4-Bv for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38a6-00050R-AP for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38a6-0004zo-40 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1BB544E336 for ; Tue, 25 Apr 2017 22:05:09 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id BED1E17566; Tue, 25 Apr 2017 22:05:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1BB544E336 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1BB544E336 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:17 +0200 Message-Id: <20170425220451.6028-8-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Apr 2017 22:05:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 07/41] migration: Move failover.h to migration/colo-failover.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" This file is internal for migration/colo code. Signed-off-by: Juan Quintela --- MAINTAINERS | 2 +- migration/colo-failover.c | 2 +- include/migration/failover.h =3D> migration/colo-failover.h | 0 migration/colo.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename include/migration/failover.h =3D> migration/colo-failover.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 3560ba2..7435c9d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1536,7 +1536,7 @@ M: zhanghailiang S: Maintained F: migration/colo* F: migration/colo.h -F: include/migration/failover.h +F: migration/colo-failover.h F: docs/COLO-FT.txt =20 COLO Proxy diff --git a/migration/colo-failover.c b/migration/colo-failover.c index 29b8d63..85c4526 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -12,7 +12,7 @@ =20 #include "qemu/osdep.h" #include "colo.h" -#include "migration/failover.h" +#include "colo-failover.h" #include "qmp-commands.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" diff --git a/include/migration/failover.h b/migration/colo-failover.h similarity index 100% rename from include/migration/failover.h rename to migration/colo-failover.h diff --git a/migration/colo.c b/migration/colo.c index fb00310..31ab23f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -20,7 +20,7 @@ #include "trace.h" #include "qemu/error-report.h" #include "qapi/error.h" -#include "migration/failover.h" +#include "colo-failover.h" #include "replication.h" #include "qmp-commands.h" =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158235700882.4744830688044; Tue, 25 Apr 2017 15:10:35 -0700 (PDT) Received: from localhost ([::1]:51560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38fJ-0002rn-8d for importer@patchew.org; Tue, 25 Apr 2017 18:10:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aA-0006zW-MU for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38a9-000545-MY for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35406) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38a9-000537-GT for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 764D9558A2 for ; Tue, 25 Apr 2017 22:05:12 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CE141714C; Tue, 25 Apr 2017 22:05:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 764D9558A2 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 764D9558A2 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:18 +0200 Message-Id: <20170425220451.6028-9-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Apr 2017 22:05:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 08/41] migration: Move page_cache.c to 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" It is only used by migration, so move it there. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- Makefile.objs | 1 - migration/Makefile.objs | 2 +- page_cache.c =3D> migration/page_cache.c | 0 {include/migration =3D> migration}/page_cache.h | 0 tests/Makefile.include | 2 +- 5 files changed, 2 insertions(+), 3 deletions(-) rename page_cache.c =3D> migration/page_cache.c (100%) rename {include/migration =3D> migration}/page_cache.h (100%) diff --git a/Makefile.objs b/Makefile.objs index 6167e7b..2100845 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -49,7 +49,6 @@ common-obj-$(CONFIG_POSIX) +=3D os-posix.o common-obj-$(CONFIG_LINUX) +=3D fsdev/ =20 common-obj-y +=3D migration/ -common-obj-y +=3D page_cache.o #aio.o =20 common-obj-$(CONFIG_SPICE) +=3D spice-qemu-char.o =20 diff --git a/migration/Makefile.objs b/migration/Makefile.objs index c83ca92..ce8ce12 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,7 +1,7 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o common-obj-y +=3D tls.o channel.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o -common-obj-y +=3D vmstate.o +common-obj-y +=3D vmstate.o page_cache.o common-obj-y +=3D qemu-file.o common-obj-y +=3D qemu-file-channel.o common-obj-y +=3D xbzrle.o postcopy-ram.o diff --git a/page_cache.c b/migration/page_cache.c similarity index 100% rename from page_cache.c rename to migration/page_cache.c diff --git a/include/migration/page_cache.h b/migration/page_cache.h similarity index 100% rename from include/migration/page_cache.h rename to migration/page_cache.h diff --git a/tests/Makefile.include b/tests/Makefile.include index 579ec07..0f98c04 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -549,7 +549,7 @@ tests/test-thread-pool$(EXESUF): tests/test-thread-pool= .o $(test-block-obj-y) tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y) tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o -tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o page_ca= che.o $(test-util-obj-y) +tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migrati= on/page_cache.o $(test-util-obj-y) tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o tests/test-int128$(EXESUF): tests/test-int128.o tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y) --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158318433863.1905843778744; Tue, 25 Apr 2017 15:11:58 -0700 (PDT) Received: from localhost ([::1]:51567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38gf-00040v-00 for importer@patchew.org; Tue, 25 Apr 2017 18:11:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aC-00070o-1m for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aB-00055J-9u for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44230) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aB-00054l-3W for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21200C054C4C for ; Tue, 25 Apr 2017 22:05:14 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id C95F81714C; Tue, 25 Apr 2017 22:05:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 21200C054C4C 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 21200C054C4C From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:19 +0200 Message-Id: <20170425220451.6028-10-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 25 Apr 2017 22:05:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 09/41] migration: Move qjson.h to 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" It is only used for migration code. Signed-off-by: Juan Quintela --- migration/qjson.c | 2 +- {include/migration =3D> migration}/qjson.h | 0 migration/vmstate.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename {include/migration =3D> migration}/qjson.h (100%) diff --git a/migration/qjson.c b/migration/qjson.c index f345904..9d7f6eb 100644 --- a/migration/qjson.c +++ b/migration/qjson.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include "qapi/qmp/qstring.h" -#include "migration/qjson.h" +#include "qjson.h" =20 struct QJSON { QString *str; diff --git a/include/migration/qjson.h b/migration/qjson.h similarity index 100% rename from include/migration/qjson.h rename to migration/qjson.h diff --git a/migration/vmstate.c b/migration/vmstate.c index 7b4a607..66c50ee 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -7,7 +7,7 @@ #include "qemu/error-report.h" #include "qemu/queue.h" #include "trace.h" -#include "migration/qjson.h" +#include "qjson.h" =20 static void vmstate_subsection_save(QEMUFile *f, const VMStateDescription = *vmsd, void *opaque, QJSON *vmdesc); --=20 2.9.3 From nobody Tue May 7 18:24:26 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 14931586168171017.8131699861013; Tue, 25 Apr 2017 15:16:56 -0700 (PDT) Received: from localhost ([::1]:51588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38lT-0008OD-EQ for importer@patchew.org; Tue, 25 Apr 2017 18:16:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aG-000749-4s for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aC-000577-VN for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44194) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aC-000565-PQ for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:16 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C32B84E336 for ; Tue, 25 Apr 2017 22:05:15 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73F071714C; Tue, 25 Apr 2017 22:05:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C32B84E336 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C32B84E336 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:20 +0200 Message-Id: <20170425220451.6028-11-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Apr 2017 22:05:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 10/41] migration: Move postcopy-ram.h to 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" It is internal to migration, not intended for other users. Signed-off-by: Juan Quintela --- migration/migration.c | 2 +- migration/postcopy-ram.c | 2 +- {include/migration =3D> migration}/postcopy-ram.h | 0 migration/ram.c | 2 +- migration/savevm.c | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename {include/migration =3D> migration}/postcopy-ram.h (100%) diff --git a/migration/migration.c b/migration/migration.c index fe30227..fef1f0a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -28,7 +28,7 @@ #include "qemu/sockets.h" #include "qemu/rcu.h" #include "migration/block.h" -#include "migration/postcopy-ram.h" +#include "postcopy-ram.h" #include "qemu/thread.h" #include "qmp-commands.h" #include "trace.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index e3f4a37..cdadaf6 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -20,7 +20,7 @@ =20 #include "qemu-common.h" #include "migration/migration.h" -#include "migration/postcopy-ram.h" +#include "postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" #include "qemu/error-report.h" diff --git a/include/migration/postcopy-ram.h b/migration/postcopy-ram.h similarity index 100% rename from include/migration/postcopy-ram.h rename to migration/postcopy-ram.h diff --git a/migration/ram.c b/migration/ram.c index 47e66f4..5fcf593 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/postcopy-ram.h" +#include "postcopy-ram.h" #include "exec/address-spaces.h" #include "migration/page_cache.h" #include "qemu/error-report.h" diff --git a/migration/savevm.c b/migration/savevm.c index 7a07ea6..1b2a83c 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -37,7 +37,7 @@ #include "qemu/timer.h" #include "migration/migration.h" #include "qemu-file-channel.h" -#include "migration/postcopy-ram.h" +#include "postcopy-ram.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/queue.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 14931585389281019.2666688473855; Tue, 25 Apr 2017 15:15:38 -0700 (PDT) Received: from localhost ([::1]:51585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38kC-0007LJ-Dp for importer@patchew.org; Tue, 25 Apr 2017 18:15:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aI-00076h-SM for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aF-00059F-29 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36206) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aE-000589-Ks for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A010580044 for ; Tue, 25 Apr 2017 22:05:17 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 223101714C; Tue, 25 Apr 2017 22:05:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A010580044 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 A010580044 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:21 +0200 Message-Id: <20170425220451.6028-12-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 22:05:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 11/41] migration: Split vmstate-types.c from vmstate.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" Now one just has the interperter, and the other has the basic types. Once there, add copyright boilerplate. Signed-off-by: Juan Quintela --- migration/Makefile.objs | 2 +- migration/vmstate-types.c | 676 ++++++++++++++++++++++++++++++++++++++++++= ++++ migration/vmstate.c | 669 ++----------------------------------------= --- tests/Makefile.include | 2 +- 4 files changed, 705 insertions(+), 644 deletions(-) create mode 100644 migration/vmstate-types.c diff --git a/migration/Makefile.objs b/migration/Makefile.objs index ce8ce12..812b2ec 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,7 +1,7 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o common-obj-y +=3D tls.o channel.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o -common-obj-y +=3D vmstate.o page_cache.o +common-obj-y +=3D vmstate.o vmstate-types.o page_cache.o common-obj-y +=3D qemu-file.o common-obj-y +=3D qemu-file-channel.o common-obj-y +=3D xbzrle.o postcopy-ram.o diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c new file mode 100644 index 0000000..0cf14d4 --- /dev/null +++ b/migration/vmstate-types.c @@ -0,0 +1,676 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2009-2017 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. + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "migration/migration.h" +#include "migration/qemu-file.h" +#include "migration/vmstate.h" +#include "qemu/error-report.h" +#include "qemu/queue.h" +#include "trace.h" + +/* bool */ + +static int get_bool(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d) +{ + bool *v =3D pv; + *v =3D qemu_get_byte(f); + return 0; +} + +static int put_bool(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d, + QJSON *vmdesc) +{ + bool *v =3D pv; + qemu_put_byte(f, *v); + return 0; +} + +const VMStateInfo vmstate_info_bool =3D { + .name =3D "bool", + .get =3D get_bool, + .put =3D put_bool, +}; + +/* 8 bit int */ + +static int get_int8(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d) +{ + int8_t *v =3D pv; + qemu_get_s8s(f, v); + return 0; +} + +static int put_int8(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d, + QJSON *vmdesc) +{ + int8_t *v =3D pv; + qemu_put_s8s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_int8 =3D { + .name =3D "int8", + .get =3D get_int8, + .put =3D put_int8, +}; + +/* 16 bit int */ + +static int get_int16(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) +{ + int16_t *v =3D pv; + qemu_get_sbe16s(f, v); + return 0; +} + +static int put_int16(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, + QJSON *vmdesc) +{ + int16_t *v =3D pv; + qemu_put_sbe16s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_int16 =3D { + .name =3D "int16", + .get =3D get_int16, + .put =3D put_int16, +}; + +/* 32 bit int */ + +static int get_int32(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) +{ + int32_t *v =3D pv; + qemu_get_sbe32s(f, v); + return 0; +} + +static int put_int32(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, + QJSON *vmdesc) +{ + int32_t *v =3D pv; + qemu_put_sbe32s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_int32 =3D { + .name =3D "int32", + .get =3D get_int32, + .put =3D put_int32, +}; + +/* 32 bit int. See that the received value is the same than the one + in the field */ + +static int get_int32_equal(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + int32_t *v =3D pv; + int32_t v2; + qemu_get_sbe32s(f, &v2); + + if (*v =3D=3D v2) { + return 0; + } + error_report("%" PRIx32 " !=3D %" PRIx32, *v, v2); + return -EINVAL; +} + +const VMStateInfo vmstate_info_int32_equal =3D { + .name =3D "int32 equal", + .get =3D get_int32_equal, + .put =3D put_int32, +}; + +/* 32 bit int. Check that the received value is non-negative + * and less than or equal to the one in the field. + */ + +static int get_int32_le(QEMUFile *f, void *pv, size_t size, VMStateField *= field) +{ + int32_t *cur =3D pv; + int32_t loaded; + qemu_get_sbe32s(f, &loaded); + + if (loaded >=3D 0 && loaded <=3D *cur) { + *cur =3D loaded; + return 0; + } + error_report("Invalid value %" PRId32 + " expecting positive value <=3D %" PRId32, + loaded, *cur); + return -EINVAL; +} + +const VMStateInfo vmstate_info_int32_le =3D { + .name =3D "int32 le", + .get =3D get_int32_le, + .put =3D put_int32, +}; + +/* 64 bit int */ + +static int get_int64(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) +{ + int64_t *v =3D pv; + qemu_get_sbe64s(f, v); + return 0; +} + +static int put_int64(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, + QJSON *vmdesc) +{ + int64_t *v =3D pv; + qemu_put_sbe64s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_int64 =3D { + .name =3D "int64", + .get =3D get_int64, + .put =3D put_int64, +}; + +/* 8 bit unsigned int */ + +static int get_uint8(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) +{ + uint8_t *v =3D pv; + qemu_get_8s(f, v); + return 0; +} + +static int put_uint8(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, + QJSON *vmdesc) +{ + uint8_t *v =3D pv; + qemu_put_8s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_uint8 =3D { + .name =3D "uint8", + .get =3D get_uint8, + .put =3D put_uint8, +}; + +/* 16 bit unsigned int */ + +static int get_uint16(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) +{ + uint16_t *v =3D pv; + qemu_get_be16s(f, v); + return 0; +} + +static int put_uint16(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, + QJSON *vmdesc) +{ + uint16_t *v =3D pv; + qemu_put_be16s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_uint16 =3D { + .name =3D "uint16", + .get =3D get_uint16, + .put =3D put_uint16, +}; + +/* 32 bit unsigned int */ + +static int get_uint32(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) +{ + uint32_t *v =3D pv; + qemu_get_be32s(f, v); + return 0; +} + +static int put_uint32(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, + QJSON *vmdesc) +{ + uint32_t *v =3D pv; + qemu_put_be32s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_uint32 =3D { + .name =3D "uint32", + .get =3D get_uint32, + .put =3D put_uint32, +}; + +/* 32 bit uint. See that the received value is the same than the one + in the field */ + +static int get_uint32_equal(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint32_t *v =3D pv; + uint32_t v2; + qemu_get_be32s(f, &v2); + + if (*v =3D=3D v2) { + return 0; + } + error_report("%" PRIx32 " !=3D %" PRIx32, *v, v2); + return -EINVAL; +} + +const VMStateInfo vmstate_info_uint32_equal =3D { + .name =3D "uint32 equal", + .get =3D get_uint32_equal, + .put =3D put_uint32, +}; + +/* 64 bit unsigned int */ + +static int get_uint64(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) +{ + uint64_t *v =3D pv; + qemu_get_be64s(f, v); + return 0; +} + +static int put_uint64(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, + QJSON *vmdesc) +{ + uint64_t *v =3D pv; + qemu_put_be64s(f, v); + return 0; +} + +const VMStateInfo vmstate_info_uint64 =3D { + .name =3D "uint64", + .get =3D get_uint64, + .put =3D put_uint64, +}; + +static int get_nullptr(QEMUFile *f, void *pv, size_t size, VMStateField *f= ield) + +{ + if (qemu_get_byte(f) =3D=3D VMS_NULLPTR_MARKER) { + return 0; + } + error_report("vmstate: get_nullptr expected VMS_NULLPTR_MARKER"); + return -EINVAL; +} + +static int put_nullptr(QEMUFile *f, void *pv, size_t size, + VMStateField *field, QJSON *vmdesc) + +{ + if (pv =3D=3D NULL) { + qemu_put_byte(f, VMS_NULLPTR_MARKER); + return 0; + } + error_report("vmstate: put_nullptr must be called with pv =3D=3D NULL"= ); + return -EINVAL; +} + +const VMStateInfo vmstate_info_nullptr =3D { + .name =3D "uint64", + .get =3D get_nullptr, + .put =3D put_nullptr, +}; + +/* 64 bit unsigned int. See that the received value is the same than the o= ne + in the field */ + +static int get_uint64_equal(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint64_t *v =3D pv; + uint64_t v2; + qemu_get_be64s(f, &v2); + + if (*v =3D=3D v2) { + return 0; + } + error_report("%" PRIx64 " !=3D %" PRIx64, *v, v2); + return -EINVAL; +} + +const VMStateInfo vmstate_info_uint64_equal =3D { + .name =3D "int64 equal", + .get =3D get_uint64_equal, + .put =3D put_uint64, +}; + +/* 8 bit int. See that the received value is the same than the one + in the field */ + +static int get_uint8_equal(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint8_t *v =3D pv; + uint8_t v2; + qemu_get_8s(f, &v2); + + if (*v =3D=3D v2) { + return 0; + } + error_report("%x !=3D %x", *v, v2); + return -EINVAL; +} + +const VMStateInfo vmstate_info_uint8_equal =3D { + .name =3D "uint8 equal", + .get =3D get_uint8_equal, + .put =3D put_uint8, +}; + +/* 16 bit unsigned int int. See that the received value is the same than t= he one + in the field */ + +static int get_uint16_equal(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint16_t *v =3D pv; + uint16_t v2; + qemu_get_be16s(f, &v2); + + if (*v =3D=3D v2) { + return 0; + } + error_report("%x !=3D %x", *v, v2); + return -EINVAL; +} + +const VMStateInfo vmstate_info_uint16_equal =3D { + .name =3D "uint16 equal", + .get =3D get_uint16_equal, + .put =3D put_uint16, +}; + +/* floating point */ + +static int get_float64(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + float64 *v =3D pv; + + *v =3D make_float64(qemu_get_be64(f)); + return 0; +} + +static int put_float64(QEMUFile *f, void *pv, size_t size, VMStateField *f= ield, + QJSON *vmdesc) +{ + uint64_t *v =3D pv; + + qemu_put_be64(f, float64_val(*v)); + return 0; +} + +const VMStateInfo vmstate_info_float64 =3D { + .name =3D "float64", + .get =3D get_float64, + .put =3D put_float64, +}; + +/* CPU_DoubleU type */ + +static int get_cpudouble(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + CPU_DoubleU *v =3D pv; + qemu_get_be32s(f, &v->l.upper); + qemu_get_be32s(f, &v->l.lower); + return 0; +} + +static int put_cpudouble(QEMUFile *f, void *pv, size_t size, + VMStateField *field, QJSON *vmdesc) +{ + CPU_DoubleU *v =3D pv; + qemu_put_be32s(f, &v->l.upper); + qemu_put_be32s(f, &v->l.lower); + return 0; +} + +const VMStateInfo vmstate_info_cpudouble =3D { + .name =3D "CPU_Double_U", + .get =3D get_cpudouble, + .put =3D put_cpudouble, +}; + +/* uint8_t buffers */ + +static int get_buffer(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint8_t *v =3D pv; + qemu_get_buffer(f, v, size); + return 0; +} + +static int put_buffer(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, + QJSON *vmdesc) +{ + uint8_t *v =3D pv; + qemu_put_buffer(f, v, size); + return 0; +} + +const VMStateInfo vmstate_info_buffer =3D { + .name =3D "buffer", + .get =3D get_buffer, + .put =3D put_buffer, +}; + +/* unused buffers: space that was used for some fields that are + not useful anymore */ + +static int get_unused_buffer(QEMUFile *f, void *pv, size_t size, + VMStateField *field) +{ + uint8_t buf[1024]; + int block_len; + + while (size > 0) { + block_len =3D MIN(sizeof(buf), size); + size -=3D block_len; + qemu_get_buffer(f, buf, block_len); + } + return 0; +} + +static int put_unused_buffer(QEMUFile *f, void *pv, size_t size, + VMStateField *field, QJSON *vmdesc) +{ + static const uint8_t buf[1024]; + int block_len; + + while (size > 0) { + block_len =3D MIN(sizeof(buf), size); + size -=3D block_len; + qemu_put_buffer(f, buf, block_len); + } + + return 0; +} + +const VMStateInfo vmstate_info_unused_buffer =3D { + .name =3D "unused_buffer", + .get =3D get_unused_buffer, + .put =3D put_unused_buffer, +}; + +/* vmstate_info_tmp, see VMSTATE_WITH_TMP, the idea is that we allocate + * a temporary buffer and the pre_load/pre_save methods in the child vmsd + * copy stuff from the parent into the child and do calculations to fill + * in fields that don't really exist in the parent but need to be in the + * stream. + */ +static int get_tmp(QEMUFile *f, void *pv, size_t size, VMStateField *field) +{ + int ret; + const VMStateDescription *vmsd =3D field->vmsd; + int version_id =3D field->version_id; + void *tmp =3D g_malloc(size); + + /* Writes the parent field which is at the start of the tmp */ + *(void **)tmp =3D pv; + ret =3D vmstate_load_state(f, vmsd, tmp, version_id); + g_free(tmp); + return ret; +} + +static int put_tmp(QEMUFile *f, void *pv, size_t size, VMStateField *field, + QJSON *vmdesc) +{ + const VMStateDescription *vmsd =3D field->vmsd; + void *tmp =3D g_malloc(size); + + /* Writes the parent field which is at the start of the tmp */ + *(void **)tmp =3D pv; + vmstate_save_state(f, vmsd, tmp, vmdesc); + g_free(tmp); + + return 0; +} + +const VMStateInfo vmstate_info_tmp =3D { + .name =3D "tmp", + .get =3D get_tmp, + .put =3D put_tmp, +}; + +/* bitmaps (as defined by bitmap.h). Note that size here is the size + * of the bitmap in bits. The on-the-wire format of a bitmap is 64 + * bit words with the bits in big endian order. The in-memory format + * is an array of 'unsigned long', which may be either 32 or 64 bits. + */ +/* This is the number of 64 bit words sent over the wire */ +#define BITS_TO_U64S(nr) DIV_ROUND_UP(nr, 64) +static int get_bitmap(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) +{ + unsigned long *bmp =3D pv; + int i, idx =3D 0; + for (i =3D 0; i < BITS_TO_U64S(size); i++) { + uint64_t w =3D qemu_get_be64(f); + bmp[idx++] =3D w; + if (sizeof(unsigned long) =3D=3D 4 && idx < BITS_TO_LONGS(size)) { + bmp[idx++] =3D w >> 32; + } + } + return 0; +} + +static int put_bitmap(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, + QJSON *vmdesc) +{ + unsigned long *bmp =3D pv; + int i, idx =3D 0; + for (i =3D 0; i < BITS_TO_U64S(size); i++) { + uint64_t w =3D bmp[idx++]; + if (sizeof(unsigned long) =3D=3D 4 && idx < BITS_TO_LONGS(size)) { + w |=3D ((uint64_t)bmp[idx++]) << 32; + } + qemu_put_be64(f, w); + } + + return 0; +} + +const VMStateInfo vmstate_info_bitmap =3D { + .name =3D "bitmap", + .get =3D get_bitmap, + .put =3D put_bitmap, +}; + +/* get for QTAILQ + * meta data about the QTAILQ is encoded in a VMStateField structure + */ +static int get_qtailq(QEMUFile *f, void *pv, size_t unused_size, + VMStateField *field) +{ + int ret =3D 0; + const VMStateDescription *vmsd =3D field->vmsd; + /* size of a QTAILQ element */ + size_t size =3D field->size; + /* offset of the QTAILQ entry in a QTAILQ element */ + size_t entry_offset =3D field->start; + int version_id =3D field->version_id; + void *elm; + + trace_get_qtailq(vmsd->name, version_id); + if (version_id > vmsd->version_id) { + error_report("%s %s", vmsd->name, "too new"); + trace_get_qtailq_end(vmsd->name, "too new", -EINVAL); + + return -EINVAL; + } + if (version_id < vmsd->minimum_version_id) { + error_report("%s %s", vmsd->name, "too old"); + trace_get_qtailq_end(vmsd->name, "too old", -EINVAL); + return -EINVAL; + } + + while (qemu_get_byte(f)) { + elm =3D g_malloc(size); + ret =3D vmstate_load_state(f, vmsd, elm, version_id); + if (ret) { + return ret; + } + QTAILQ_RAW_INSERT_TAIL(pv, elm, entry_offset); + } + + trace_get_qtailq_end(vmsd->name, "end", ret); + return ret; +} + +/* put for QTAILQ */ +static int put_qtailq(QEMUFile *f, void *pv, size_t unused_size, + VMStateField *field, QJSON *vmdesc) +{ + const VMStateDescription *vmsd =3D field->vmsd; + /* offset of the QTAILQ entry in a QTAILQ element*/ + size_t entry_offset =3D field->start; + void *elm; + + trace_put_qtailq(vmsd->name, vmsd->version_id); + + QTAILQ_RAW_FOREACH(elm, pv, entry_offset) { + qemu_put_byte(f, true); + vmstate_save_state(f, vmsd, elm, vmdesc); + } + qemu_put_byte(f, false); + + trace_put_qtailq_end(vmsd->name, "end"); + + return 0; +} +const VMStateInfo vmstate_info_qtailq =3D { + .name =3D "qtailq", + .get =3D get_qtailq, + .put =3D put_qtailq, +}; diff --git a/migration/vmstate.c b/migration/vmstate.c index 66c50ee..c284769 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -1,3 +1,30 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2009-2017 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. + */ + #include "qemu/osdep.h" #include "qemu-common.h" #include "migration/migration.h" @@ -5,7 +32,6 @@ #include "migration/vmstate.h" #include "qemu/bitops.h" #include "qemu/error-report.h" -#include "qemu/queue.h" #include "trace.h" #include "qjson.h" =20 @@ -475,644 +501,3 @@ static void vmstate_subsection_save(QEMUFile *f, cons= t VMStateDescription *vmsd, json_end_array(vmdesc); } } - -/* bool */ - -static int get_bool(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d) -{ - bool *v =3D pv; - *v =3D qemu_get_byte(f); - return 0; -} - -static int put_bool(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d, - QJSON *vmdesc) -{ - bool *v =3D pv; - qemu_put_byte(f, *v); - return 0; -} - -const VMStateInfo vmstate_info_bool =3D { - .name =3D "bool", - .get =3D get_bool, - .put =3D put_bool, -}; - -/* 8 bit int */ - -static int get_int8(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d) -{ - int8_t *v =3D pv; - qemu_get_s8s(f, v); - return 0; -} - -static int put_int8(QEMUFile *f, void *pv, size_t size, VMStateField *fiel= d, - QJSON *vmdesc) -{ - int8_t *v =3D pv; - qemu_put_s8s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_int8 =3D { - .name =3D "int8", - .get =3D get_int8, - .put =3D put_int8, -}; - -/* 16 bit int */ - -static int get_int16(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) -{ - int16_t *v =3D pv; - qemu_get_sbe16s(f, v); - return 0; -} - -static int put_int16(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, - QJSON *vmdesc) -{ - int16_t *v =3D pv; - qemu_put_sbe16s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_int16 =3D { - .name =3D "int16", - .get =3D get_int16, - .put =3D put_int16, -}; - -/* 32 bit int */ - -static int get_int32(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) -{ - int32_t *v =3D pv; - qemu_get_sbe32s(f, v); - return 0; -} - -static int put_int32(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, - QJSON *vmdesc) -{ - int32_t *v =3D pv; - qemu_put_sbe32s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_int32 =3D { - .name =3D "int32", - .get =3D get_int32, - .put =3D put_int32, -}; - -/* 32 bit int. See that the received value is the same than the one - in the field */ - -static int get_int32_equal(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - int32_t *v =3D pv; - int32_t v2; - qemu_get_sbe32s(f, &v2); - - if (*v =3D=3D v2) { - return 0; - } - error_report("%" PRIx32 " !=3D %" PRIx32, *v, v2); - return -EINVAL; -} - -const VMStateInfo vmstate_info_int32_equal =3D { - .name =3D "int32 equal", - .get =3D get_int32_equal, - .put =3D put_int32, -}; - -/* 32 bit int. Check that the received value is non-negative - * and less than or equal to the one in the field. - */ - -static int get_int32_le(QEMUFile *f, void *pv, size_t size, VMStateField *= field) -{ - int32_t *cur =3D pv; - int32_t loaded; - qemu_get_sbe32s(f, &loaded); - - if (loaded >=3D 0 && loaded <=3D *cur) { - *cur =3D loaded; - return 0; - } - error_report("Invalid value %" PRId32 - " expecting positive value <=3D %" PRId32, - loaded, *cur); - return -EINVAL; -} - -const VMStateInfo vmstate_info_int32_le =3D { - .name =3D "int32 le", - .get =3D get_int32_le, - .put =3D put_int32, -}; - -/* 64 bit int */ - -static int get_int64(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) -{ - int64_t *v =3D pv; - qemu_get_sbe64s(f, v); - return 0; -} - -static int put_int64(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, - QJSON *vmdesc) -{ - int64_t *v =3D pv; - qemu_put_sbe64s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_int64 =3D { - .name =3D "int64", - .get =3D get_int64, - .put =3D put_int64, -}; - -/* 8 bit unsigned int */ - -static int get_uint8(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld) -{ - uint8_t *v =3D pv; - qemu_get_8s(f, v); - return 0; -} - -static int put_uint8(QEMUFile *f, void *pv, size_t size, VMStateField *fie= ld, - QJSON *vmdesc) -{ - uint8_t *v =3D pv; - qemu_put_8s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_uint8 =3D { - .name =3D "uint8", - .get =3D get_uint8, - .put =3D put_uint8, -}; - -/* 16 bit unsigned int */ - -static int get_uint16(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) -{ - uint16_t *v =3D pv; - qemu_get_be16s(f, v); - return 0; -} - -static int put_uint16(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, - QJSON *vmdesc) -{ - uint16_t *v =3D pv; - qemu_put_be16s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_uint16 =3D { - .name =3D "uint16", - .get =3D get_uint16, - .put =3D put_uint16, -}; - -/* 32 bit unsigned int */ - -static int get_uint32(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) -{ - uint32_t *v =3D pv; - qemu_get_be32s(f, v); - return 0; -} - -static int put_uint32(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, - QJSON *vmdesc) -{ - uint32_t *v =3D pv; - qemu_put_be32s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_uint32 =3D { - .name =3D "uint32", - .get =3D get_uint32, - .put =3D put_uint32, -}; - -/* 32 bit uint. See that the received value is the same than the one - in the field */ - -static int get_uint32_equal(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint32_t *v =3D pv; - uint32_t v2; - qemu_get_be32s(f, &v2); - - if (*v =3D=3D v2) { - return 0; - } - error_report("%" PRIx32 " !=3D %" PRIx32, *v, v2); - return -EINVAL; -} - -const VMStateInfo vmstate_info_uint32_equal =3D { - .name =3D "uint32 equal", - .get =3D get_uint32_equal, - .put =3D put_uint32, -}; - -/* 64 bit unsigned int */ - -static int get_uint64(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) -{ - uint64_t *v =3D pv; - qemu_get_be64s(f, v); - return 0; -} - -static int put_uint64(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, - QJSON *vmdesc) -{ - uint64_t *v =3D pv; - qemu_put_be64s(f, v); - return 0; -} - -const VMStateInfo vmstate_info_uint64 =3D { - .name =3D "uint64", - .get =3D get_uint64, - .put =3D put_uint64, -}; - -static int get_nullptr(QEMUFile *f, void *pv, size_t size, VMStateField *f= ield) - -{ - if (qemu_get_byte(f) =3D=3D VMS_NULLPTR_MARKER) { - return 0; - } - error_report("vmstate: get_nullptr expected VMS_NULLPTR_MARKER"); - return -EINVAL; -} - -static int put_nullptr(QEMUFile *f, void *pv, size_t size, - VMStateField *field, QJSON *vmdesc) - -{ - if (pv =3D=3D NULL) { - qemu_put_byte(f, VMS_NULLPTR_MARKER); - return 0; - } - error_report("vmstate: put_nullptr must be called with pv =3D=3D NULL"= ); - return -EINVAL; -} - -const VMStateInfo vmstate_info_nullptr =3D { - .name =3D "uint64", - .get =3D get_nullptr, - .put =3D put_nullptr, -}; - -/* 64 bit unsigned int. See that the received value is the same than the o= ne - in the field */ - -static int get_uint64_equal(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint64_t *v =3D pv; - uint64_t v2; - qemu_get_be64s(f, &v2); - - if (*v =3D=3D v2) { - return 0; - } - error_report("%" PRIx64 " !=3D %" PRIx64, *v, v2); - return -EINVAL; -} - -const VMStateInfo vmstate_info_uint64_equal =3D { - .name =3D "int64 equal", - .get =3D get_uint64_equal, - .put =3D put_uint64, -}; - -/* 8 bit int. See that the received value is the same than the one - in the field */ - -static int get_uint8_equal(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint8_t *v =3D pv; - uint8_t v2; - qemu_get_8s(f, &v2); - - if (*v =3D=3D v2) { - return 0; - } - error_report("%x !=3D %x", *v, v2); - return -EINVAL; -} - -const VMStateInfo vmstate_info_uint8_equal =3D { - .name =3D "uint8 equal", - .get =3D get_uint8_equal, - .put =3D put_uint8, -}; - -/* 16 bit unsigned int int. See that the received value is the same than t= he one - in the field */ - -static int get_uint16_equal(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint16_t *v =3D pv; - uint16_t v2; - qemu_get_be16s(f, &v2); - - if (*v =3D=3D v2) { - return 0; - } - error_report("%x !=3D %x", *v, v2); - return -EINVAL; -} - -const VMStateInfo vmstate_info_uint16_equal =3D { - .name =3D "uint16 equal", - .get =3D get_uint16_equal, - .put =3D put_uint16, -}; - -/* floating point */ - -static int get_float64(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - float64 *v =3D pv; - - *v =3D make_float64(qemu_get_be64(f)); - return 0; -} - -static int put_float64(QEMUFile *f, void *pv, size_t size, VMStateField *f= ield, - QJSON *vmdesc) -{ - uint64_t *v =3D pv; - - qemu_put_be64(f, float64_val(*v)); - return 0; -} - -const VMStateInfo vmstate_info_float64 =3D { - .name =3D "float64", - .get =3D get_float64, - .put =3D put_float64, -}; - -/* CPU_DoubleU type */ - -static int get_cpudouble(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - CPU_DoubleU *v =3D pv; - qemu_get_be32s(f, &v->l.upper); - qemu_get_be32s(f, &v->l.lower); - return 0; -} - -static int put_cpudouble(QEMUFile *f, void *pv, size_t size, - VMStateField *field, QJSON *vmdesc) -{ - CPU_DoubleU *v =3D pv; - qemu_put_be32s(f, &v->l.upper); - qemu_put_be32s(f, &v->l.lower); - return 0; -} - -const VMStateInfo vmstate_info_cpudouble =3D { - .name =3D "CPU_Double_U", - .get =3D get_cpudouble, - .put =3D put_cpudouble, -}; - -/* uint8_t buffers */ - -static int get_buffer(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint8_t *v =3D pv; - qemu_get_buffer(f, v, size); - return 0; -} - -static int put_buffer(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, - QJSON *vmdesc) -{ - uint8_t *v =3D pv; - qemu_put_buffer(f, v, size); - return 0; -} - -const VMStateInfo vmstate_info_buffer =3D { - .name =3D "buffer", - .get =3D get_buffer, - .put =3D put_buffer, -}; - -/* unused buffers: space that was used for some fields that are - not useful anymore */ - -static int get_unused_buffer(QEMUFile *f, void *pv, size_t size, - VMStateField *field) -{ - uint8_t buf[1024]; - int block_len; - - while (size > 0) { - block_len =3D MIN(sizeof(buf), size); - size -=3D block_len; - qemu_get_buffer(f, buf, block_len); - } - return 0; -} - -static int put_unused_buffer(QEMUFile *f, void *pv, size_t size, - VMStateField *field, QJSON *vmdesc) -{ - static const uint8_t buf[1024]; - int block_len; - - while (size > 0) { - block_len =3D MIN(sizeof(buf), size); - size -=3D block_len; - qemu_put_buffer(f, buf, block_len); - } - - return 0; -} - -const VMStateInfo vmstate_info_unused_buffer =3D { - .name =3D "unused_buffer", - .get =3D get_unused_buffer, - .put =3D put_unused_buffer, -}; - -/* vmstate_info_tmp, see VMSTATE_WITH_TMP, the idea is that we allocate - * a temporary buffer and the pre_load/pre_save methods in the child vmsd - * copy stuff from the parent into the child and do calculations to fill - * in fields that don't really exist in the parent but need to be in the - * stream. - */ -static int get_tmp(QEMUFile *f, void *pv, size_t size, VMStateField *field) -{ - int ret; - const VMStateDescription *vmsd =3D field->vmsd; - int version_id =3D field->version_id; - void *tmp =3D g_malloc(size); - - /* Writes the parent field which is at the start of the tmp */ - *(void **)tmp =3D pv; - ret =3D vmstate_load_state(f, vmsd, tmp, version_id); - g_free(tmp); - return ret; -} - -static int put_tmp(QEMUFile *f, void *pv, size_t size, VMStateField *field, - QJSON *vmdesc) -{ - const VMStateDescription *vmsd =3D field->vmsd; - void *tmp =3D g_malloc(size); - - /* Writes the parent field which is at the start of the tmp */ - *(void **)tmp =3D pv; - vmstate_save_state(f, vmsd, tmp, vmdesc); - g_free(tmp); - - return 0; -} - -const VMStateInfo vmstate_info_tmp =3D { - .name =3D "tmp", - .get =3D get_tmp, - .put =3D put_tmp, -}; - -/* bitmaps (as defined by bitmap.h). Note that size here is the size - * of the bitmap in bits. The on-the-wire format of a bitmap is 64 - * bit words with the bits in big endian order. The in-memory format - * is an array of 'unsigned long', which may be either 32 or 64 bits. - */ -/* This is the number of 64 bit words sent over the wire */ -#define BITS_TO_U64S(nr) DIV_ROUND_UP(nr, 64) -static int get_bitmap(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld) -{ - unsigned long *bmp =3D pv; - int i, idx =3D 0; - for (i =3D 0; i < BITS_TO_U64S(size); i++) { - uint64_t w =3D qemu_get_be64(f); - bmp[idx++] =3D w; - if (sizeof(unsigned long) =3D=3D 4 && idx < BITS_TO_LONGS(size)) { - bmp[idx++] =3D w >> 32; - } - } - return 0; -} - -static int put_bitmap(QEMUFile *f, void *pv, size_t size, VMStateField *fi= eld, - QJSON *vmdesc) -{ - unsigned long *bmp =3D pv; - int i, idx =3D 0; - for (i =3D 0; i < BITS_TO_U64S(size); i++) { - uint64_t w =3D bmp[idx++]; - if (sizeof(unsigned long) =3D=3D 4 && idx < BITS_TO_LONGS(size)) { - w |=3D ((uint64_t)bmp[idx++]) << 32; - } - qemu_put_be64(f, w); - } - - return 0; -} - -const VMStateInfo vmstate_info_bitmap =3D { - .name =3D "bitmap", - .get =3D get_bitmap, - .put =3D put_bitmap, -}; - -/* get for QTAILQ - * meta data about the QTAILQ is encoded in a VMStateField structure - */ -static int get_qtailq(QEMUFile *f, void *pv, size_t unused_size, - VMStateField *field) -{ - int ret =3D 0; - const VMStateDescription *vmsd =3D field->vmsd; - /* size of a QTAILQ element */ - size_t size =3D field->size; - /* offset of the QTAILQ entry in a QTAILQ element */ - size_t entry_offset =3D field->start; - int version_id =3D field->version_id; - void *elm; - - trace_get_qtailq(vmsd->name, version_id); - if (version_id > vmsd->version_id) { - error_report("%s %s", vmsd->name, "too new"); - trace_get_qtailq_end(vmsd->name, "too new", -EINVAL); - - return -EINVAL; - } - if (version_id < vmsd->minimum_version_id) { - error_report("%s %s", vmsd->name, "too old"); - trace_get_qtailq_end(vmsd->name, "too old", -EINVAL); - return -EINVAL; - } - - while (qemu_get_byte(f)) { - elm =3D g_malloc(size); - ret =3D vmstate_load_state(f, vmsd, elm, version_id); - if (ret) { - return ret; - } - QTAILQ_RAW_INSERT_TAIL(pv, elm, entry_offset); - } - - trace_get_qtailq_end(vmsd->name, "end", ret); - return ret; -} - -/* put for QTAILQ */ -static int put_qtailq(QEMUFile *f, void *pv, size_t unused_size, - VMStateField *field, QJSON *vmdesc) -{ - const VMStateDescription *vmsd =3D field->vmsd; - /* offset of the QTAILQ entry in a QTAILQ element*/ - size_t entry_offset =3D field->start; - void *elm; - - trace_put_qtailq(vmsd->name, vmsd->version_id); - - QTAILQ_RAW_FOREACH(elm, pv, entry_offset) { - qemu_put_byte(f, true); - vmstate_save_state(f, vmsd, elm, vmdesc); - } - qemu_put_byte(f, false); - - trace_put_qtailq_end(vmsd->name, "end"); - - return 0; -} -const VMStateInfo vmstate_info_qtailq =3D { - .name =3D "qtailq", - .get =3D get_qtailq, - .put =3D put_qtailq, -}; diff --git a/tests/Makefile.include b/tests/Makefile.include index 0f98c04..7eaf586 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -569,7 +569,7 @@ tests/test-qdev-global-props$(EXESUF): tests/test-qdev-= global-props.o \ hw/core/reset.o \ $(test-qapi-obj-y) tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ - migration/vmstate.o migration/qemu-file.o \ + migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \ migration/qemu-file-channel.o migration/qjson.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-= obj-y) --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158379788920.5642239288751; Tue, 25 Apr 2017 15:12:59 -0700 (PDT) Received: from localhost ([::1]:51569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38he-00051u-D5 for importer@patchew.org; Tue, 25 Apr 2017 18:12:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aH-00075c-Qt for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aG-0005BG-Lx for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aG-00059w-Ca for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F4173DBC6 for ; Tue, 25 Apr 2017 22:05:19 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id F20241714C; Tue, 25 Apr 2017 22:05:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5F4173DBC6 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 5F4173DBC6 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:22 +0200 Message-Id: <20170425220451.6028-13-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:05:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 12/41] migration: Remove qemu-file.h from vmstate.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 -- minor rearangements due to the rebase Signed-off-by: Juan Quintela --- include/hw/hw.h | 1 + include/migration/vmstate.h | 3 --- migration/block.c | 1 + migration/colo.c | 1 + migration/postcopy-ram.c | 1 + migration/ram.c | 1 + tests/test-vmstate.c | 1 + 7 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/hw/hw.h b/include/hw/hw.h index e22d4ce..af9eae1 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -11,6 +11,7 @@ #include "exec/memory.h" #include "hw/irq.h" #include "migration/vmstate.h" +#include "migration/qemu-file.h" #include "qemu/module.h" #include "sysemu/reset.h" =20 diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 4396d7e..e9f5bc8 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -27,9 +27,6 @@ #ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H =20 -#ifndef CONFIG_USER_ONLY -#include "migration/qemu-file.h" -#endif #include "migration/qjson.h" =20 typedef void SaveStateHandler(QEMUFile *f, void *opaque); diff --git a/migration/block.c b/migration/block.c index fcfa823..d2923b3 100644 --- a/migration/block.c +++ b/migration/block.c @@ -26,6 +26,7 @@ #include "migration/block.h" #include "migration/migration.h" #include "sysemu/blockdev.h" +#include "migration/qemu-file.h" #include "sysemu/block-backend.h" =20 #define BLOCK_SIZE (1 << 20) diff --git a/migration/colo.c b/migration/colo.c index 31ab23f..94cdb89 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -15,6 +15,7 @@ #include "sysemu/sysemu.h" #include "qemu-file-channel.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index cdadaf6..019e031 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -20,6 +20,7 @@ =20 #include "qemu-common.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" diff --git a/migration/ram.c b/migration/ram.c index 5fcf593..8e1c136 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -37,6 +37,7 @@ #include "qemu/main-loop.h" #include "xbzrle.h" #include "migration/migration.h" +#include "migration/qemu-file.h" #include "postcopy-ram.h" #include "exec/address-spaces.h" #include "migration/page_cache.h" diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 1c13570..25389bc 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -27,6 +27,7 @@ #include "qemu-common.h" #include "migration/migration.h" #include "migration/vmstate.h" +#include "migration/qemu-file.h" #include "../migration/qemu-file-channel.h" #include "qemu/coroutine.h" #include "io/channel-file.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158772876466.0879934207618; Tue, 25 Apr 2017 15:19:32 -0700 (PDT) Received: from localhost ([::1]:51597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38nz-00022y-7w for importer@patchew.org; Tue, 25 Apr 2017 18:19:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aJ-00077E-9I for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aI-0005Ci-9p for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34872) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aI-0005C3-3s for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23FC7C03BD55 for ; Tue, 25 Apr 2017 22:05:21 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id B19731714C; Tue, 25 Apr 2017 22:05:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 23FC7C03BD55 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 23FC7C03BD55 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:23 +0200 Message-Id: <20170425220451.6028-14-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 25 Apr 2017 22:05:21 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 13/41] migration: Remove vmstate.h from migration.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 -- Minor rearrangements due to rebase Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/migration/migration.h | 1 - migration/block.c | 1 + migration/colo-comm.c | 1 + migration/migration.c | 1 + migration/ram.c | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index d465624..22578db 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 "migration/vmstate.h" #include "io/channel.h" #include "qapi-types.h" #include "exec/cpu-common.h" diff --git a/migration/block.c b/migration/block.c index d2923b3..c919787 100644 --- a/migration/block.c +++ b/migration/block.c @@ -27,6 +27,7 @@ #include "migration/migration.h" #include "sysemu/blockdev.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "sysemu/block-backend.h" =20 #define BLOCK_SIZE (1 << 20) diff --git a/migration/colo-comm.c b/migration/colo-comm.c index 9b35027..b4288b8 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "migration/migration.h" +#include "migration/vmstate.h" #include "colo.h" #include "trace.h" =20 diff --git a/migration/migration.c b/migration/migration.c index fef1f0a..4668236 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -21,6 +21,7 @@ #include "migration/migration.h" #include "qemu-file-channel.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "sysemu/sysemu.h" #include "block/block.h" #include "qapi/qmp/qerror.h" diff --git a/migration/ram.c b/migration/ram.c index 8e1c136..c431ef9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -38,6 +38,7 @@ #include "xbzrle.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/vmstate.h" #include "postcopy-ram.h" #include "exec/address-spaces.h" #include "migration/page_cache.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158467419719.0886186366628; Tue, 25 Apr 2017 15:14:27 -0700 (PDT) Received: from localhost ([::1]:51575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38j4-0006K8-61 for importer@patchew.org; Tue, 25 Apr 2017 18:14:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aL-00078p-32 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aK-0005ET-3K for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43108) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aJ-0005Dh-T7 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E268E80481 for ; Tue, 25 Apr 2017 22:05:22 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77E361756A; Tue, 25 Apr 2017 22:05:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E268E80481 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E268E80481 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:24 +0200 Message-Id: <20170425220451.6028-15-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Apr 2017 22:05:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 14/41] migration: migration.h was not needed 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" This files don't use any function from migration.h, so drop it. Signed-off-by: Juan Quintela --- block/qed.c | 1 - hw/i386/pc_q35.c | 1 - hw/virtio/vhost-user.c | 1 - hw/virtio/vhost-vsock.c | 1 - hw/virtio/virtio.c | 1 - monitor.c | 1 - 6 files changed, 6 deletions(-) diff --git a/block/qed.c b/block/qed.c index 5ec7fd8..0d2f3bf 100644 --- a/block/qed.c +++ b/block/qed.c @@ -19,7 +19,6 @@ #include "trace.h" #include "qed.h" #include "qapi/qmp/qerror.h" -#include "migration/migration.h" #include "sysemu/block-backend.h" =20 static const AIOCBInfo qed_aiocb_info =3D { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index dd792a8..76b08f8 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -46,7 +46,6 @@ #include "hw/ide/ahci.h" #include "hw/usb.h" #include "qemu/error-report.h" -#include "migration/migration.h" =20 /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 9334a8a..ebc8ccf 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -17,7 +17,6 @@ #include "sysemu/kvm.h" #include "qemu/error-report.h" #include "qemu/sockets.h" -#include "migration/migration.h" =20 #include #include diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index b481562..49e0022 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -17,7 +17,6 @@ #include "qapi/error.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" -#include "migration/migration.h" #include "qemu/error-report.h" #include "hw/virtio/vhost-vsock.h" #include "qemu/iov.h" diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 03592c5..2d2b6bf 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -21,7 +21,6 @@ #include "hw/virtio/virtio.h" #include "qemu/atomic.h" #include "hw/virtio/virtio-bus.h" -#include "migration/migration.h" #include "hw/virtio/virtio-access.h" #include "sysemu/dma.h" =20 diff --git a/monitor.c b/monitor.c index d02900d..ec5ad1f 100644 --- a/monitor.c +++ b/monitor.c @@ -49,7 +49,6 @@ #include "disas/disas.h" #include "sysemu/balloon.h" #include "qemu/timer.h" -#include "migration/migration.h" #include "sysemu/hw_accel.h" #include "qemu/acl.h" #include "sysemu/tpm.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158326503552.3543857506246; Tue, 25 Apr 2017 15:12:06 -0700 (PDT) Received: from localhost ([::1]:51568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38gn-00047z-1T for importer@patchew.org; Tue, 25 Apr 2017 18:12:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aM-0007Ak-SS for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aL-0005Ff-T0 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36286) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aL-0005Ey-JL for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 906408004A for ; Tue, 25 Apr 2017 22:05:24 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E5211714D; Tue, 25 Apr 2017 22:05:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 906408004A 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 906408004A From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:25 +0200 Message-Id: <20170425220451.6028-16-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 22:05:24 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 15/41] 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 --- hmp.c | 1 + include/migration/snapshot.h | 20 ++++++++++++++++++++ include/sysemu/sysemu.h | 3 --- migration/savevm.c | 1 + replay/replay-snapshot.c | 1 + vl.c | 1 + 6 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 include/migration/snapshot.h diff --git a/hmp.c b/hmp.c index d81f71e..235cc2a 100644 --- a/hmp.c +++ b/hmp.c @@ -39,6 +39,7 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "hw/intc/intc.h" +#include "migration/snapshot.h" =20 #ifdef CONFIG_SPICE #include diff --git a/include/migration/snapshot.h b/include/migration/snapshot.h new file mode 100644 index 0000000..a390fea --- /dev/null +++ b/include/migration/snapshot.h @@ -0,0 +1,20 @@ +/* + * QEMU save vm functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_SAVEVM_H +#define QEMU_MIGRATION_SAVEVM_H + +int save_vmstate(const char *name, Error **errp); +int load_vmstate(const char *name, Error **errp); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 3340202..0d496d3 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -75,9 +75,6 @@ void qemu_remove_exit_notifier(Notifier *notify); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 -int save_vmstate(const char *name, Error **errp); -int load_vmstate(const char *name, Error **errp); - void qemu_announce_self(void); =20 /* Subcommands for QEMU_VM_COMMAND */ diff --git a/migration/savevm.c b/migration/savevm.c index 1b2a83c..2f76a8a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -36,6 +36,7 @@ #include "sysemu/sysemu.h" #include "qemu/timer.h" #include "migration/migration.h" +#include "migration/snapshot.h" #include "qemu-file-channel.h" #include "postcopy-ram.h" #include "qapi/qmp/qerror.h" diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index fdc4353..86ae8dd 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) { diff --git a/vl.c b/vl.c index 8b3ec2e..53a9d19 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 "audio/audio.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158179830246.1952789819146; Tue, 25 Apr 2017 15:09:39 -0700 (PDT) Received: from localhost ([::1]:51554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38eQ-00022W-Hs for importer@patchew.org; Tue, 25 Apr 2017 18:09:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aR-0007Dd-1b for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aN-0005Gn-IY for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44386) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aN-0005GC-A5 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DCE8C0567A2 for ; Tue, 25 Apr 2017 22:05:26 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0E131714C; Tue, 25 Apr 2017 22:05:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DCE8C0567A2 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 4DCE8C0567A2 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:26 +0200 Message-Id: <20170425220451.6028-17-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 25 Apr 2017 22:05:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 16/41] migration: Rename {save, load}_vmstate to {save, load}_snapshot 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" It reflects what they do. And make it easier to not confuse with vmstate_{save,load}_state. Signed-off-by: Juan Quintela --- hmp.c | 4 ++-- include/block/block_int.h | 4 ++-- include/migration/snapshot.h | 4 ++-- migration/savevm.c | 4 ++-- replay/replay-snapshot.c | 4 ++-- vl.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hmp.c b/hmp.c index 235cc2a..73f97bb 100644 --- a/hmp.c +++ b/hmp.c @@ -1278,7 +1278,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); @@ -1288,7 +1288,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 4f8cd29..fa74559 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -587,8 +587,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 index a390fea..f04bd79 100644 --- a/include/migration/snapshot.h +++ b/include/migration/snapshot.h @@ -14,7 +14,7 @@ #ifndef QEMU_MIGRATION_SAVEVM_H #define QEMU_MIGRATION_SAVEVM_H =20 -int save_vmstate(const char *name, Error **errp); -int load_vmstate(const char *name, Error **errp); +int save_snapshot(const char *name, Error **errp); +int load_snapshot(const char *name, Error **errp); =20 #endif diff --git a/migration/savevm.c b/migration/savevm.c index 2f76a8a..a6bc1f9 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2056,7 +2056,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; @@ -2213,7 +2213,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 86ae8dd..0522cd2 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -67,12 +67,12 @@ 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("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("Could not load snapshot for icount replay"); exit(1); } diff --git a/vl.c b/vl.c index 53a9d19..5b79f5b 100644 --- a/vl.c +++ b/vl.c @@ -4683,7 +4683,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.3 From nobody Tue May 7 18:24:26 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 1493158695804926.0828717892826; Tue, 25 Apr 2017 15:18:15 -0700 (PDT) Received: from localhost ([::1]:51593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38mj-00011a-Bn for importer@patchew.org; Tue, 25 Apr 2017 18:18:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aS-0007Dw-QO for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aR-0005KP-AQ for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aR-0005JN-1C for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 154BA81F07 for ; Tue, 25 Apr 2017 22:05:30 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B1091714C; Tue, 25 Apr 2017 22:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 154BA81F07 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 154BA81F07 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:27 +0200 Message-Id: <20170425220451.6028-18-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Apr 2017 22:05:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 17/41] migration: Create savevm.h for functions exported from savevm.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" This removes last trace of migration functions from sysemu/sysemu.h. Signed-off-by: Juan Quintela --- include/sysemu/sysemu.h | 47 --------------------------------------------= --- migration/colo.c | 1 + migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/savevm.c | 29 +++++++++++++++++++++++++---- migration/savevm.h | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 69 insertions(+), 51 deletions(-) create mode 100644 migration/savevm.h diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 0d496d3..503b51f 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -77,53 +77,6 @@ void qemu_remove_machine_init_done_notifier(Notifier *no= tify); =20 void qemu_announce_self(void); =20 -/* Subcommands for QEMU_VM_COMMAND */ -enum qemu_vm_cmd { - MIG_CMD_INVALID =3D 0, /* Must be 0 */ - MIG_CMD_OPEN_RETURN_PATH, /* Tell the dest to open the Return path */ - MIG_CMD_PING, /* Request a PONG on the RP */ - - MIG_CMD_POSTCOPY_ADVISE, /* Prior to any page transfers, just - warn we might want to do PC */ - MIG_CMD_POSTCOPY_LISTEN, /* Start listening for incoming - pages as it's running. */ - MIG_CMD_POSTCOPY_RUN, /* Start execution */ - - MIG_CMD_POSTCOPY_RAM_DISCARD, /* A list of pages to discard that - were previously sent during - precopy but are dirty. */ - MIG_CMD_PACKAGED, /* Send a wrapped stream within this stream= */ - MIG_CMD_MAX -}; - -#define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) - -bool qemu_savevm_state_blocked(Error **errp); -void qemu_savevm_state_begin(QEMUFile *f); -void qemu_savevm_state_header(QEMUFile *f); -int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); -void qemu_savevm_state_cleanup(void); -void qemu_savevm_state_complete_postcopy(QEMUFile *f); -void qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only); -void qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size, - uint64_t *res_non_postcopiable, - uint64_t *res_postcopiable); -void qemu_savevm_command_send(QEMUFile *f, enum qemu_vm_cmd command, - uint16_t len, uint8_t *data); -void qemu_savevm_send_ping(QEMUFile *f, uint32_t value); -void qemu_savevm_send_open_return_path(QEMUFile *f); -int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len); -void qemu_savevm_send_postcopy_advise(QEMUFile *f); -void qemu_savevm_send_postcopy_listen(QEMUFile *f); -void qemu_savevm_send_postcopy_run(QEMUFile *f); - -void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name, - uint16_t len, - uint64_t *start_list, - uint64_t *length_list); - -int qemu_loadvm_state(QEMUFile *f); - extern int autostart; =20 typedef enum { diff --git a/migration/colo.c b/migration/colo.c index 94cdb89..ff268bd 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -16,6 +16,7 @@ #include "qemu-file-channel.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "migration/savevm.h" #include "migration/colo.h" #include "io/channel-buffer.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index 4668236..367b039 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -19,6 +19,7 @@ #include "qemu/main-loop.h" #include "migration/blocker.h" #include "migration/migration.h" +#include "savevm.h" #include "qemu-file-channel.h" #include "migration/qemu-file.h" #include "migration/vmstate.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 019e031..0b02755 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -21,6 +21,7 @@ #include "qemu-common.h" #include "migration/migration.h" #include "migration/qemu-file.h" +#include "savevm.h" #include "postcopy-ram.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" diff --git a/migration/savevm.c b/migration/savevm.c index a6bc1f9..483eda1 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -38,6 +38,7 @@ #include "migration/migration.h" #include "migration/snapshot.h" #include "qemu-file-channel.h" +#include "savevm.h" #include "postcopy-ram.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" @@ -64,6 +65,26 @@ const unsigned int postcopy_ram_discard_version =3D 0; =20 static bool skip_section_footers; =20 +/* Subcommands for QEMU_VM_COMMAND */ +enum qemu_vm_cmd { + MIG_CMD_INVALID =3D 0, /* Must be 0 */ + MIG_CMD_OPEN_RETURN_PATH, /* Tell the dest to open the Return path */ + MIG_CMD_PING, /* Request a PONG on the RP */ + + MIG_CMD_POSTCOPY_ADVISE, /* Prior to any page transfers, just + warn we might want to do PC */ + MIG_CMD_POSTCOPY_LISTEN, /* Start listening for incoming + pages as it's running. */ + MIG_CMD_POSTCOPY_RUN, /* Start execution */ + + MIG_CMD_POSTCOPY_RAM_DISCARD, /* A list of pages to discard that + were previously sent during + precopy but are dirty. */ + MIG_CMD_PACKAGED, /* Send a wrapped stream within this stream= */ + MIG_CMD_MAX +}; + +#define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) static struct mig_cmd_args { ssize_t len; /* -1 =3D variable */ const char *name; @@ -807,10 +828,10 @@ static void save_section_footer(QEMUFile *f, SaveStat= eEntry *se) * @len: Length of associated data * @data: Data associated with command. */ -void qemu_savevm_command_send(QEMUFile *f, - enum qemu_vm_cmd command, - uint16_t len, - uint8_t *data) +static void qemu_savevm_command_send(QEMUFile *f, + enum qemu_vm_cmd command, + uint16_t len, + uint8_t *data) { trace_savevm_command_send(command, len); qemu_put_byte(f, QEMU_VM_COMMAND); diff --git a/migration/savevm.h b/migration/savevm.h new file mode 100644 index 0000000..f4c4bc9 --- /dev/null +++ b/migration/savevm.h @@ -0,0 +1,41 @@ +/* + * QEMU save vm 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_SAVEVM_H +#define MIGRATION_SAVEVM_H + +bool qemu_savevm_state_blocked(Error **errp); +void qemu_savevm_state_begin(QEMUFile *f); +void qemu_savevm_state_header(QEMUFile *f); +int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); +void qemu_savevm_state_cleanup(void); +void qemu_savevm_state_complete_postcopy(QEMUFile *f); +void qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only); +void qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size, + uint64_t *res_non_postcopiable, + uint64_t *res_postcopiable); +void qemu_savevm_send_ping(QEMUFile *f, uint32_t value); +void qemu_savevm_send_open_return_path(QEMUFile *f); +int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len); +void qemu_savevm_send_postcopy_advise(QEMUFile *f); +void qemu_savevm_send_postcopy_listen(QEMUFile *f); +void qemu_savevm_send_postcopy_run(QEMUFile *f); + +void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name, + uint16_t len, + uint64_t *start_list, + uint64_t *length_list); + +int qemu_loadvm_state(QEMUFile *f); + +#endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158929790196.9350982909649; Tue, 25 Apr 2017 15:22:09 -0700 (PDT) Received: from localhost ([::1]:51612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38qW-0004Ab-9r for importer@patchew.org; Tue, 25 Apr 2017 18:22:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aV-0007G4-DW for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aT-0005Ma-1W for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aS-0005Ky-Nz for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8535C05AD71 for ; Tue, 25 Apr 2017 22:05:31 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 694231756E; Tue, 25 Apr 2017 22:05:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B8535C05AD71 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 B8535C05AD71 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:28 +0200 Message-Id: <20170425220451.6028-19-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 25 Apr 2017 22:05:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 18/41] 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 --- 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..5a82c5d --- /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 c919787..c26bdb2 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 ff268bd..3757ad9 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 "migration/savevm.h" #include "migration/colo.h" #include "io/channel-buffer.h" diff --git a/migration/migration.c b/migration/migration.c index 367b039..f300b5e 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 0b02755..07fbc25 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -20,7 +20,7 @@ =20 #include "qemu-common.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 c431ef9..36afa98 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 fffe2d6..2fda7a5 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 483eda1..d3e4d8e 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -38,6 +38,7 @@ #include "migration/migration.h" #include "migration/snapshot.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 a49cf44..6ee69ed 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 0cf14d4..c2bd334 100644 --- a/migration/vmstate-types.c +++ b/migration/vmstate-types.c @@ -27,8 +27,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 c284769..57dc34f 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -28,8 +28,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.3 From nobody Tue May 7 18:24:26 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 1493158618142563.7929491503503; Tue, 25 Apr 2017 15:16:58 -0700 (PDT) Received: from localhost ([::1]:51589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38lU-0008Pj-Lz for importer@patchew.org; Tue, 25 Apr 2017 18:16:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aV-0007G5-S3 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aU-0005P9-M2 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aU-0005O0-Ct for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 652AAC008607 for ; Tue, 25 Apr 2017 22:05:33 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14E331714D; Tue, 25 Apr 2017 22:05:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 652AAC008607 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 652AAC008607 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:29 +0200 Message-Id: <20170425220451.6028-20-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 25 Apr 2017 22:05: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] [PATCH 19/41] 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/qdev.c | 1 - include/hw/acpi/memory_hotplug.h | 1 - include/hw/acpi/pcihp.h | 1 - include/hw/pci/shpc.h | 1 - include/net/net.h | 1 - target/alpha/cpu.c | 1 - target/hppa/cpu.c | 1 - target/s390x/cpu.c | 1 - target/tilegx/cpu.c | 1 - 9 files changed, 9 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 17ff638..23ccf9f 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/include/net/net.h b/include/net/net.h index 99b28d5..ba663bd 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -6,7 +6,6 @@ #include "qapi/qmp/qdict.h" #include "qemu/option.h" #include "net/queue.h" -#include "migration/vmstate.h" #include "qapi-types.h" =20 #define MAC_FMT "%02X:%02X:%02X:%02X:%02X:%02X" 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 066dcd1..cfd3b70 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.3 From nobody Tue May 7 18:24:26 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 1493158474985531.2113850995016; Tue, 25 Apr 2017 15:14:34 -0700 (PDT) Received: from localhost ([::1]:51576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38jB-0006R7-LB for importer@patchew.org; Tue, 25 Apr 2017 18:14:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aa-0007JV-Dd for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aW-0005RU-BR for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44642) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aW-0005QH-4y for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31AD170AAD for ; Tue, 25 Apr 2017 22:05:35 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3FAC1714D; Tue, 25 Apr 2017 22:05:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31AD170AAD Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 31AD170AAD From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:30 +0200 Message-Id: <20170425220451.6028-21-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Apr 2017 22:05: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] [PATCH 20/41] 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 --- include/migration/migration.h | 4 ---- migration/exec.c | 1 + migration/exec.h | 20 ++++++++++++++++++++ migration/migration.c | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 migration/exec.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 22578db..3786f05 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -190,10 +190,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 405d0ab..c532c56 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..c97a7e9 --- /dev/null +++ b/migration/exec.h @@ -0,0 +1,20 @@ +/* + * QEMU live migration exec functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_EXEC_H +#define QEMU_MIGRATION_EXEC_H +void exec_start_incoming_migration(const char *host_port, Error **errp); + +void exec_start_outgoing_migration(MigrationState *s, const char *host_por= t, + Error **errp); +#endif diff --git a/migration/migration.c b/migration/migration.c index f300b5e..994f25f 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.3 From nobody Tue May 7 18:24:26 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 1493159139792875.8491170506006; Tue, 25 Apr 2017 15:25:39 -0700 (PDT) Received: from localhost ([::1]:51630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38tu-0007h0-Ek for importer@patchew.org; Tue, 25 Apr 2017 18:25:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aa-0007JZ-Dq for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aY-0005TJ-6b for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44710) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aX-0005SX-WC for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:38 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02E2767ECB for ; Tue, 25 Apr 2017 22:05:37 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80CF21714C; Tue, 25 Apr 2017 22:05:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 02E2767ECB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 02E2767ECB From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:31 +0200 Message-Id: <20170425220451.6028-22-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Apr 2017 22:05: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] [PATCH 21/41] 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 --- include/migration/migration.h | 4 ---- migration/fd.c | 1 + migration/fd.h | 20 ++++++++++++++++++++ migration/migration.c | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 migration/fd.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 3786f05..fd7d40d 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -198,10 +198,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 ccaa806..8a04dcd 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..4ec3298 --- /dev/null +++ b/migration/fd.h @@ -0,0 +1,20 @@ +/* + * QEMU live migration fd functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_FD_H +#define QEMU_MIGRATION_FD_H +void fd_start_incoming_migration(const char *path, Error **errp); + +void fd_start_outgoing_migration(MigrationState *s, const char *fdname, + Error **errp); +#endif diff --git a/migration/migration.c b/migration/migration.c index 994f25f..ca5a576 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.3 From nobody Tue May 7 18:24:26 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 1493158856177326.88146339246055; Tue, 25 Apr 2017 15:20:56 -0700 (PDT) Received: from localhost ([::1]:51607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38pJ-0003Ap-Mu for importer@patchew.org; Tue, 25 Apr 2017 18:20:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ab-0007KJ-Aa for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aa-0005VD-6W for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35184) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aZ-0005UG-Ts for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:40 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5973C049D5B for ; Tue, 25 Apr 2017 22:05:38 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 557561714C; Tue, 25 Apr 2017 22:05:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E5973C049D5B 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 E5973C049D5B From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:32 +0200 Message-Id: <20170425220451.6028-23-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 25 Apr 2017 22:05:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 22/41] 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 --- include/migration/migration.h | 8 -------- migration/migration.c | 1 + migration/socket.c | 1 + migration/socket.h | 25 +++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 migration/socket.h diff --git a/include/migration/migration.h b/include/migration/migration.h index fd7d40d..18ec906 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -190,14 +190,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 ca5a576..f349a8c 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 6ee69ed..acb3f0d 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..800fde1 --- /dev/null +++ b/migration/socket.h @@ -0,0 +1,25 @@ +/* + * QEMU live migration socket functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_SOCKET_H +#define QEMU_MIGRATION_SOCKET_H +void tcp_start_incoming_migration(const char *host_port, Error **errp); + +void tcp_start_outgoing_migration(MigrationState *s, const char *host_port, + Error **errp); + +void unix_start_incoming_migration(const char *path, Error **errp); + +void unix_start_outgoing_migration(MigrationState *s, const char *path, + Error **errp); +#endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159004881503.603922273105; Tue, 25 Apr 2017 15:23:24 -0700 (PDT) Received: from localhost ([::1]:51618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38rj-0005iY-8P for importer@patchew.org; Tue, 25 Apr 2017 18:23:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ac-0007M1-Uq for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ab-0005Wx-Rm for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35250) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ab-0005W4-IR for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98270C0467F1 for ; Tue, 25 Apr 2017 22:05:40 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 436B51714C; Tue, 25 Apr 2017 22:05:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 98270C0467F1 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 98270C0467F1 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:33 +0200 Message-Id: <20170425220451.6028-24-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 25 Apr 2017 22:05: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] [PATCH 23/41] 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 --- include/migration/migration.h | 10 ---------- migration/channel.c | 1 + migration/migration.c | 1 - migration/tls.c | 1 + migration/tls.h | 27 +++++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 migration/tls.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 18ec906..08867c6 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" @@ -179,15 +178,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 d9b51de..5a81a60 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -15,6 +15,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 f349a8c..175e5c9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -42,7 +42,6 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "io/channel-buffer.h" -#include "io/channel-tls.h" #include "colo.h" =20 #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttli= ng */ diff --git a/migration/tls.c b/migration/tls.c index b4cb8fe..d3abd6e 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..1d63263 --- /dev/null +++ b/migration/tls.h @@ -0,0 +1,27 @@ +/* + * QEMU live migration tls functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_TLS_H +#define QEMU_MIGRATION_TLS_H + +#include "io/channel.h" + +void migration_tls_channel_process_incoming(MigrationState *s, + QIOChannel *ioc, + Error **errp); + +void migration_tls_channel_connect(MigrationState *s, + QIOChannel *ioc, + const char *hostname, + Error **errp); +#endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158626841568.9364469282452; Tue, 25 Apr 2017 15:17:06 -0700 (PDT) Received: from localhost ([::1]:51590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ld-00004u-Ef for importer@patchew.org; Tue, 25 Apr 2017 18:17:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38af-0007Ob-5X for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ad-0005Ys-Iz for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35316) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ad-0005Xv-8h for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:43 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 480D9C04B31F for ; Tue, 25 Apr 2017 22:05:42 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAFD61714C; Tue, 25 Apr 2017 22:05:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 480D9C04B31F 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 480D9C04B31F From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:34 +0200 Message-Id: <20170425220451.6028-25-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 25 Apr 2017 22:05:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 24/41] 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 | 39 ------------------------------ include/migration/misc.h | 21 +++++++++++++++++ migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/ram.c | 2 ++ migration/ram.h | 55 +++++++++++++++++++++++++++++++++++++++= ++++ migration/rdma.c | 2 +- migration/savevm.c | 1 + vl.c | 1 + 9 files changed, 83 insertions(+), 40 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 08867c6..38ba508 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -202,38 +202,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); @@ -244,8 +212,6 @@ int migrate_use_xbzrle(void); int64_t migrate_xbzrle_cache_size(void); bool migrate_colo_enabled(void); =20 -int64_t xbzrle_cache_resize(int64_t new_size); - bool migrate_use_block_enabled(void); bool migrate_use_block_shared(void); =20 @@ -284,7 +250,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); @@ -292,10 +257,6 @@ 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); - PostcopyState postcopy_state_get(void); /* Set the state and return the old state */ PostcopyState postcopy_state_set(PostcopyState new_state); diff --git a/include/migration/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 175e5c9..ef966ca 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -21,6 +21,7 @@ #include "exec.h" #include "fd.h" #include "socket.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 07fbc25..3359224 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -23,6 +23,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 36afa98..89637eb 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..1d9d6c4 --- /dev/null +++ b/migration/ram.h @@ -0,0 +1,55 @@ +/* + * QEMU migration ram + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_RAM_H +#define QEMU_MIGRATION_RAM_H + +#include "qemu-common.h" +#include "exec/cpu-common.h" + +int64_t xbzrle_cache_resize(int64_t new_size); +uint64_t dup_mig_pages_transferred(void); +uint64_t norm_mig_pages_transferred(void); +uint64_t xbzrle_mig_bytes_transferred(void); +uint64_t xbzrle_mig_pages_transferred(void); +uint64_t xbzrle_mig_pages_cache_miss(void); +double xbzrle_mig_cache_miss_rate(void); +uint64_t xbzrle_mig_pages_overflow(void); +uint64_t ram_bytes_transferred(void); +uint64_t ram_bytes_remaining(void); +uint64_t ram_dirty_sync_count(void); +uint64_t ram_dirty_pages_rate(void); +uint64_t ram_postcopy_requests(void); +uint64_t ram_bytes_total(void); + +void migrate_compress_threads_create(void); +void migrate_compress_threads_join(void); +void migrate_decompress_threads_create(void); +void migrate_decompress_threads_join(void); + +uint64_t ram_pagesize_summary(void); +void migration_page_queue_free(void); +int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); +void acct_update_position(QEMUFile *f, size_t size, bool zero); +void free_xbzrle_decoded_buf(void); +void ram_debug_dump_bitmap(unsigned long *todump, bool expected, + 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 2fda7a5..96a90dd 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -19,7 +19,7 @@ #include "qemu/cutils.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 d3e4d8e..a80bc83 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -37,6 +37,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 5b79f5b..17c0297 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.3 From nobody Tue May 7 18:24:26 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 1493159146970613.9853967772474; Tue, 25 Apr 2017 15:25:46 -0700 (PDT) Received: from localhost ([::1]:51631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38u1-0007oX-F1 for importer@patchew.org; Tue, 25 Apr 2017 18:25:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aj-0007SG-CC for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38af-0005b4-FK for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38af-0005Zn-3R for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16FF561BB8 for ; Tue, 25 Apr 2017 22:05:44 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9937C1714D; Tue, 25 Apr 2017 22:05:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 16FF561BB8 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 16FF561BB8 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:35 +0200 Message-Id: <20170425220451.6028-26-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 25 Apr 2017 22:05: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] [PATCH 25/41] 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 --- include/migration/migration.h | 4 ---- migration/migration.c | 1 + migration/rdma.c | 1 + migration/rdma.h | 22 ++++++++++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 migration/rdma.h diff --git a/include/migration/migration.h b/include/migration/migration.h index 38ba508..9063c32 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -180,10 +180,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 ef966ca..394930d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -22,6 +22,7 @@ #include "fd.h" #include "socket.h" #include "ram.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 96a90dd..f8fea9b 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 "ram.h" diff --git a/migration/rdma.h b/migration/rdma.h new file mode 100644 index 0000000..d2cf481 --- /dev/null +++ b/migration/rdma.h @@ -0,0 +1,22 @@ +/* + * QEMU migration rdma functions + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_RDMA_H +#define QEMU_MIGRATION_RDMA_H + +void rdma_start_outgoing_migration(void *opaque, const char *host_port, + Error **errp); + +void rdma_start_incoming_migration(const char *host_port, Error **errp); + +#endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159285503790.6988029125914; Tue, 25 Apr 2017 15:28:05 -0700 (PDT) Received: from localhost ([::1]:51638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38wG-0001Oo-7S for importer@patchew.org; Tue, 25 Apr 2017 18:28:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38an-0007VT-06 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ai-0005fJ-UC for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60970) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ai-0005eA-N8 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A95B37E9D4 for ; Tue, 25 Apr 2017 22:05:47 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64D901714C; Tue, 25 Apr 2017 22:05:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A95B37E9D4 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 A95B37E9D4 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:36 +0200 Message-Id: <20170425220451.6028-27-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Apr 2017 22:05:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 26/41] 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 --- include/migration/misc.h | 4 ++++ migration/block.c | 3 ++- {include/migration =3D> migration}/block.h | 1 - migration/migration.c | 2 +- vl.c | 1 - 5 files changed, 7 insertions(+), 4 deletions(-) rename {include/migration =3D> migration}/block.h (95%) diff --git a/include/migration/misc.h b/include/migration/misc.h index 0b37714..9e64c16 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -18,4 +18,8 @@ =20 void ram_mig_init(void); =20 +/* migration/block.c */ + +void blk_mig_init(void); + #endif diff --git a/migration/block.c b/migration/block.c index c26bdb2..d19dc15 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 95% rename from include/migration/block.h rename to migration/block.h index 41a1ac8..9f6febb 100644 --- a/include/migration/block.h +++ b/migration/block.h @@ -14,7 +14,6 @@ #ifndef MIGRATION_BLOCK_H #define MIGRATION_BLOCK_H =20 -void blk_mig_init(void); int blk_mig_active(void); uint64_t blk_mig_bytes_transferred(void); uint64_t blk_mig_bytes_remaining(void); diff --git a/migration/migration.c b/migration/migration.c index 394930d..ff32086 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 17c0297..605c98f 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.3 From nobody Tue May 7 18:24:26 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 1493158786188891.5336016111848; Tue, 25 Apr 2017 15:19:46 -0700 (PDT) Received: from localhost ([::1]:51599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38oC-0002BU-L3 for importer@patchew.org; Tue, 25 Apr 2017 18:19:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38an-0007VU-0J for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ak-0005hk-Gf for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ak-0005gH-Ai for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C10D80481 for ; Tue, 25 Apr 2017 22:05:49 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04C781714C; Tue, 25 Apr 2017 22:05:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5C10D80481 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5C10D80481 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:37 +0200 Message-Id: <20170425220451.6028-28-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Apr 2017 22:05:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 27/41] migration: Move self_announce_delay() to misc.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" Signed-off-by: Juan Quintela --- hw/net/virtio-net.c | 1 + include/migration/misc.h | 10 ++++++++++ include/migration/vmstate.h | 10 ---------- migration/savevm.c | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7d091c9..2259156 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -25,6 +25,7 @@ #include "qapi/qmp/qjson.h" #include "qapi-event.h" #include "hw/virtio/virtio-access.h" +#include "migration/misc.h" =20 #define VIRTIO_NET_VM_VERSION 11 =20 diff --git a/include/migration/misc.h b/include/migration/misc.h index 9e64c16..45ef9c9 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -22,4 +22,14 @@ void ram_mig_init(void); =20 void blk_mig_init(void); =20 +#define SELF_ANNOUNCE_ROUNDS 5 + +static inline +int64_t self_announce_delay(int round) +{ + assert(round < SELF_ANNOUNCE_ROUNDS && round > 0); + /* delay 50ms, 150ms, 250ms, ... */ + return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100; +} + #endif diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index e9f5bc8..655558d 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1000,8 +1000,6 @@ extern const VMStateInfo vmstate_info_qtailq; #define VMSTATE_END_OF_LIST() \ {} =20 -#define SELF_ANNOUNCE_ROUNDS 5 - void loadvm_free_handlers(MigrationIncomingState *mis); =20 int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, @@ -1035,14 +1033,6 @@ void vmstate_register_ram(struct MemoryRegion *memor= y, DeviceState *dev); void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev); void vmstate_register_ram_global(struct MemoryRegion *memory); =20 -static inline -int64_t self_announce_delay(int round) -{ - assert(round < SELF_ANNOUNCE_ROUNDS && round > 0); - /* delay 50ms, 150ms, 250ms, ... */ - return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100; -} - void dump_vmstate_json_to_file(FILE *out_fp); =20 bool vmstate_device_is_migratable(const VMStateDescription *vmsd); diff --git a/migration/savevm.c b/migration/savevm.c index a80bc83..6aeebb8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -37,6 +37,7 @@ #include "qemu/timer.h" #include "migration/migration.h" #include "migration/snapshot.h" +#include "migration/misc.h" #include "ram.h" #include "qemu-file-channel.h" #include "qemu-file.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159295430705.4778714563233; Tue, 25 Apr 2017 15:28:15 -0700 (PDT) Received: from localhost ([::1]:51640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38wP-0001Xk-Vo for importer@patchew.org; Tue, 25 Apr 2017 18:28:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ao-0007VW-BL for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38am-0005l1-NG for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40894) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38am-0005k0-EF for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E53223E6D7 for ; Tue, 25 Apr 2017 22:05:51 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC1B91714C; Tue, 25 Apr 2017 22:05:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6E53223E6D7 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 6E53223E6D7 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:38 +0200 Message-Id: <20170425220451.6028-29-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 25 Apr 2017 22:05: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] [PATCH 28/41] migration: Split registration functions from vmstate.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" They are indpendent, and nowadays almost every device register things with qdev->vmsd. Signed-off-by: Juan Quintela --- hw/net/vmxnet3.c | 1 + hw/ppc/spapr.c | 1 + hw/s390x/s390-skeys.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + include/migration/register.h | 64 ++++++++++++++++++++++++++++++++++++++++= ++++ include/migration/vmstate.h | 45 ------------------------------- migration/block.c | 1 + migration/ram.c | 1 + migration/savevm.c | 1 + slirp/slirp.c | 1 + 10 files changed, 72 insertions(+), 45 deletions(-) create mode 100644 include/migration/register.h diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 8b1fab2..21ac646 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -26,6 +26,7 @@ #include "qemu/bswap.h" #include "hw/pci/msix.h" #include "hw/pci/msi.h" +#include "migration/register.h" =20 #include "vmxnet3.h" #include "vmxnet_debug.h" diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 35db949..4c4701e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -39,6 +39,7 @@ #include "sysemu/hw_accel.h" #include "kvm_ppc.h" #include "migration/migration.h" +#include "migration/register.h" #include "mmu-hash64.h" #include "qom/cpu.h" =20 diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 619152c..58f084a 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -15,6 +15,7 @@ #include "hw/s390x/storage-keys.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" +#include "migration/register.h" =20 #define S390_SKEYS_BUFFER_SIZE 131072 /* Room for 128k storage keys */ #define S390_SKEYS_SAVE_FLAG_EOS 0x01 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 04bd0eb..22716e1 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -28,6 +28,7 @@ #include "ipl.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/css-bridge.h" +#include "migration/register.h" =20 static const char *const reset_dev_types[] =3D { TYPE_VIRTUAL_CSS_BRIDGE, diff --git a/include/migration/register.h b/include/migration/register.h new file mode 100644 index 0000000..844afaf --- /dev/null +++ b/include/migration/register.h @@ -0,0 +1,64 @@ +/* + * QEMU migration vmstate registration + * + * 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_REGISTER_H +#define MIGRATION_REGISTER_H + +typedef void SaveStateHandler(QEMUFile *f, void *opaque); +typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); + +typedef struct SaveVMHandlers { + /* This runs inside the iothread lock. */ + SaveStateHandler *save_state; + + void (*cleanup)(void *opaque); + int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque); + int (*save_live_complete_precopy)(QEMUFile *f, void *opaque); + + /* This runs both outside and inside the iothread lock. */ + bool (*is_active)(void *opaque); + + /* This runs outside the iothread lock in the migration case, and + * within the lock in the savevm case. The callback had better only + * use data that is local to the migration thread or protected + * by other locks. + */ + int (*save_live_iterate)(QEMUFile *f, void *opaque); + + /* This runs outside the iothread lock! */ + int (*save_live_setup)(QEMUFile *f, void *opaque); + void (*save_live_pending)(QEMUFile *f, void *opaque, + uint64_t threshold_size, + uint64_t *non_postcopiable_pending, + uint64_t *postcopiable_pending); + LoadStateHandler *load_state; +} SaveVMHandlers; + +int register_savevm(DeviceState *dev, + const char *idstr, + int instance_id, + int version_id, + SaveStateHandler *save_state, + LoadStateHandler *load_state, + void *opaque); + +int register_savevm_live(DeviceState *dev, + const char *idstr, + int instance_id, + int version_id, + SaveVMHandlers *ops, + void *opaque); + +void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque); + +#endif diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 655558d..6b7031f 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -29,53 +29,8 @@ =20 #include "migration/qjson.h" =20 -typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); =20 -typedef struct SaveVMHandlers { - /* This runs inside the iothread lock. */ - SaveStateHandler *save_state; - - void (*cleanup)(void *opaque); - int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque); - int (*save_live_complete_precopy)(QEMUFile *f, void *opaque); - - /* This runs both outside and inside the iothread lock. */ - bool (*is_active)(void *opaque); - - /* This runs outside the iothread lock in the migration case, and - * within the lock in the savevm case. The callback had better only - * use data that is local to the migration thread or protected - * by other locks. - */ - int (*save_live_iterate)(QEMUFile *f, void *opaque); - - /* This runs outside the iothread lock! */ - int (*save_live_setup)(QEMUFile *f, void *opaque); - void (*save_live_pending)(QEMUFile *f, void *opaque, - uint64_t threshold_size, - uint64_t *non_postcopiable_pending, - uint64_t *postcopiable_pending); - LoadStateHandler *load_state; -} SaveVMHandlers; - -int register_savevm(DeviceState *dev, - const char *idstr, - int instance_id, - int version_id, - SaveStateHandler *save_state, - LoadStateHandler *load_state, - void *opaque); - -int register_savevm_live(DeviceState *dev, - const char *idstr, - int instance_id, - int version_id, - SaveVMHandlers *ops, - void *opaque); - -void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque); - typedef struct VMStateInfo VMStateInfo; typedef struct VMStateDescription VMStateDescription; typedef struct VMStateField VMStateField; diff --git a/migration/block.c b/migration/block.c index d19dc15..307f136 100644 --- a/migration/block.c +++ b/migration/block.c @@ -26,6 +26,7 @@ #include "block.h" #include "migration/misc.h" #include "migration/migration.h" +#include "migration/register.h" #include "sysemu/blockdev.h" #include "qemu-file.h" #include "migration/vmstate.h" diff --git a/migration/ram.c b/migration/ram.c index 89637eb..b6cef70 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -38,6 +38,7 @@ #include "xbzrle.h" #include "ram.h" #include "migration/migration.h" +#include "migration/register.h" #include "migration/misc.h" #include "qemu-file.h" #include "migration/vmstate.h" diff --git a/migration/savevm.c b/migration/savevm.c index 6aeebb8..1caf8ee 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -38,6 +38,7 @@ #include "migration/migration.h" #include "migration/snapshot.h" #include "migration/misc.h" +#include "migration/register.h" #include "ram.h" #include "qemu-file-channel.h" #include "qemu-file.h" diff --git a/slirp/slirp.c b/slirp/slirp.c index 9a50918..8f59a26 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -25,6 +25,7 @@ #include "qemu-common.h" #include "qemu/timer.h" #include "qemu/error-report.h" +#include "migration/register.h" #include "sysemu/char.h" #include "slirp.h" #include "hw/hw.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158937549545.6921379326459; Tue, 25 Apr 2017 15:22:17 -0700 (PDT) Received: from localhost ([::1]:51613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38qc-0004Go-07 for importer@patchew.org; Tue, 25 Apr 2017 18:22:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ap-0007X0-Fn for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ao-0005nn-B7 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32828) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ao-0005mz-50 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 292B57E9D4 for ; Tue, 25 Apr 2017 22:05:53 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFC0F17568; Tue, 25 Apr 2017 22:05:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 292B57E9D4 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 292B57E9D4 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:39 +0200 Message-Id: <20170425220451.6028-30-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Apr 2017 22:05:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 29/41] migration: loadvm_free_handlers is only used in 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" Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 2 -- migration/savevm.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 6b7031f..afa43ac 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -955,8 +955,6 @@ extern const VMStateInfo vmstate_info_qtailq; #define VMSTATE_END_OF_LIST() \ {} =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/migration/savevm.h b/migration/savevm.h index f4c4bc9..75b2b8c 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -38,4 +38,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, c= onst char *name, =20 int qemu_loadvm_state(QEMUFile *f); =20 +void loadvm_free_handlers(MigrationIncomingState *mis); + #endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158772293216.26369487296245; Tue, 25 Apr 2017 15:19:32 -0700 (PDT) Received: from localhost ([::1]:51598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ny-00023F-Qk for importer@patchew.org; Tue, 25 Apr 2017 18:19:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38at-0007bT-Ji for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38aq-0005s5-5R for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ap-0005pG-Ue for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D86663DBC1 for ; Tue, 25 Apr 2017 22:05:54 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7949417568; Tue, 25 Apr 2017 22:05:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D86663DBC1 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 D86663DBC1 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:40 +0200 Message-Id: <20170425220451.6028-31-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:05: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] [PATCH 30/41] migration: Move dump_vmsate_json_to_file() to misc.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" It was not from vmstate.c to start with. Signed-off-by: Juan Quintela --- include/migration/misc.h | 4 ++++ include/migration/vmstate.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 45ef9c9..21a9182 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -32,4 +32,8 @@ int64_t self_announce_delay(int round) return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100; } =20 +/* migration/savevm.c */ + +void dump_vmstate_json_to_file(FILE *out_fp); + #endif diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index afa43ac..5811804 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -986,8 +986,6 @@ void vmstate_register_ram(struct MemoryRegion *memory, = DeviceState *dev); void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev); void vmstate_register_ram_global(struct MemoryRegion *memory); =20 -void dump_vmstate_json_to_file(FILE *out_fp); - bool vmstate_device_is_migratable(const VMStateDescription *vmsd); =20 #endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493158926159927.7105659703723; Tue, 25 Apr 2017 15:22:06 -0700 (PDT) Received: from localhost ([::1]:51611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38qS-00047k-F6 for importer@patchew.org; Tue, 25 Apr 2017 18:22:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aw-0007eB-8Q for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38as-0005vC-5T for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38ar-0005tV-Oj for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B75DD155E4 for ; Tue, 25 Apr 2017 22:05:56 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3595517566; Tue, 25 Apr 2017 22:05:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B75DD155E4 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 B75DD155E4 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:41 +0200 Message-Id: <20170425220451.6028-32-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 25 Apr 2017 22:05:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 31/41] migration: Move postcopy stuff to postcopy-ram.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" Yes, we don't have a good place to put that stuff. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 25 ------------------------- migration/migration.c | 18 ------------------ migration/postcopy-ram.c | 18 ++++++++++++++++++ migration/postcopy-ram.h | 26 ++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 9063c32..5c27fe7 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -54,28 +54,6 @@ enum mig_rp_message_type { =20 typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head; =20 -/* The current postcopy state is read/set by postcopy_state_get/set - * which update it atomically. - * The state is updated as postcopy messages are received, and - * in general only one thread should be writing to the state at any one - * time, initially the main thread and then the listen thread; - * Corner cases are where either thread finishes early and/or errors. - * The state is checked as messages are received to ensure that - * the source is sending us messages in the correct order. - * The state is also used by the RAM reception code to know if it - * has to place pages atomically, and the cleanup code at the end of - * the main thread to know if it has to delay cleanup until the end - * of postcopy. - */ -typedef enum { - POSTCOPY_INCOMING_NONE =3D 0, /* Initial state - no postcopy */ - POSTCOPY_INCOMING_ADVISE, - POSTCOPY_INCOMING_DISCARD, - POSTCOPY_INCOMING_LISTENING, - POSTCOPY_INCOMING_RUNNING, - POSTCOPY_INCOMING_END -} PostcopyState; - /* State for the incoming migration */ struct MigrationIncomingState { QEMUFile *from_src_file; @@ -253,7 +231,4 @@ void savevm_skip_configuration(void); int global_state_store(void); void global_state_store_running(void); =20 -PostcopyState postcopy_state_get(void); -/* Set the state and return the old state */ -PostcopyState postcopy_state_set(PostcopyState new_state); #endif diff --git a/migration/migration.c b/migration/migration.c index ff32086..d2f3c5e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -85,13 +85,6 @@ static NotifierList migration_state_notifiers =3D =20 static bool deferred_incoming; =20 -/* - * Current state of incoming postcopy; note this is not part of - * MigrationIncomingState since it's state is used during cleanup - * at the end as MIS is being freed. - */ -static PostcopyState incoming_postcopy_state; - /* When we add fault tolerance, we could have several migrations at once. For now we don't need to add dynamic creation of migration */ @@ -2085,14 +2078,3 @@ void migrate_fd_connect(MigrationState *s) s->migration_thread_running =3D true; } =20 -PostcopyState postcopy_state_get(void) -{ - return atomic_mb_read(&incoming_postcopy_state); -} - -/* Set the state and return the old state */ -PostcopyState postcopy_state_set(PostcopyState new_state) -{ - return atomic_xchg(&incoming_postcopy_state, new_state); -} - diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 3359224..cae5d48 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -787,3 +787,21 @@ void postcopy_discard_send_finish(MigrationState *ms, = PostcopyDiscardState *pds) =20 g_free(pds); } + +/* + * Current state of incoming postcopy; note this is not part of + * MigrationIncomingState since it's state is used during cleanup + * at the end as MIS is being freed. + */ +static PostcopyState incoming_postcopy_state; + +PostcopyState postcopy_state_get(void) +{ + return atomic_mb_read(&incoming_postcopy_state); +} + +/* Set the state and return the old state */ +PostcopyState postcopy_state_set(PostcopyState new_state) +{ + return atomic_xchg(&incoming_postcopy_state, new_state); +} diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h index 4c25f03..52d51e8 100644 --- a/migration/postcopy-ram.h +++ b/migration/postcopy-ram.h @@ -81,6 +81,28 @@ int postcopy_place_page(MigrationIncomingState *mis, voi= d *host, void *from, int postcopy_place_page_zero(MigrationIncomingState *mis, void *host, size_t pagesize); =20 +/* The current postcopy state is read/set by postcopy_state_get/set + * which update it atomically. + * The state is updated as postcopy messages are received, and + * in general only one thread should be writing to the state at any one + * time, initially the main thread and then the listen thread; + * Corner cases are where either thread finishes early and/or errors. + * The state is checked as messages are received to ensure that + * the source is sending us messages in the correct order. + * The state is also used by the RAM reception code to know if it + * has to place pages atomically, and the cleanup code at the end of + * the main thread to know if it has to delay cleanup until the end + * of postcopy. + */ +typedef enum { + POSTCOPY_INCOMING_NONE =3D 0, /* Initial state - no postcopy */ + POSTCOPY_INCOMING_ADVISE, + POSTCOPY_INCOMING_DISCARD, + POSTCOPY_INCOMING_LISTENING, + POSTCOPY_INCOMING_RUNNING, + POSTCOPY_INCOMING_END +} PostcopyState; + /* * Allocate a page of memory that can be mapped at a later point in time * using postcopy_place_page @@ -88,4 +110,8 @@ int postcopy_place_page_zero(MigrationIncomingState *mis= , void *host, */ void *postcopy_get_tmp_page(MigrationIncomingState *mis); =20 +PostcopyState postcopy_state_get(void); +/* Set the state and return the old state */ +PostcopyState postcopy_state_set(PostcopyState new_state); + #endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159081881944.5596013317024; Tue, 25 Apr 2017 15:24:41 -0700 (PDT) Received: from localhost ([::1]:51623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38sy-0006oW-9c for importer@patchew.org; Tue, 25 Apr 2017 18:24:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38aw-0007e8-87 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38at-0005xh-QN for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37067) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38at-0005wi-HO for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:05:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89A1D3DBC6 for ; Tue, 25 Apr 2017 22:05:58 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 153371714C; Tue, 25 Apr 2017 22:05:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89A1D3DBC6 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 89A1D3DBC6 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:42 +0200 Message-Id: <20170425220451.6028-33-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:05:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 32/41] migration: Move constants to savevm.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" Signed-off-by: Juan Quintela --- include/migration/migration.h | 15 --------------- migration/savevm.h | 15 +++++++++++++++ migration/vmstate.c | 1 + tests/test-vmstate.c | 1 + 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 5c27fe7..ac6e545 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -22,21 +22,6 @@ #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" =20 -#define QEMU_VM_FILE_MAGIC 0x5145564d -#define QEMU_VM_FILE_VERSION_COMPAT 0x00000002 -#define QEMU_VM_FILE_VERSION 0x00000003 - -#define QEMU_VM_EOF 0x00 -#define QEMU_VM_SECTION_START 0x01 -#define QEMU_VM_SECTION_PART 0x02 -#define QEMU_VM_SECTION_END 0x03 -#define QEMU_VM_SECTION_FULL 0x04 -#define QEMU_VM_SUBSECTION 0x05 -#define QEMU_VM_VMDESCRIPTION 0x06 -#define QEMU_VM_CONFIGURATION 0x07 -#define QEMU_VM_COMMAND 0x08 -#define QEMU_VM_SECTION_FOOTER 0x7e - /* for vl.c */ extern int only_migratable; =20 diff --git a/migration/savevm.h b/migration/savevm.h index 75b2b8c..b4c1f3c 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -14,6 +14,21 @@ #ifndef MIGRATION_SAVEVM_H #define MIGRATION_SAVEVM_H =20 +#define QEMU_VM_FILE_MAGIC 0x5145564d +#define QEMU_VM_FILE_VERSION_COMPAT 0x00000002 +#define QEMU_VM_FILE_VERSION 0x00000003 + +#define QEMU_VM_EOF 0x00 +#define QEMU_VM_SECTION_START 0x01 +#define QEMU_VM_SECTION_PART 0x02 +#define QEMU_VM_SECTION_END 0x03 +#define QEMU_VM_SECTION_FULL 0x04 +#define QEMU_VM_SUBSECTION 0x05 +#define QEMU_VM_VMDESCRIPTION 0x06 +#define QEMU_VM_CONFIGURATION 0x07 +#define QEMU_VM_COMMAND 0x08 +#define QEMU_VM_SECTION_FOOTER 0x7e + bool qemu_savevm_state_blocked(Error **errp); void qemu_savevm_state_begin(QEMUFile *f); void qemu_savevm_state_header(QEMUFile *f); diff --git a/migration/vmstate.c b/migration/vmstate.c index 57dc34f..4b0cb2f 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -29,6 +29,7 @@ #include "qemu-common.h" #include "migration/migration.h" #include "migration/vmstate.h" +#include "migration/savevm.h" #include "qemu-file.h" #include "qemu/bitops.h" #include "qemu/error-report.h" diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index c52aff9..f30433a 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -30,6 +30,7 @@ #include "migration/qemu-file-types.h" #include "../migration/qemu-file.h" #include "../migration/qemu-file-channel.h" +#include "../migration/savevm.h" #include "qemu/coroutine.h" #include "io/channel-file.h" =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159225375602.0253652937519; Tue, 25 Apr 2017 15:27:05 -0700 (PDT) Received: from localhost ([::1]:51636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38vI-0000Rl-4k for importer@patchew.org; Tue, 25 Apr 2017 18:27:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ax-0007ez-0M for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38av-0005zW-Jt for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38av-0005yL-9x for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4FD317E9D6 for ; Tue, 25 Apr 2017 22:06:00 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC10C1714C; Tue, 25 Apr 2017 22:05:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4FD317E9D6 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 4FD317E9D6 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:43 +0200 Message-Id: <20170425220451.6028-34-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Apr 2017 22:06:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 33/41] migration: Commands are only used inside migration.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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, move them there. Notice that we export functions that send commands, not the command themselves. Signed-off-by: Juan Quintela --- include/migration/migration.h | 15 -------------- migration/migration.c | 46 +++++++++++++++++++++++++++------------= ---- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index ac6e545..9884be6 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -25,18 +25,6 @@ /* for vl.c */ extern int only_migratable; =20 -/* Messages sent on the return path from destination to source */ -enum mig_rp_message_type { - MIG_RP_MSG_INVALID =3D 0, /* Must be 0 */ - MIG_RP_MSG_SHUT, /* sibling will not send any more RP messages= */ - MIG_RP_MSG_PONG, /* Response to a PING; data (seq: be32 ) */ - - MIG_RP_MSG_REQ_PAGES_ID, /* data (start: be64, len: be32, id: string) = */ - MIG_RP_MSG_REQ_PAGES, /* data (start: be64, len: be32) */ - - MIG_RP_MSG_MAX -}; - typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head; =20 /* State for the incoming migration */ @@ -181,9 +169,6 @@ int migrate_decompress_threads(void); bool migrate_use_events(void); =20 /* Sending on the return path - generic and then for each message type */ -void migrate_send_rp_message(MigrationIncomingState *mis, - enum mig_rp_message_type message_type, - uint16_t len, void *data); void migrate_send_rp_shut(MigrationIncomingState *mis, uint32_t value); void migrate_send_rp_pong(MigrationIncomingState *mis, diff --git a/migration/migration.c b/migration/migration.c index d2f3c5e..6e43ae3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -85,6 +85,18 @@ static NotifierList migration_state_notifiers =3D =20 static bool deferred_incoming; =20 +/* Messages sent on the return path from destination to source */ +enum mig_rp_message_type { + MIG_RP_MSG_INVALID =3D 0, /* Must be 0 */ + MIG_RP_MSG_SHUT, /* sibling will not send any more RP messages= */ + MIG_RP_MSG_PONG, /* Response to a PING; data (seq: be32 ) */ + + MIG_RP_MSG_REQ_PAGES_ID, /* data (start: be64, len: be32, id: string) = */ + MIG_RP_MSG_REQ_PAGES, /* data (start: be64, len: be32) */ + + MIG_RP_MSG_MAX +}; + /* When we add fault tolerance, we could have several migrations at once. For now we don't need to add dynamic creation of migration */ @@ -281,6 +293,23 @@ static void deferred_incoming_migration(Error **errp) deferred_incoming =3D true; } =20 +/* + * Send a message on the return channel back to the source + * of the migration. + */ +static void migrate_send_rp_message(MigrationIncomingState *mis, + enum mig_rp_message_type message_type, + uint16_t len, void *data) +{ + trace_migrate_send_rp_message((int)message_type, len); + qemu_mutex_lock(&mis->rp_mutex); + qemu_put_be16(mis->to_src_file, (unsigned int)message_type); + qemu_put_be16(mis->to_src_file, len); + qemu_put_buffer(mis->to_src_file, data, len); + qemu_fflush(mis->to_src_file); + qemu_mutex_unlock(&mis->rp_mutex); +} + /* Request a range of pages from the source VM at the given * start address. * rbname: Name of the RAMBlock to request the page in, if NULL it's the= same @@ -461,23 +490,6 @@ void migration_fd_process_incoming(QEMUFile *f) } =20 /* - * Send a message on the return channel back to the source - * of the migration. - */ -void migrate_send_rp_message(MigrationIncomingState *mis, - enum mig_rp_message_type message_type, - uint16_t len, void *data) -{ - trace_migrate_send_rp_message((int)message_type, len); - qemu_mutex_lock(&mis->rp_mutex); - qemu_put_be16(mis->to_src_file, (unsigned int)message_type); - qemu_put_be16(mis->to_src_file, len); - qemu_put_buffer(mis->to_src_file, data, len); - qemu_fflush(mis->to_src_file); - qemu_mutex_unlock(&mis->rp_mutex); -} - -/* * Send a 'SHUT' message on the return channel with the given value * to indicate that we've finished with the RP. Non-0 value indicates * error. --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159071353468.62022975140246; Tue, 25 Apr 2017 15:24:31 -0700 (PDT) Received: from localhost ([::1]:51621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38so-0006fN-2m for importer@patchew.org; Tue, 25 Apr 2017 18:24:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38ay-0007gq-Md for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38ax-00061e-2A for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58486) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38aw-00060C-Sd for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E433280043 for ; Tue, 25 Apr 2017 22:06:01 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1DE61714C; Tue, 25 Apr 2017 22:06:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E433280043 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 E433280043 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:44 +0200 Message-Id: <20170425220451.6028-35-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 22:06: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] [PATCH 34/41] migration: ram_control_* are implemented in qemu_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 --- include/migration/migration.h | 18 ------------------ migration/qemu-file.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 9884be6..7bd87f8 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -176,24 +176,6 @@ void migrate_send_rp_pong(MigrationIncomingState *mis, void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rb= name, ram_addr_t start, size_t len); =20 -void ram_control_before_iterate(QEMUFile *f, uint64_t flags); -void ram_control_after_iterate(QEMUFile *f, uint64_t flags); -void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data); - -/* Whenever this is found in the data stream, the flags - * will be passed to ram_control_load_hook in the incoming-migration - * side. This lets before_ram_iterate/after_ram_iterate add - * transport-specific sections to the RAM migration data. - */ -#define RAM_SAVE_FLAG_HOOK 0x80 - -#define RAM_SAVE_CONTROL_NOT_SUPP -1000 -#define RAM_SAVE_CONTROL_DELAYED -2000 - -size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, - ram_addr_t offset, size_t size, - uint64_t *bytes_sent); - void savevm_skip_section_footers(void); void register_global_state(void); void global_state_set_optional(void); diff --git a/migration/qemu-file.h b/migration/qemu-file.h index 49fd697..aae4e5e 100644 --- a/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -156,5 +156,22 @@ void qemu_file_set_blocking(QEMUFile *f, bool block); =20 size_t qemu_get_counted_string(QEMUFile *f, char buf[256]); =20 +void ram_control_before_iterate(QEMUFile *f, uint64_t flags); +void ram_control_after_iterate(QEMUFile *f, uint64_t flags); +void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data); + +/* Whenever this is found in the data stream, the flags + * will be passed to ram_control_load_hook in the incoming-migration + * side. This lets before_ram_iterate/after_ram_iterate add + * transport-specific sections to the RAM migration data. + */ +#define RAM_SAVE_FLAG_HOOK 0x80 + +#define RAM_SAVE_CONTROL_NOT_SUPP -1000 +#define RAM_SAVE_CONTROL_DELAYED -2000 + +size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, + ram_addr_t offset, size_t size, + uint64_t *bytes_sent); =20 #endif --=20 2.9.3 From nobody Tue May 7 18:24:26 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 149315942131858.40923062121169; Tue, 25 Apr 2017 15:30:21 -0700 (PDT) Received: from localhost ([::1]:51650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38yR-0003Sq-WC for importer@patchew.org; Tue, 25 Apr 2017 18:30:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38b4-0007mM-W6 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38b0-00066p-QN for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38b0-00065R-Gy for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 819DE8047A for ; Tue, 25 Apr 2017 22:06:05 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 430241714C; Tue, 25 Apr 2017 22:06:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 819DE8047A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 819DE8047A From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:45 +0200 Message-Id: <20170425220451.6028-36-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Apr 2017 22:06:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 35/41] migration: create global_state.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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" It don't belong anywhere else, just the global state where everybody can stick other things. Signed-off-by: Juan Quintela --- hw/i386/pc_piix.c | 1 + hw/ppc/spapr.c | 1 + include/migration/global_state.h | 26 +++++++ include/migration/migration.h | 4 -- migration/Makefile.objs | 2 +- migration/global_state.c | 143 +++++++++++++++++++++++++++++++++++= ++++ migration/migration.c | 121 +-------------------------------- migration/savevm.c | 1 + vl.c | 1 + xen-common.c | 1 + 10 files changed, 176 insertions(+), 125 deletions(-) create mode 100644 include/migration/global_state.h create mode 100644 migration/global_state.c diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9f102aa..6c72bd3 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -52,6 +52,7 @@ #include #include "hw/xen/xen_pt.h" #endif +#include "migration/global_state.h" #include "migration/migration.h" #include "kvm_i386.h" =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4c4701e..f779c35 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -39,6 +39,7 @@ #include "sysemu/hw_accel.h" #include "kvm_ppc.h" #include "migration/migration.h" +#include "migration/global_state.h" #include "migration/register.h" #include "mmu-hash64.h" #include "qom/cpu.h" diff --git a/include/migration/global_state.h b/include/migration/global_st= ate.h new file mode 100644 index 0000000..84a19d0 --- /dev/null +++ b/include/migration/global_state.h @@ -0,0 +1,26 @@ +/* + * QEMU live migration + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_MIGRATION_GLOBAL_STATE_H +#define QEMU_MIGRATION_GLOBAL_STATE_H + +#include "sysemu/sysemu.h" + +void register_global_state(void); +void global_state_set_optional(void); +int global_state_store(void); +void global_state_store_running(void); +bool global_state_received(void); +RunState global_state_get_runstate(void); + +#endif diff --git a/include/migration/migration.h b/include/migration/migration.h index 7bd87f8..fc31f8e 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -177,10 +177,6 @@ void migrate_send_rp_req_pages(MigrationIncomingState = *mis, const char* rbname, ram_addr_t start, size_t len); =20 void savevm_skip_section_footers(void); -void register_global_state(void); -void global_state_set_optional(void); void savevm_skip_configuration(void); -int global_state_store(void); -void global_state_store_running(void); =20 #endif diff --git a/migration/Makefile.objs b/migration/Makefile.objs index 812b2ec..775e4ad 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -2,7 +2,7 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o common-obj-y +=3D tls.o channel.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o common-obj-y +=3D vmstate.o vmstate-types.o page_cache.o -common-obj-y +=3D qemu-file.o +common-obj-y +=3D qemu-file.o global_state.o common-obj-y +=3D qemu-file-channel.o common-obj-y +=3D xbzrle.o postcopy-ram.o common-obj-y +=3D qjson.o diff --git a/migration/global_state.c b/migration/global_state.c new file mode 100644 index 0000000..3d67ba2 --- /dev/null +++ b/migration/global_state.c @@ -0,0 +1,143 @@ +/* + * QEMU live migration global state + * + * Copyright IBM, Corp. 2008 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "qemu/cutils.h" +#include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/util.h" +#include "migration/global_state.h" +#include "migration/vmstate.h" +#include "sysemu/sysemu.h" +#include "trace.h" + +typedef struct { + bool optional; + uint32_t size; + uint8_t runstate[100]; + RunState state; + bool received; +} GlobalState; + +static GlobalState global_state; + +int global_state_store(void) +{ + if (!runstate_store((char *)global_state.runstate, + sizeof(global_state.runstate))) { + error_report("runstate name too big: %s", global_state.runstate); + trace_migrate_state_too_big(); + return -EINVAL; + } + return 0; +} + +void global_state_store_running(void) +{ + const char *state =3D RunState_lookup[RUN_STATE_RUNNING]; + strncpy((char *)global_state.runstate, + state, sizeof(global_state.runstate)); +} + +bool global_state_received(void) +{ + return global_state.received; +} + +RunState global_state_get_runstate(void) +{ + return global_state.state; +} + +void global_state_set_optional(void) +{ + global_state.optional =3D true; +} + +static bool global_state_needed(void *opaque) +{ + GlobalState *s =3D opaque; + char *runstate =3D (char *)s->runstate; + + /* If it is not optional, it is mandatory */ + + if (s->optional =3D=3D false) { + return true; + } + + /* If state is running or paused, it is not needed */ + + if (strcmp(runstate, "running") =3D=3D 0 || + strcmp(runstate, "paused") =3D=3D 0) { + return false; + } + + /* for any other state it is needed */ + return true; +} + +static int global_state_post_load(void *opaque, int version_id) +{ + GlobalState *s =3D opaque; + Error *local_err =3D NULL; + int r; + char *runstate =3D (char *)s->runstate; + + s->received =3D true; + trace_migrate_global_state_post_load(runstate); + + r =3D qapi_enum_parse(RunState_lookup, runstate, RUN_STATE__MAX, + -1, &local_err); + + if (r =3D=3D -1) { + if (local_err) { + error_report_err(local_err); + } + return -EINVAL; + } + s->state =3D r; + + return 0; +} + +static void global_state_pre_save(void *opaque) +{ + GlobalState *s =3D opaque; + + trace_migrate_global_state_pre_save((char *)s->runstate); + s->size =3D strlen((char *)s->runstate) + 1; +} + +static const VMStateDescription vmstate_globalstate =3D { + .name =3D "globalstate", + .version_id =3D 1, + .minimum_version_id =3D 1, + .post_load =3D global_state_post_load, + .pre_save =3D global_state_pre_save, + .needed =3D global_state_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT32(size, GlobalState), + VMSTATE_BUFFER(runstate, GlobalState), + VMSTATE_END_OF_LIST() + }, +}; + +void register_global_state(void) +{ + /* We would use it independently that we receive it */ + strcpy((char *)&global_state.runstate, ""); + global_state.received =3D false; + vmstate_register(NULL, 0, &vmstate_globalstate, &global_state); +} diff --git a/migration/migration.c b/migration/migration.c index 6e43ae3..4cda97c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -23,6 +23,7 @@ #include "socket.h" #include "ram.h" #include "rdma.h" +#include "migration/global_state.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" @@ -153,126 +154,6 @@ void migration_incoming_state_destroy(void) loadvm_free_handlers(mis); } =20 - -typedef struct { - bool optional; - uint32_t size; - uint8_t runstate[100]; - RunState state; - bool received; -} GlobalState; - -static GlobalState global_state; - -int global_state_store(void) -{ - if (!runstate_store((char *)global_state.runstate, - sizeof(global_state.runstate))) { - error_report("runstate name too big: %s", global_state.runstate); - trace_migrate_state_too_big(); - return -EINVAL; - } - return 0; -} - -void global_state_store_running(void) -{ - const char *state =3D RunState_lookup[RUN_STATE_RUNNING]; - strncpy((char *)global_state.runstate, - state, sizeof(global_state.runstate)); -} - -static bool global_state_received(void) -{ - return global_state.received; -} - -static RunState global_state_get_runstate(void) -{ - return global_state.state; -} - -void global_state_set_optional(void) -{ - global_state.optional =3D true; -} - -static bool global_state_needed(void *opaque) -{ - GlobalState *s =3D opaque; - char *runstate =3D (char *)s->runstate; - - /* If it is not optional, it is mandatory */ - - if (s->optional =3D=3D false) { - return true; - } - - /* If state is running or paused, it is not needed */ - - if (strcmp(runstate, "running") =3D=3D 0 || - strcmp(runstate, "paused") =3D=3D 0) { - return false; - } - - /* for any other state it is needed */ - return true; -} - -static int global_state_post_load(void *opaque, int version_id) -{ - GlobalState *s =3D opaque; - Error *local_err =3D NULL; - int r; - char *runstate =3D (char *)s->runstate; - - s->received =3D true; - trace_migrate_global_state_post_load(runstate); - - r =3D qapi_enum_parse(RunState_lookup, runstate, RUN_STATE__MAX, - -1, &local_err); - - if (r =3D=3D -1) { - if (local_err) { - error_report_err(local_err); - } - return -EINVAL; - } - s->state =3D r; - - return 0; -} - -static void global_state_pre_save(void *opaque) -{ - GlobalState *s =3D opaque; - - trace_migrate_global_state_pre_save((char *)s->runstate); - s->size =3D strlen((char *)s->runstate) + 1; -} - -static const VMStateDescription vmstate_globalstate =3D { - .name =3D "globalstate", - .version_id =3D 1, - .minimum_version_id =3D 1, - .post_load =3D global_state_post_load, - .pre_save =3D global_state_pre_save, - .needed =3D global_state_needed, - .fields =3D (VMStateField[]) { - VMSTATE_UINT32(size, GlobalState), - VMSTATE_BUFFER(runstate, GlobalState), - VMSTATE_END_OF_LIST() - }, -}; - -void register_global_state(void) -{ - /* We would use it independently that we receive it */ - strcpy((char *)&global_state.runstate, ""); - global_state.received =3D false; - vmstate_register(NULL, 0, &vmstate_globalstate, &global_state); -} - static void migrate_generate_event(int new_state) { if (migrate_use_events()) { diff --git a/migration/savevm.c b/migration/savevm.c index 1caf8ee..e7c05f3 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -39,6 +39,7 @@ #include "migration/snapshot.h" #include "migration/misc.h" #include "migration/register.h" +#include "migration/global_state.h" #include "ram.h" #include "qemu-file-channel.h" #include "qemu-file.h" diff --git a/vl.c b/vl.c index 605c98f..c0796e4 100644 --- a/vl.c +++ b/vl.c @@ -88,6 +88,7 @@ int main(int argc, char **argv) #include "hw/block/block.h" #include "migration/misc.h" #include "migration/snapshot.h" +#include "migration/global_state.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" #include "audio/audio.h" diff --git a/xen-common.c b/xen-common.c index fd2c928..172131a 100644 --- a/xen-common.c +++ b/xen-common.c @@ -14,6 +14,7 @@ #include "sysemu/char.h" #include "sysemu/accel.h" #include "migration/migration.h" +#include "migration/global_state.h" =20 //#define DEBUG_XEN =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159550038376.357261298533; Tue, 25 Apr 2017 15:32:30 -0700 (PDT) Received: from localhost ([::1]:51660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d390W-00054C-Gl for importer@patchew.org; Tue, 25 Apr 2017 18:32:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38b6-0007mN-58 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38b3-0006AY-QJ for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38b3-00069c-Gb for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 887C623E6D4 for ; Tue, 25 Apr 2017 22:06:08 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id D29431714E; Tue, 25 Apr 2017 22:06:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 887C623E6D4 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 887C623E6D4 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:46 +0200 Message-Id: <20170425220451.6028-37-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 25 Apr 2017 22:06:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 36/41] migration: Move more exported functions to migration/misc.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" Signed-off-by: Juan Quintela --- hw/i386/pc_piix.c | 2 +- hw/ppc/spapr.c | 2 +- include/migration/migration.h | 6 ------ include/migration/misc.h | 6 ++++++ migration/migration.c | 1 + qdev-monitor.c | 2 +- vl.c | 1 - xen-common.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 6c72bd3..d68859e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -53,7 +53,7 @@ #include "hw/xen/xen_pt.h" #endif #include "migration/global_state.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "kvm_i386.h" =20 #define MAX_IDE_BUS 2 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f779c35..74cea96 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -38,7 +38,7 @@ #include "sysemu/cpus.h" #include "sysemu/hw_accel.h" #include "kvm_ppc.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "migration/global_state.h" #include "migration/register.h" #include "mmu-hash64.h" diff --git a/include/migration/migration.h b/include/migration/migration.h index fc31f8e..1e18b24 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -127,8 +127,6 @@ void migrate_set_state(int *state, int old_state, int n= ew_state); =20 void migration_fd_process_incoming(QEMUFile *f); =20 -void qemu_start_incoming_migration(const char *uri, Error **errp); - uint64_t migrate_max_downtime(void); =20 void migrate_fd_error(MigrationState *s, const Error *error); @@ -140,7 +138,6 @@ void remove_migration_state_change_notifier(Notifier *n= otify); MigrationState *migrate_init(void); bool migration_is_blocked(Error **errp); bool migration_in_setup(MigrationState *); -bool migration_is_idle(void); bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); /* True if outgoing migration has entered postcopy phase */ @@ -176,7 +173,4 @@ void migrate_send_rp_pong(MigrationIncomingState *mis, void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rb= name, ram_addr_t start, size_t len); =20 -void savevm_skip_section_footers(void); -void savevm_skip_configuration(void); - #endif diff --git a/include/migration/misc.h b/include/migration/misc.h index 21a9182..6709b15 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -35,5 +35,11 @@ int64_t self_announce_delay(int round) /* migration/savevm.c */ =20 void dump_vmstate_json_to_file(FILE *out_fp); +void savevm_skip_section_footers(void); +void savevm_skip_configuration(void); + +/* migration/migration.c */ +void qemu_start_incoming_migration(const char *uri, Error **errp); +bool migration_is_idle(void); =20 #endif diff --git a/migration/migration.c b/migration/migration.c index 4cda97c..287b762 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -24,6 +24,7 @@ #include "ram.h" #include "rdma.h" #include "migration/global_state.h" +#include "migration/misc.h" #include "migration/migration.h" #include "savevm.h" #include "qemu-file-channel.h" diff --git a/qdev-monitor.c b/qdev-monitor.c index e61d596..5ab468f 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -29,7 +29,7 @@ #include "qemu/error-report.h" #include "qemu/help_option.h" #include "sysemu/block-backend.h" -#include "migration/migration.h" +#include "migration/misc.h" =20 /* * Aliases were a bad idea from the start. Let's keep them diff --git a/vl.c b/vl.c index c0796e4..d506c7e 100644 --- a/vl.c +++ b/vl.c @@ -92,7 +92,6 @@ int main(int argc, char **argv) #include "sysemu/tpm.h" #include "sysemu/dma.h" #include "audio/audio.h" -#include "migration/migration.h" #include "sysemu/cpus.h" #include "migration/colo.h" #include "sysemu/kvm.h" diff --git a/xen-common.c b/xen-common.c index 172131a..2daf2aa 100644 --- a/xen-common.c +++ b/xen-common.c @@ -13,7 +13,7 @@ #include "qmp-commands.h" #include "sysemu/char.h" #include "sysemu/accel.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "migration/global_state.h" =20 //#define DEBUG_XEN --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159661968140.16827446536752; Tue, 25 Apr 2017 15:34:21 -0700 (PDT) Received: from localhost ([::1]:51672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d392K-0006cj-KE for importer@patchew.org; Tue, 25 Apr 2017 18:34:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38b6-0007mO-RO for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38b6-0006Ds-01 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38b5-0006Cx-QU for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CEF7223E6D0 for ; Tue, 25 Apr 2017 22:06:10 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9A5B1714C; Tue, 25 Apr 2017 22:06:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CEF7223E6D0 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 CEF7223E6D0 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:47 +0200 Message-Id: <20170425220451.6028-38-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 25 Apr 2017 22:06:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 37/41] migration: Move last funtions to misc.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" After this, nothing outside of migration uses migration.h Signed-off-by: Juan Quintela --- include/migration/migration.h | 7 ------- include/migration/misc.h | 8 +++++++- ui/spice-core.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 1e18b24..735f565 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -133,17 +133,10 @@ void migrate_fd_error(MigrationState *s, const Error = *error); =20 void migrate_fd_connect(MigrationState *s); =20 -void add_migration_state_change_notifier(Notifier *notify); -void remove_migration_state_change_notifier(Notifier *notify); MigrationState *migrate_init(void); bool migration_is_blocked(Error **errp); -bool migration_in_setup(MigrationState *); -bool migration_has_finished(MigrationState *); -bool migration_has_failed(MigrationState *); /* True if outgoing migration has entered postcopy phase */ bool migration_in_postcopy(void); -/* ...and after the device transmission */ -bool migration_in_postcopy_after_devices(MigrationState *); MigrationState *migrate_get_current(void); =20 bool migrate_release_ram(void); diff --git a/include/migration/misc.h b/include/migration/misc.h index 6709b15..28f69be 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -41,5 +41,11 @@ void savevm_skip_configuration(void); /* migration/migration.c */ void qemu_start_incoming_migration(const char *uri, Error **errp); bool migration_is_idle(void); - +void add_migration_state_change_notifier(Notifier *notify); +void remove_migration_state_change_notifier(Notifier *notify); +bool migration_in_setup(MigrationState *); +bool migration_has_finished(MigrationState *); +bool migration_has_failed(MigrationState *); +/* ...and after the device transmission */ +bool migration_in_postcopy_after_devices(MigrationState *); #endif diff --git a/ui/spice-core.c b/ui/spice-core.c index 804abc5..a087ad5 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -35,7 +35,7 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp/qjson.h" #include "qemu/notify.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "hw/hw.h" #include "ui/spice-display.h" #include "qapi-event.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159362767101.3395572556791; Tue, 25 Apr 2017 15:29:22 -0700 (PDT) Received: from localhost ([::1]:51646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38xV-0002eo-Cd for importer@patchew.org; Tue, 25 Apr 2017 18:29:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38b9-0007oV-6P for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38b7-0006Fw-Qm for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36570) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38b7-0006Ev-Hz for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 885957AEA2 for ; Tue, 25 Apr 2017 22:06:12 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28E961714C; Tue, 25 Apr 2017 22:06:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 885957AEA2 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 885957AEA2 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:48 +0200 Message-Id: <20170425220451.6028-39-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Apr 2017 22:06:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 38/41] migration: Move migration.h to 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" Nothing uses it outside of migration.h Signed-off-by: Juan Quintela --- migration/block.c | 2 +- migration/channel.c | 2 +- migration/colo-comm.c | 2 +- migration/colo.c | 2 +- migration/exec.c | 2 +- migration/fd.c | 2 +- migration/migration.c | 2 +- {include/migration =3D> migration}/migration.h | 0 migration/postcopy-ram.c | 2 +- migration/qemu-file.c | 2 +- migration/ram.c | 2 +- migration/rdma.c | 2 +- migration/savevm.c | 2 +- migration/socket.c | 2 +- migration/tls.c | 2 +- migration/vmstate-types.c | 2 +- migration/vmstate.c | 2 +- tests/test-vmstate.c | 2 +- 18 files changed, 17 insertions(+), 17 deletions(-) rename {include/migration =3D> migration}/migration.h (100%) diff --git a/migration/block.c b/migration/block.c index 307f136..6457f25 100644 --- a/migration/block.c +++ b/migration/block.c @@ -25,7 +25,7 @@ #include "qemu/timer.h" #include "block.h" #include "migration/misc.h" -#include "migration/migration.h" +#include "migration.h" #include "migration/register.h" #include "sysemu/blockdev.h" #include "qemu-file.h" diff --git a/migration/channel.c b/migration/channel.c index 5a81a60..633423c 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" #include "channel.h" #include "tls.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file-channel.h" #include "trace.h" #include "qapi/error.h" diff --git a/migration/colo-comm.c b/migration/colo-comm.c index b4288b8..1acdb94 100644 --- a/migration/colo-comm.c +++ b/migration/colo-comm.c @@ -12,7 +12,7 @@ */ =20 #include "qemu/osdep.h" -#include "migration/migration.h" +#include "migration.h" #include "migration/vmstate.h" #include "colo.h" #include "trace.h" diff --git a/migration/colo.c b/migration/colo.c index 3757ad9..72001a5 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -14,7 +14,7 @@ #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "qemu-file-channel.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file.h" #include "migration/savevm.h" #include "migration/colo.h" diff --git a/migration/exec.c b/migration/exec.c index c532c56..074943a 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -22,7 +22,7 @@ #include "qemu-common.h" #include "channel.h" #include "exec.h" -#include "migration/migration.h" +#include "migration.h" #include "io/channel-command.h" #include "trace.h" =20 diff --git a/migration/fd.c b/migration/fd.c index 8a04dcd..b2384bf 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -19,7 +19,7 @@ #include "qemu-common.h" #include "channel.h" #include "fd.h" -#include "migration/migration.h" +#include "migration.h" #include "monitor/monitor.h" #include "io/channel-util.h" #include "trace.h" diff --git a/migration/migration.c b/migration/migration.c index 287b762..fccd779 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -25,7 +25,7 @@ #include "rdma.h" #include "migration/global_state.h" #include "migration/misc.h" -#include "migration/migration.h" +#include "migration.h" #include "savevm.h" #include "qemu-file-channel.h" #include "qemu-file.h" diff --git a/include/migration/migration.h b/migration/migration.h similarity index 100% rename from include/migration/migration.h rename to migration/migration.h diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index cae5d48..bd23971 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" =20 #include "qemu-common.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file.h" #include "savevm.h" #include "postcopy-ram.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index ab26f4e..e65c373 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -28,7 +28,7 @@ #include "qemu/iov.h" #include "qemu/sockets.h" #include "qemu/coroutine.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file.h" #include "trace.h" =20 diff --git a/migration/ram.c b/migration/ram.c index b6cef70..14104f1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -37,7 +37,7 @@ #include "qemu/main-loop.h" #include "xbzrle.h" #include "ram.h" -#include "migration/migration.h" +#include "migration.h" #include "migration/register.h" #include "migration/misc.h" #include "qemu-file.h" diff --git a/migration/rdma.c b/migration/rdma.c index f8fea9b..1d91266 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -18,7 +18,7 @@ #include "qemu-common.h" #include "qemu/cutils.h" #include "rdma.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file.h" #include "ram.h" #include "qemu-file-channel.h" diff --git a/migration/savevm.c b/migration/savevm.c index e7c05f3..03ff007 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -35,7 +35,7 @@ #include "net/net.h" #include "sysemu/sysemu.h" #include "qemu/timer.h" -#include "migration/migration.h" +#include "migration.h" #include "migration/snapshot.h" #include "migration/misc.h" #include "migration/register.h" diff --git a/migration/socket.c b/migration/socket.c index acb3f0d..cc3d977 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -21,7 +21,7 @@ #include "qapi/error.h" #include "channel.h" #include "socket.h" -#include "migration/migration.h" +#include "migration.h" #include "qemu-file.h" #include "io/channel-socket.h" #include "trace.h" diff --git a/migration/tls.c b/migration/tls.c index d3abd6e..596e879 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -20,7 +20,7 @@ =20 #include "qemu/osdep.h" #include "channel.h" -#include "migration/migration.h" +#include "migration.h" #include "tls.h" #include "io/channel-tls.h" #include "crypto/tlscreds.h" diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c index c2bd334..0c92b23 100644 --- a/migration/vmstate-types.c +++ b/migration/vmstate-types.c @@ -29,7 +29,7 @@ #include "qemu-common.h" #include "exec/cpu-common.h" #include "qemu-file.h" -#include "migration/migration.h" +#include "migration.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 4b0cb2f..ec9d0f89 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -27,7 +27,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" -#include "migration/migration.h" +#include "migration.h" #include "migration/vmstate.h" #include "migration/savevm.h" #include "qemu-file.h" diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index f30433a..ee292c7 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" =20 #include "qemu-common.h" -#include "migration/migration.h" +#include "../migration/migration.h" #include "migration/vmstate.h" #include "migration/qemu-file-types.h" #include "../migration/qemu-file.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159216709986.0902746995672; Tue, 25 Apr 2017 15:26:56 -0700 (PDT) Received: from localhost ([::1]:51634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38v8-0000K0-SI for importer@patchew.org; Tue, 25 Apr 2017 18:26:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38bA-0007pW-Bx for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38b9-0006He-Gi for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38b9-0006Gp-8X for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 344EB93308 for ; Tue, 25 Apr 2017 22:06:14 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB5FA1714C; Tue, 25 Apr 2017 22:06:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 344EB93308 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 344EB93308 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:49 +0200 Message-Id: <20170425220451.6028-40-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:06:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 39/41] exec: Create include for target_page_size() 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" That is the only function that we need from exec.c, and having to include the whole sysemu.h for this. Signed-off-by: Juan Quintela --- exec.c | 1 + include/exec/target_page.h | 20 ++++++++++++++++++++ include/sysemu/sysemu.h | 1 - migration/migration.c | 1 + migration/postcopy-ram.c | 1 + migration/savevm.c | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 include/exec/target_page.h diff --git a/exec.c b/exec.c index eac6085..e9a201a 100644 --- a/exec.c +++ b/exec.c @@ -24,6 +24,7 @@ #include "qemu/cutils.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "tcg.h" #include "hw/qdev-core.h" #if !defined(CONFIG_USER_ONLY) diff --git a/include/exec/target_page.h b/include/exec/target_page.h new file mode 100644 index 0000000..0961591 --- /dev/null +++ b/include/exec/target_page.h @@ -0,0 +1,20 @@ + + /* + * QEMU exec target page sizes + * + * 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 EXEC_TARGET_PAGE_H +#define EXEC_TARGET_PAGE_H + +size_t qemu_target_page_size(void); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 503b51f..5970ca4 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -67,7 +67,6 @@ int qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); void qemu_system_reset(bool report); void qemu_system_guest_panicked(GuestPanicInformation *info); -size_t qemu_target_page_size(void); =20 void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); diff --git a/migration/migration.c b/migration/migration.c index fccd779..38740b4 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -45,6 +45,7 @@ #include "qom/cpu.h" #include "exec/memory.h" #include "exec/address-spaces.h" +#include "exec/target_page.h" #include "io/channel-buffer.h" #include "colo.h" =20 diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index bd23971..88e1646 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" =20 #include "qemu-common.h" +#include "exec/target_page.h" #include "migration.h" #include "qemu-file.h" #include "savevm.h" diff --git a/migration/savevm.c b/migration/savevm.c index 03ff007..6a47dcd 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -50,6 +50,7 @@ #include "qemu/queue.h" #include "sysemu/cpus.h" #include "exec/memory.h" +#include "exec/target_page.h" #include "qmp-commands.h" #include "trace.h" #include "qemu/bitops.h" --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159462337937.6311577160994; Tue, 25 Apr 2017 15:31:02 -0700 (PDT) Received: from localhost ([::1]:51655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38z7-00042n-0L for importer@patchew.org; Tue, 25 Apr 2017 18:31:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38bE-0007tp-Gn for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38bB-0006JH-4g for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38bA-0006IJ-S2 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC4723D97F for ; Tue, 25 Apr 2017 22:06:15 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87A0E1714C; Tue, 25 Apr 2017 22:06:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC4723D97F 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 DC4723D97F From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:50 +0200 Message-Id: <20170425220451.6028-41-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 22:06:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 40/41] migration: Make savevm.c target independent 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" It only needed TARGET_PAGE_SIZE/BITS/BITS_MIN values, so just export them from exec.h Signed-off-by: Juan Quintela --- Makefile.target | 2 +- exec.c | 9 +++++++++ include/exec/target_page.h | 2 ++ migration/Makefile.objs | 2 +- migration/savevm.c | 14 +++++++------- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Makefile.target b/Makefile.target index e62021d..4020b01 100644 --- a/Makefile.target +++ b/Makefile.target @@ -146,7 +146,7 @@ obj-$(CONFIG_KVM) +=3D kvm-all.o obj-y +=3D memory.o cputlb.o obj-y +=3D memory_mapping.o obj-y +=3D dump.o -obj-y +=3D migration/ram.o migration/savevm.o +obj-y +=3D migration/ram.o LIBS :=3D $(libs_softmmu) $(LIBS) =20 # xen support diff --git a/exec.c b/exec.c index e9a201a..447ac63 100644 --- a/exec.c +++ b/exec.c @@ -3387,6 +3387,15 @@ size_t qemu_target_page_size(void) return TARGET_PAGE_SIZE; } =20 +int qemu_target_page_bits(void) +{ + return TARGET_PAGE_BITS; +} + +int qemu_target_page_bits_min(void) +{ + return TARGET_PAGE_BITS_MIN; +} #endif =20 /* diff --git a/include/exec/target_page.h b/include/exec/target_page.h index 0961591..e3a19cc 100644 --- a/include/exec/target_page.h +++ b/include/exec/target_page.h @@ -16,5 +16,7 @@ #define EXEC_TARGET_PAGE_H =20 size_t qemu_target_page_size(void); +int qemu_target_page_bits(void); +int qemu_target_page_bits_min(void); =20 #endif diff --git a/migration/Makefile.objs b/migration/Makefile.objs index 775e4ad..4277c88 100644 --- a/migration/Makefile.objs +++ b/migration/Makefile.objs @@ -1,5 +1,5 @@ common-obj-y +=3D migration.o socket.o fd.o exec.o -common-obj-y +=3D tls.o channel.o +common-obj-y +=3D tls.o channel.o savevm.o common-obj-y +=3D colo-comm.o colo.o colo-failover.o common-obj-y +=3D vmstate.o vmstate-types.o page_cache.o common-obj-y +=3D qemu-file.o global_state.o diff --git a/migration/savevm.c b/migration/savevm.c index 6a47dcd..2e5f6a4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -27,7 +27,6 @@ */ =20 #include "qemu/osdep.h" -#include "cpu.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/qdev.h" @@ -315,7 +314,7 @@ static void configuration_pre_save(void *opaque) =20 state->len =3D strlen(current_name); state->name =3D current_name; - state->target_page_bits =3D TARGET_PAGE_BITS; + state->target_page_bits =3D qemu_target_page_bits(); } =20 static int configuration_pre_load(void *opaque) @@ -326,7 +325,7 @@ static int configuration_pre_load(void *opaque) * predates the variable-target-page-bits support and is using the * minimum possible value for this CPU. */ - state->target_page_bits =3D TARGET_PAGE_BITS_MIN; + state->target_page_bits =3D qemu_target_page_bits_min(); return 0; } =20 @@ -341,9 +340,9 @@ static int configuration_post_load(void *opaque, int ve= rsion_id) return -EINVAL; } =20 - if (state->target_page_bits !=3D TARGET_PAGE_BITS) { + if (state->target_page_bits !=3D qemu_target_page_bits()) { error_report("Received TARGET_PAGE_BITS is %d but local is %d", - state->target_page_bits, TARGET_PAGE_BITS); + state->target_page_bits, qemu_target_page_bits()); return -EINVAL; } =20 @@ -359,7 +358,8 @@ static int configuration_post_load(void *opaque, int ve= rsion_id) */ static bool vmstate_target_page_bits_needed(void *opaque) { - return TARGET_PAGE_BITS > TARGET_PAGE_BITS_MIN; + return qemu_target_page_bits() + > qemu_target_page_bits_min(); } =20 static const VMStateDescription vmstate_target_page_bits =3D { @@ -1165,7 +1165,7 @@ void qemu_savevm_state_complete_precopy(QEMUFile *f, = bool iterable_only) } =20 vmdesc =3D qjson_new(); - json_prop_int(vmdesc, "page_size", TARGET_PAGE_SIZE); + json_prop_int(vmdesc, "page_size", qemu_target_page_size()); json_start_array(vmdesc, "devices"); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { =20 --=20 2.9.3 From nobody Tue May 7 18:24:26 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 1493159486769297.43737314435225; Tue, 25 Apr 2017 15:31:26 -0700 (PDT) Received: from localhost ([::1]:51657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38zV-0004Js-CU for importer@patchew.org; Tue, 25 Apr 2017 18:31:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d38bG-0007wH-U3 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d38bC-0006Ky-Qx for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49602) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d38bC-0006K5-Hp for qemu-devel@nongnu.org; Tue, 25 Apr 2017 18:06:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9101C80043 for ; Tue, 25 Apr 2017 22:06:17 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B13A1714C; Tue, 25 Apr 2017 22:06:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9101C80043 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 9101C80043 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 00:04:51 +0200 Message-Id: <20170425220451.6028-42-quintela@redhat.com> In-Reply-To: <20170425220451.6028-1-quintela@redhat.com> References: <20170425220451.6028-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 22:06:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 41/41] migration: Remove unneeded includes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 --- include/migration/misc.h | 2 ++ migration/block.c | 6 ------ migration/colo-failover.c | 2 ++ migration/colo.c | 2 -- migration/colo.h | 3 --- migration/exec.c | 2 -- migration/fd.c | 2 -- migration/global_state.c | 1 - migration/migration.c | 6 ------ migration/migration.h | 2 -- migration/postcopy-ram.c | 4 +--- migration/qemu-file.c | 2 -- migration/ram.c | 4 ---- migration/savevm.c | 6 ------ 14 files changed, 5 insertions(+), 39 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 28f69be..5c62e92 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -14,6 +14,8 @@ #ifndef MIGRATION_MISC_H #define MIGRATION_MISC_H =20 +#include "qemu/notify.h" + /* migration/ram.c */ =20 void ram_mig_init(void); diff --git a/migration/block.c b/migration/block.c index 6457f25..5c89436 100644 --- a/migration/block.c +++ b/migration/block.c @@ -15,19 +15,13 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" -#include "block/block.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" -#include "hw/hw.h" #include "qemu/cutils.h" #include "qemu/queue.h" -#include "qemu/timer.h" #include "block.h" #include "migration/misc.h" #include "migration.h" #include "migration/register.h" -#include "sysemu/blockdev.h" #include "qemu-file.h" #include "migration/vmstate.h" #include "sysemu/block-backend.h" diff --git a/migration/colo-failover.c b/migration/colo-failover.c index 85c4526..9f2fb71 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -11,7 +11,9 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "colo.h" +#include "migration.h" #include "colo-failover.h" #include "qmp-commands.h" #include "qapi/qmp/qerror.h" diff --git a/migration/colo.c b/migration/colo.c index 72001a5..4f41d2a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -11,7 +11,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/timer.h" #include "sysemu/sysemu.h" #include "qemu-file-channel.h" #include "migration.h" @@ -21,7 +20,6 @@ #include "io/channel-buffer.h" #include "trace.h" #include "qemu/error-report.h" -#include "qapi/error.h" #include "colo-failover.h" #include "replication.h" #include "qmp-commands.h" diff --git a/migration/colo.h b/migration/colo.h index ba0bb6e..be6beba 100644 --- a/migration/colo.h +++ b/migration/colo.h @@ -14,9 +14,6 @@ #define QEMU_COLO_H =20 #include "qemu-common.h" -#include "qemu/coroutine_int.h" -#include "qemu/thread.h" -#include "qemu/main-loop.h" =20 bool colo_supported(void); void colo_info_init(void); diff --git a/migration/exec.c b/migration/exec.c index 074943a..6d535dc 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -19,10 +19,8 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" #include "channel.h" #include "exec.h" -#include "migration.h" #include "io/channel-command.h" #include "trace.h" =20 diff --git a/migration/fd.c b/migration/fd.c index b2384bf..30f5258 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -16,10 +16,8 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" #include "channel.h" #include "fd.h" -#include "migration.h" #include "monitor/monitor.h" #include "io/channel-util.h" #include "trace.h" diff --git a/migration/global_state.c b/migration/global_state.c index 3d67ba2..bf82aa7 100644 --- a/migration/global_state.c +++ b/migration/global_state.c @@ -20,7 +20,6 @@ #include "qapi/util.h" #include "migration/global_state.h" #include "migration/vmstate.h" -#include "sysemu/sysemu.h" #include "trace.h" =20 typedef struct { diff --git a/migration/migration.c b/migration/migration.c index 38740b4..83caa58 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -16,7 +16,6 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "migration/blocker.h" #include "exec.h" #include "fd.h" @@ -30,11 +29,9 @@ #include "qemu-file-channel.h" #include "qemu-file.h" #include "migration/vmstate.h" -#include "sysemu/sysemu.h" #include "block/block.h" #include "qapi/qmp/qerror.h" #include "qapi/util.h" -#include "qemu/sockets.h" #include "qemu/rcu.h" #include "block.h" #include "postcopy-ram.h" @@ -42,9 +39,6 @@ #include "qmp-commands.h" #include "trace.h" #include "qapi-event.h" -#include "qom/cpu.h" -#include "exec/memory.h" -#include "exec/address-spaces.h" #include "exec/target_page.h" #include "io/channel-buffer.h" #include "colo.h" diff --git a/migration/migration.h b/migration/migration.h index 735f565..f6bac81 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -14,10 +14,8 @@ #ifndef QEMU_MIGRATION_H #define QEMU_MIGRATION_H =20 -#include "qapi/qmp/qdict.h" #include "qemu-common.h" #include "qemu/thread.h" -#include "qemu/notify.h" #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 88e1646..e9a0b5c 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -17,14 +17,12 @@ */ =20 #include "qemu/osdep.h" - -#include "qemu-common.h" #include "exec/target_page.h" #include "migration.h" #include "qemu-file.h" -#include "savevm.h" #include "postcopy-ram.h" #include "ram.h" +#include "savevm.h" #include "sysemu/sysemu.h" #include "sysemu/balloon.h" #include "qemu/error-report.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index e65c373..2ab2bf3 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -26,8 +26,6 @@ #include "qemu-common.h" #include "qemu/error-report.h" #include "qemu/iov.h" -#include "qemu/sockets.h" -#include "qemu/coroutine.h" #include "migration.h" #include "qemu-file.h" #include "trace.h" diff --git a/migration/ram.c b/migration/ram.c index 14104f1..1d69f64 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -26,14 +26,12 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "cpu.h" #include #include "qapi-event.h" #include "qemu/cutils.h" #include "qemu/bitops.h" #include "qemu/bitmap.h" -#include "qemu/timer.h" #include "qemu/main-loop.h" #include "xbzrle.h" #include "ram.h" @@ -41,9 +39,7 @@ #include "migration/register.h" #include "migration/misc.h" #include "qemu-file.h" -#include "migration/vmstate.h" #include "postcopy-ram.h" -#include "exec/address-spaces.h" #include "migration/page_cache.h" #include "qemu/error-report.h" #include "trace.h" diff --git a/migration/savevm.c b/migration/savevm.c index 2e5f6a4..a84883f 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -28,12 +28,8 @@ =20 #include "qemu/osdep.h" #include "hw/boards.h" -#include "hw/hw.h" -#include "hw/qdev.h" #include "hw/xen/xen.h" #include "net/net.h" -#include "sysemu/sysemu.h" -#include "qemu/timer.h" #include "migration.h" #include "migration/snapshot.h" #include "migration/misc.h" @@ -46,13 +42,11 @@ #include "postcopy-ram.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" -#include "qemu/queue.h" #include "sysemu/cpus.h" #include "exec/memory.h" #include "exec/target_page.h" #include "qmp-commands.h" #include "trace.h" -#include "qemu/bitops.h" #include "qemu/iov.h" #include "block/snapshot.h" #include "qemu/cutils.h" --=20 2.9.3