diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block.h | 2 | ||||
-rw-r--r-- | include/block/block_int.h | 8 | ||||
-rw-r--r-- | include/exec/ram_addr.h | 13 | ||||
-rw-r--r-- | include/hw/s390x/3270-ccw.h | 53 | ||||
-rw-r--r-- | include/hw/s390x/css.h | 2 | ||||
-rw-r--r-- | include/hw/s390x/s390-virtio-ccw.h | 1 | ||||
-rw-r--r-- | include/migration/cpu.h | 7 | ||||
-rw-r--r-- | include/migration/migration.h | 3 | ||||
-rw-r--r-- | include/migration/postcopy-ram.h | 94 | ||||
-rw-r--r-- | include/migration/vmstate.h | 18 | ||||
-rw-r--r-- | include/sysemu/block-backend.h | 4 | ||||
-rw-r--r-- | include/sysemu/char.h | 8 | ||||
-rw-r--r-- | include/sysemu/sysemu.h | 5 |
13 files changed, 109 insertions, 109 deletions
diff --git a/include/block/block.h b/include/block/block.h index 144df0ddfb..862eb56fc7 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -294,7 +294,7 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char *backing_file); int bdrv_get_backing_file_depth(BlockDriverState *bs); void bdrv_refresh_filename(BlockDriverState *bs); -int bdrv_truncate(BdrvChild *child, int64_t offset); +int bdrv_truncate(BdrvChild *child, int64_t offset, Error **errp); int64_t bdrv_nb_sectors(BlockDriverState *bs); int64_t bdrv_getlength(BlockDriverState *bs); int64_t bdrv_get_allocated_file_size(BlockDriverState *bs); diff --git a/include/block/block_int.h b/include/block/block_int.h index 4f8cd29ae4..87739405d5 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -196,7 +196,7 @@ struct BlockDriver { int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs); const char *protocol_name; - int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset); + int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset, Error **errp); int64_t (*bdrv_getlength)(BlockDriverState *bs); bool has_variable_length; @@ -252,7 +252,7 @@ struct BlockDriver { * Returns 0 for completed check, -errno for internal errors. * The check results are stored in result. */ - int (*bdrv_check)(BlockDriverState* bs, BdrvCheckResult *result, + int (*bdrv_check)(BlockDriverState *bs, BdrvCheckResult *result, BdrvCheckMode fix); int (*bdrv_amend_options)(BlockDriverState *bs, QemuOpts *opts, @@ -454,13 +454,13 @@ struct BdrvChildRole { /* Returns a name that is supposedly more useful for human users than the * node name for identifying the node in question (in particular, a BB * name), or NULL if the parent can't provide a better name. */ - const char* (*get_name)(BdrvChild *child); + const char *(*get_name)(BdrvChild *child); /* Returns a malloced string that describes the parent of the child for a * human reader. This could be a node-name, BlockBackend name, qdev ID or * QOM path of the device owning the BlockBackend, job type and ID etc. The * caller is responsible for freeing the memory. */ - char* (*get_parent_desc)(BdrvChild *child); + char *(*get_parent_desc)(BdrvChild *child); /* * If this pair of functions is implemented, the parent doesn't issue new diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index dbe2f08d47..140efa840c 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -39,6 +39,14 @@ struct RAMBlock { QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers; int fd; size_t page_size; + /* dirty bitmap used during migration */ + unsigned long *bmap; + /* bitmap of pages that haven't been sent even once + * only maintained and used in postcopy at the moment + * where it's used to send the dirtymap at the start + * of the postcopy phase + */ + unsigned long *unsentmap; }; static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset) @@ -360,16 +368,15 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start, static inline -uint64_t cpu_physical_memory_sync_dirty_bitmap(unsigned long *dest, - RAMBlock *rb, +uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb, ram_addr_t start, ram_addr_t length, uint64_t *real_dirty_pages) { ram_addr_t addr; - start = rb->offset + start; unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS); uint64_t num_dirty = 0; + unsigned long *dest = rb->bmap; /* start address is aligned at the start of a word? */ if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) { diff --git a/include/hw/s390x/3270-ccw.h b/include/hw/s390x/3270-ccw.h new file mode 100644 index 0000000000..46bee2533c --- /dev/null +++ b/include/hw/s390x/3270-ccw.h @@ -0,0 +1,53 @@ +/* + * Emulated ccw-attached 3270 definitions + * + * Copyright 2017 IBM Corp. + * Author(s): Yang Chen <bjcyang@linux.vnet.ibm.com> + * Jing Liu <liujbjl@linux.vnet.ibm.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or (at + * your option) any later version. See the COPYING file in the top-level + * directory. + */ + +#ifndef HW_S390X_3270_CCW_H +#define HW_S390X_3270_CCW_H + +#include "hw/sysbus.h" +#include "hw/s390x/css.h" +#include "hw/s390x/ccw-device.h" + +#define EMULATED_CCW_3270_CU_TYPE 0x3270 +#define EMULATED_CCW_3270_CHPID_TYPE 0x1a + +#define TYPE_EMULATED_CCW_3270 "emulated-ccw-3270" + +/* Local Channel Commands */ +#define TC_WRITE 0x01 /* Write */ +#define TC_RDBUF 0x02 /* Read buffer */ +#define TC_EWRITE 0x05 /* Erase write */ +#define TC_READMOD 0x06 /* Read modified */ +#define TC_EWRITEA 0x0d /* Erase write alternate */ +#define TC_WRITESF 0x11 /* Write structured field */ + +#define EMULATED_CCW_3270(obj) \ + OBJECT_CHECK(EmulatedCcw3270Device, (obj), TYPE_EMULATED_CCW_3270) +#define EMULATED_CCW_3270_CLASS(klass) \ + OBJECT_CLASS_CHECK(EmulatedCcw3270Class, (klass), TYPE_EMULATED_CCW_3270) +#define EMULATED_CCW_3270_GET_CLASS(obj) \ + OBJECT_GET_CLASS(EmulatedCcw3270Class, (obj), TYPE_EMULATED_CCW_3270) + +typedef struct EmulatedCcw3270Device { + CcwDevice parent_obj; +} EmulatedCcw3270Device; + +typedef struct EmulatedCcw3270Class { + CCWDeviceClass parent_class; + + void (*init)(EmulatedCcw3270Device *, Error **); + int (*read_payload_3270)(EmulatedCcw3270Device *, uint32_t, uint16_t); + int (*write_payload_3270)(EmulatedCcw3270Device *, uint8_t, uint32_t, + uint16_t); +} EmulatedCcw3270Class; + +#endif diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index f1f0d7f07a..e61fa74d9b 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -28,6 +28,7 @@ #define MAX_CIWS 62 #define VIRTUAL_CSSID 0xfe +#define VIRTIO_CCW_CHPID 0 /* used by convention */ typedef struct CIW { uint8_t type; @@ -115,6 +116,7 @@ bool css_devno_used(uint8_t cssid, uint8_t ssid, uint16_t devno); void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid, uint16_t devno, SubchDev *sch); void css_sch_build_virtual_schib(SubchDev *sch, uint8_t chpid, uint8_t type); +unsigned int css_find_free_chpid(uint8_t cssid); uint16_t css_build_subchannel_id(SubchDev *sch); void css_reset(void); void css_reset_sch(SubchDev *sch); diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h index 6ecae00386..7b8a3e4d74 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -28,6 +28,7 @@ typedef struct S390CcwMachineState { /*< public >*/ bool aes_key_wrap; bool dea_key_wrap; + uint8_t loadparm[8]; } S390CcwMachineState; typedef struct S390CcwMachineClass { diff --git a/include/migration/cpu.h b/include/migration/cpu.h index f3d5dfcf61..a40bd3549f 100644 --- a/include/migration/cpu.h +++ b/include/migration/cpu.h @@ -18,6 +18,8 @@ VMSTATE_UINT64_EQUAL_V(_f, _s, _v) #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) +#define VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, _v) \ + VMSTATE_UINT64_2DARRAY_V(_f, _s, _n1, _n2, _v) #define VMSTATE_UINTTL_TEST(_f, _s, _t) \ VMSTATE_UINT64_TEST(_f, _s, _t) #define vmstate_info_uinttl vmstate_info_uint64 @@ -37,6 +39,8 @@ VMSTATE_UINT32_EQUAL_V(_f, _s, _v) #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) +#define VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, _v) \ + VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, _v) #define VMSTATE_UINTTL_TEST(_f, _s, _t) \ VMSTATE_UINT32_TEST(_f, _s, _t) #define vmstate_info_uinttl vmstate_info_uint32 @@ -48,5 +52,8 @@ VMSTATE_UINTTL_EQUAL_V(_f, _s, 0) #define VMSTATE_UINTTL_ARRAY(_f, _s, _n) \ VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_UINTTL_2DARRAY(_f, _s, _n1, _n2) \ + VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, 0) + #endif diff --git a/include/migration/migration.h b/include/migration/migration.h index ba1a16cbc1..e29cb0144b 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -266,7 +266,8 @@ 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); +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 */ diff --git a/include/migration/postcopy-ram.h b/include/migration/postcopy-ram.h deleted file mode 100644 index 8e036b95a2..0000000000 --- a/include/migration/postcopy-ram.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Postcopy migration for RAM - * - * Copyright 2013 Red Hat, Inc. and/or its affiliates - * - * Authors: - * Dave Gilbert <dgilbert@redhat.com> - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - * - */ -#ifndef QEMU_POSTCOPY_RAM_H -#define QEMU_POSTCOPY_RAM_H - -/* Return true if the host supports everything we need to do postcopy-ram */ -bool postcopy_ram_supported_by_host(void); - -/* - * Make all of RAM sensitive to accesses to areas that haven't yet been written - * and wire up anything necessary to deal with it. - */ -int postcopy_ram_enable_notify(MigrationIncomingState *mis); - -/* - * Initialise postcopy-ram, setting the RAM to a state where we can go into - * postcopy later; must be called prior to any precopy. - * called from ram.c's similarly named ram_postcopy_incoming_init - */ -int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages); - -/* - * At the end of a migration where postcopy_ram_incoming_init was called. - */ -int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis); - -/* - * Userfault requires us to mark RAM as NOHUGEPAGE prior to discard - * however leaving it until after precopy means that most of the precopy - * data is still THPd - */ -int postcopy_ram_prepare_discard(MigrationIncomingState *mis); - -/* - * Called at the start of each RAMBlock by the bitmap code. - * 'offset' is the bitmap offset of the named RAMBlock in the migration - * bitmap. - * Returns a new PDS - */ -PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms, - unsigned long offset, - const char *name); - -/* - * Called by the bitmap code for each chunk to discard. - * May send a discard message, may just leave it queued to - * be sent later. - * @start,@length: a range of pages in the migration bitmap in the - * RAM block passed to postcopy_discard_send_init() (length=1 is one page) - */ -void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds, - unsigned long start, unsigned long length); - -/* - * Called at the end of each RAMBlock by the bitmap code. - * Sends any outstanding discard messages, frees the PDS. - */ -void postcopy_discard_send_finish(MigrationState *ms, - PostcopyDiscardState *pds); - -/* - * Place a page (from) at (host) efficiently - * There are restrictions on how 'from' must be mapped, in general best - * to use other postcopy_ routines to allocate. - * returns 0 on success - */ -int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from, - size_t pagesize); - -/* - * Place a zero page at (host) atomically - * returns 0 on success - */ -int postcopy_place_page_zero(MigrationIncomingState *mis, void *host, - size_t pagesize); - -/* - * Allocate a page of memory that can be mapped at a later point in time - * using postcopy_place_page - * Returns: Pointer to allocated page - */ -void *postcopy_get_tmp_page(MigrationIncomingState *mis); - -#endif diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index dad3984c07..f4bf3f1b4e 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -500,6 +500,19 @@ extern const VMStateInfo vmstate_info_qtailq; .offset = vmstate_offset_array(_state, _field, _type, _num),\ } +#define VMSTATE_STRUCT_2DARRAY_TEST(_field, _state, _n1, _n2, _test, \ + _version, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .num = (_n1) * (_n2), \ + .field_exists = (_test), \ + .version_id = (_version), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT | VMS_ARRAY, \ + .offset = vmstate_offset_2darray(_state, _field, _type, \ + _n1, _n2), \ +} + #define VMSTATE_STRUCT_VARRAY_UINT8(_field, _state, _field_num, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .num_offset = vmstate_offset_value(_state, _field_num, uint8_t), \ @@ -747,6 +760,11 @@ extern const VMStateInfo vmstate_info_qtailq; VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \ _vmsd, _type) +#define VMSTATE_STRUCT_2DARRAY(_field, _state, _n1, _n2, _version, \ + _vmsd, _type) \ + VMSTATE_STRUCT_2DARRAY_TEST(_field, _state, _n1, _n2, NULL, \ + _version, _vmsd, _type) + #define VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, _info, _size) \ VMSTATE_BUFFER_UNSAFE_INFO_TEST(_field, _state, NULL, _version, _info, \ _size) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 7462228ac1..840ad6134c 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -99,7 +99,7 @@ int blk_get_refcnt(BlockBackend *blk); void blk_ref(BlockBackend *blk); void blk_unref(BlockBackend *blk); void blk_remove_all_bs(void); -const char *blk_name(BlockBackend *blk); +const char *blk_name(const BlockBackend *blk); BlockBackend *blk_by_name(const char *name); BlockBackend *blk_next(BlockBackend *blk); bool monitor_add_blk(BlockBackend *blk, const char *name, Error **errp); @@ -225,7 +225,7 @@ int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, int count, BdrvRequestFlags flags); int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, int count); -int blk_truncate(BlockBackend *blk, int64_t offset); +int blk_truncate(BlockBackend *blk, int64_t offset, Error **errp); int blk_pdiscard(BlockBackend *blk, int64_t offset, int count); int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, int64_t pos, int size); diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 729d186d01..ea9f2cb7d6 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -7,6 +7,14 @@ #include "qemu/bitmap.h" #include "qom/object.h" +#define IAC_EOR 239 +#define IAC_SE 240 +#define IAC_NOP 241 +#define IAC_BREAK 243 +#define IAC_IP 244 +#define IAC_SB 250 +#define IAC 255 + /* character device */ typedef enum { diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 16175f7295..15656b7c36 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -75,11 +75,8 @@ 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); -void hmp_savevm(Monitor *mon, const QDict *qdict); -int save_vmstate(Monitor *mon, const char *name); +int save_vmstate(const char *name); int load_vmstate(const char *name); -void hmp_delvm(Monitor *mon, const QDict *qdict); -void hmp_info_snapshots(Monitor *mon, const QDict *qdict); void qemu_announce_self(void); |