Skip to content

Commit

Permalink
migration: Create migration/blocker.h
Browse files Browse the repository at this point in the history
This allows us to remove lots of includes of migration/migration.h

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
Juan Quintela committed May 17, 2017
1 parent bb890ed commit 795c40b
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 35 deletions.
2 changes: 1 addition & 1 deletion block/qcow.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <zlib.h>
#include "qapi/qmp/qerror.h"
#include "crypto/cipher.h"
#include "migration/migration.h"
#include "migration/blocker.h"

/**************************************************************/
/* QEMU COW block driver with compression and encryption support */
Expand Down
2 changes: 1 addition & 1 deletion block/vdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion block/vhdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/* Options for VHDX creation */
Expand Down
2 changes: 1 addition & 1 deletion block/vmdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <zlib.h>

Expand Down
2 changes: 1 addition & 1 deletion block/vpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion block/vvfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion hw/9pfs/9p.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "9p-xattr.h"
#include "coth.h"
#include "trace.h"
#include "migration/migration.h"
#include "migration/blocker.h"

int open_fd_hw;
int total_open_fd;
Expand Down
2 changes: 1 addition & 1 deletion hw/display/qxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

#include "qxl.h"
Expand Down
2 changes: 1 addition & 1 deletion hw/display/virtio-gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion hw/intc/arm_gic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion hw/intc/arm_gicv3_its_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "sysemu/sysemu.h"
#include "sysemu/kvm.h"
#include "kvm_arm.h"
#include "migration/migration.h"
#include "migration/blocker.h"

#define TYPE_KVM_ARM_ITS "arm-its-kvm"
#define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_ITS)
Expand Down
2 changes: 1 addition & 1 deletion hw/intc/arm_gicv3_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "kvm_arm.h"
#include "gicv3_internal.h"
#include "vgic_common.h"
#include "migration/migration.h"
#include "migration/blocker.h"

#ifdef DEBUG_GICV3_KVM
#define DPRINTF(fmt, ...) \
Expand Down
2 changes: 1 addition & 1 deletion hw/misc/ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion hw/scsi/vhost-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion hw/virtio/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/* enabled until disconnected backend stabilizes */
Expand Down
35 changes: 35 additions & 0 deletions include/migration/blocker.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* QEMU migration blockers
*
* Copyright IBM, Corp. 2008
*
* Authors:
* Anthony Liguori <[email protected]>
*
* 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
18 changes: 0 additions & 18 deletions include/migration/migration.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,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);

/**
* @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);

int check_migratable(Object *obj, Error **err);

bool migrate_release_ram(void);
Expand Down
1 change: 1 addition & 0 deletions migration/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion stubs/migr-blocker.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "migration/migration.h"
#include "migration/blocker.h"

int migrate_add_blocker(Error *reason, Error **errp)
{
Expand Down
2 changes: 1 addition & 1 deletion target/i386/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 795c40b

Please sign in to comment.