qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

migration: Create migration/blocker.h

This allows us to remove lots of includes of migration/migration.h

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

+53 -35
+1 -1
block/qcow.c
··· 32 32 #include <zlib.h> 33 33 #include "qapi/qmp/qerror.h" 34 34 #include "crypto/cipher.h" 35 - #include "migration/migration.h" 35 + #include "migration/blocker.h" 36 36 37 37 /**************************************************************/ 38 38 /* QEMU COW block driver with compression and encryption support */
+1 -1
block/vdi.c
··· 55 55 #include "sysemu/block-backend.h" 56 56 #include "qemu/module.h" 57 57 #include "qemu/bswap.h" 58 - #include "migration/migration.h" 58 + #include "migration/blocker.h" 59 59 #include "qemu/coroutine.h" 60 60 #include "qemu/cutils.h" 61 61 #include "qemu/uuid.h"
+1 -1
block/vhdx.c
··· 24 24 #include "qemu/crc32c.h" 25 25 #include "qemu/bswap.h" 26 26 #include "block/vhdx.h" 27 - #include "migration/migration.h" 27 + #include "migration/blocker.h" 28 28 #include "qemu/uuid.h" 29 29 30 30 /* Options for VHDX creation */
+1 -1
block/vmdk.c
··· 31 31 #include "qemu/error-report.h" 32 32 #include "qemu/module.h" 33 33 #include "qemu/bswap.h" 34 - #include "migration/migration.h" 34 + #include "migration/blocker.h" 35 35 #include "qemu/cutils.h" 36 36 #include <zlib.h> 37 37
+1 -1
block/vpc.c
··· 28 28 #include "block/block_int.h" 29 29 #include "sysemu/block-backend.h" 30 30 #include "qemu/module.h" 31 - #include "migration/migration.h" 31 + #include "migration/blocker.h" 32 32 #include "qemu/bswap.h" 33 33 #include "qemu/uuid.h" 34 34
+1 -1
block/vvfat.c
··· 28 28 #include "block/block_int.h" 29 29 #include "qemu/module.h" 30 30 #include "qemu/bswap.h" 31 - #include "migration/migration.h" 31 + #include "migration/blocker.h" 32 32 #include "qapi/qmp/qint.h" 33 33 #include "qapi/qmp/qbool.h" 34 34 #include "qapi/qmp/qstring.h"
+1 -1
hw/9pfs/9p.c
··· 23 23 #include "9p-xattr.h" 24 24 #include "coth.h" 25 25 #include "trace.h" 26 - #include "migration/migration.h" 26 + #include "migration/blocker.h" 27 27 28 28 int open_fd_hw; 29 29 int total_open_fd;
+1 -1
hw/display/qxl.c
··· 26 26 #include "qemu/queue.h" 27 27 #include "qemu/atomic.h" 28 28 #include "sysemu/sysemu.h" 29 - #include "migration/migration.h" 29 + #include "migration/blocker.h" 30 30 #include "trace.h" 31 31 32 32 #include "qxl.h"
+1 -1
hw/display/virtio-gpu.c
··· 19 19 #include "hw/virtio/virtio.h" 20 20 #include "hw/virtio/virtio-gpu.h" 21 21 #include "hw/virtio/virtio-bus.h" 22 - #include "migration/migration.h" 22 + #include "migration/blocker.h" 23 23 #include "qemu/log.h" 24 24 #include "qapi/error.h" 25 25
+1 -1
hw/intc/arm_gic_kvm.c
··· 24 24 #include "qemu-common.h" 25 25 #include "cpu.h" 26 26 #include "hw/sysbus.h" 27 - #include "migration/migration.h" 27 + #include "migration/blocker.h" 28 28 #include "sysemu/kvm.h" 29 29 #include "kvm_arm.h" 30 30 #include "gic_internal.h"
+1 -1
hw/intc/arm_gicv3_its_kvm.c
··· 24 24 #include "sysemu/sysemu.h" 25 25 #include "sysemu/kvm.h" 26 26 #include "kvm_arm.h" 27 - #include "migration/migration.h" 27 + #include "migration/blocker.h" 28 28 29 29 #define TYPE_KVM_ARM_ITS "arm-its-kvm" 30 30 #define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_ITS)
+1 -1
hw/intc/arm_gicv3_kvm.c
··· 28 28 #include "kvm_arm.h" 29 29 #include "gicv3_internal.h" 30 30 #include "vgic_common.h" 31 - #include "migration/migration.h" 31 + #include "migration/blocker.h" 32 32 33 33 #ifdef DEBUG_GICV3_KVM 34 34 #define DPRINTF(fmt, ...) \
+1 -1
hw/misc/ivshmem.c
··· 25 25 #include "hw/pci/msi.h" 26 26 #include "hw/pci/msix.h" 27 27 #include "sysemu/kvm.h" 28 - #include "migration/migration.h" 28 + #include "migration/blocker.h" 29 29 #include "qemu/error-report.h" 30 30 #include "qemu/event_notifier.h" 31 31 #include "qom/object_interfaces.h"
+1 -1
hw/scsi/vhost-scsi.c
··· 21 21 #include "qemu/error-report.h" 22 22 #include "qemu/queue.h" 23 23 #include "monitor/monitor.h" 24 - #include "migration/migration.h" 24 + #include "migration/blocker.h" 25 25 #include "hw/virtio/vhost-scsi.h" 26 26 #include "hw/virtio/vhost.h" 27 27 #include "hw/virtio/virtio-scsi.h"
+1 -1
hw/virtio/vhost.c
··· 25 25 #include "exec/address-spaces.h" 26 26 #include "hw/virtio/virtio-bus.h" 27 27 #include "hw/virtio/virtio-access.h" 28 - #include "migration/migration.h" 28 + #include "migration/blocker.h" 29 29 #include "sysemu/dma.h" 30 30 31 31 /* enabled until disconnected backend stabilizes */
+35
include/migration/blocker.h
··· 1 + /* 2 + * QEMU migration blockers 3 + * 4 + * Copyright IBM, Corp. 2008 5 + * 6 + * Authors: 7 + * Anthony Liguori <aliguori@us.ibm.com> 8 + * 9 + * This work is licensed under the terms of the GNU GPL, version 2. See 10 + * the COPYING file in the top-level directory. 11 + * 12 + */ 13 + 14 + #ifndef MIGRATION_BLOCKER_H 15 + #define MIGRATION_BLOCKER_H 16 + 17 + /** 18 + * @migrate_add_blocker - prevent migration from proceeding 19 + * 20 + * @reason - an error to be returned whenever migration is attempted 21 + * 22 + * @errp - [out] The reason (if any) we cannot block migration right now. 23 + * 24 + * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set. 25 + */ 26 + int migrate_add_blocker(Error *reason, Error **errp); 27 + 28 + /** 29 + * @migrate_del_blocker - remove a blocking error from migration 30 + * 31 + * @reason - the error blocking migration 32 + */ 33 + void migrate_del_blocker(Error *reason); 34 + 35 + #endif
-18
include/migration/migration.h
··· 275 275 int ram_postcopy_incoming_init(MigrationIncomingState *mis); 276 276 void ram_postcopy_migrated_memory_release(MigrationState *ms); 277 277 278 - /** 279 - * @migrate_add_blocker - prevent migration from proceeding 280 - * 281 - * @reason - an error to be returned whenever migration is attempted 282 - * 283 - * @errp - [out] The reason (if any) we cannot block migration right now. 284 - * 285 - * @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set. 286 - */ 287 - int migrate_add_blocker(Error *reason, Error **errp); 288 - 289 - /** 290 - * @migrate_del_blocker - remove a blocking error from migration 291 - * 292 - * @reason - the error blocking migration 293 - */ 294 - void migrate_del_blocker(Error *reason); 295 - 296 278 int check_migratable(Object *obj, Error **err); 297 279 298 280 bool migrate_release_ram(void);
+1
migration/migration.c
··· 17 17 #include "qemu/cutils.h" 18 18 #include "qemu/error-report.h" 19 19 #include "qemu/main-loop.h" 20 + #include "migration/blocker.h" 20 21 #include "migration/migration.h" 21 22 #include "migration/qemu-file.h" 22 23 #include "sysemu/sysemu.h"
+1 -1
stubs/migr-blocker.c
··· 1 1 #include "qemu/osdep.h" 2 2 #include "qemu-common.h" 3 - #include "migration/migration.h" 3 + #include "migration/blocker.h" 4 4 5 5 int migrate_add_blocker(Error *reason, Error **errp) 6 6 {
+1 -1
target/i386/kvm.c
··· 43 43 #include "standard-headers/asm-x86/hyperv.h" 44 44 #include "hw/pci/pci.h" 45 45 #include "hw/pci/msi.h" 46 - #include "migration/migration.h" 46 + #include "migration/blocker.h" 47 47 #include "exec/memattrs.h" 48 48 #include "trace.h" 49 49