mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170124b' into staging
Migration 1 My maintainer change 2 Jianjun's qtailq 3 Ashijeet's only-migratable 4 Zhanghailiang's re-active images 5 Pankaj's change name of migration thread 6 My PCI migration merge 7 Juan's debug to tracing 8 My tracing on save # gpg: Signature made Tue 24 Jan 2017 18:39:35 GMT # gpg: using RSA key 0x0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20170124b: migration/tracing: Add tracing on save migration: transform remaining DPRINTF into trace_ PCI/migration merge vmstate_pci_device and vmstate_pcie_device migration: Change name of live migration thread migration: re-active images while migration been canceled after inactive them migration: Fail migration blocker for --only-migratable migration: disallow migrate_add_blocker during migration migration: Allow "device add" options to only add migratable devices migration: Add a new option to enable only-migratable block/vvfat: Remove the undesirable comment migration: add error_report tests/migration: Add test for QTAILQ migration migration: migrate QTAILQ migration: extend VMStateInfo MAINTAINERS: Add myself as a migration submaintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -1420,6 +1420,7 @@ F: scripts/checkpatch.pl
|
||||
Migration
|
||||
M: Juan Quintela <quintela@redhat.com>
|
||||
M: Amit Shah <amit.shah@redhat.com>
|
||||
M: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
S: Maintained
|
||||
F: include/migration/
|
||||
F: migration/
|
||||
|
||||
+7
-1
@@ -104,6 +104,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
unsigned int len, i, shift;
|
||||
int ret;
|
||||
QCowHeader header;
|
||||
Error *local_err = NULL;
|
||||
|
||||
ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
|
||||
if (ret < 0) {
|
||||
@@ -252,7 +253,12 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
error_setg(&s->migration_blocker, "The qcow format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
return 0;
|
||||
|
||||
+7
-1
@@ -361,6 +361,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
VdiHeader header;
|
||||
size_t bmap_size;
|
||||
int ret;
|
||||
Error *local_err = NULL;
|
||||
|
||||
logout("\n");
|
||||
|
||||
@@ -471,7 +472,12 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
error_setg(&s->migration_blocker, "The vdi format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail_free_bmap;
|
||||
}
|
||||
|
||||
qemu_co_mutex_init(&s->write_lock);
|
||||
|
||||
|
||||
+11
-6
@@ -991,6 +991,17 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable migration when VHDX images are used */
|
||||
error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (flags & BDRV_O_RDWR) {
|
||||
ret = vhdx_update_headers(bs, s, false, NULL);
|
||||
if (ret < 0) {
|
||||
@@ -1000,12 +1011,6 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
|
||||
/* TODO: differencing files */
|
||||
|
||||
/* Disable migration when VHDX images are used */
|
||||
error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
vhdx_close(bs);
|
||||
|
||||
+8
-1
@@ -941,6 +941,7 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
int ret;
|
||||
BDRVVmdkState *s = bs->opaque;
|
||||
uint32_t magic;
|
||||
Error *local_err = NULL;
|
||||
|
||||
buf = vmdk_read_desc(bs->file, 0, errp);
|
||||
if (!buf) {
|
||||
@@ -976,7 +977,13 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
g_free(buf);
|
||||
return 0;
|
||||
|
||||
|
||||
+8
-3
@@ -422,13 +422,18 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
#endif
|
||||
}
|
||||
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
|
||||
/* Disable migration when VHD images are used */
|
||||
error_setg(&s->migration_blocker, "The vpc format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
+12
-8
@@ -1185,22 +1185,26 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
|
||||
s->sector_count = s->faked_sectors + s->sectors_per_cluster*s->cluster_count;
|
||||
|
||||
if (s->first_sectors_number == 0x40) {
|
||||
init_mbr(s, cyls, heads, secs);
|
||||
}
|
||||
|
||||
// assert(is_consistent(s));
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
|
||||
/* Disable migration when vvfat is used rw */
|
||||
if (s->qcow) {
|
||||
error_setg(&s->migration_blocker,
|
||||
"The vvfat (rw) format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
ret = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->first_sectors_number == 0x40) {
|
||||
init_mbr(s, cyls, heads, secs);
|
||||
}
|
||||
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
|
||||
ret = 0;
|
||||
fail:
|
||||
qemu_opts_del(opts);
|
||||
|
||||
+22
-11
@@ -979,6 +979,7 @@ static void coroutine_fn v9fs_attach(void *opaque)
|
||||
size_t offset = 7;
|
||||
V9fsQID qid;
|
||||
ssize_t err;
|
||||
Error *local_err = NULL;
|
||||
|
||||
v9fs_string_init(&uname);
|
||||
v9fs_string_init(&aname);
|
||||
@@ -1007,26 +1008,36 @@ static void coroutine_fn v9fs_attach(void *opaque)
|
||||
clunk_fid(s, fid);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* disable migration if we haven't done already.
|
||||
* attach could get called multiple times for the same export.
|
||||
*/
|
||||
if (!s->migration_blocker) {
|
||||
error_setg(&s->migration_blocker,
|
||||
"Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'",
|
||||
s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag);
|
||||
err = migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_free(local_err);
|
||||
error_free(s->migration_blocker);
|
||||
s->migration_blocker = NULL;
|
||||
clunk_fid(s, fid);
|
||||
goto out;
|
||||
}
|
||||
s->root_fid = fid;
|
||||
}
|
||||
|
||||
err = pdu_marshal(pdu, offset, "Q", &qid);
|
||||
if (err < 0) {
|
||||
clunk_fid(s, fid);
|
||||
goto out;
|
||||
}
|
||||
err += offset;
|
||||
|
||||
memcpy(&s->root_qid, &qid, sizeof(qid));
|
||||
trace_v9fs_attach_return(pdu->tag, pdu->id,
|
||||
qid.type, qid.version, qid.path);
|
||||
/*
|
||||
* disable migration if we haven't done already.
|
||||
* attach could get called multiple times for the same export.
|
||||
*/
|
||||
if (!s->migration_blocker) {
|
||||
s->root_fid = fid;
|
||||
error_setg(&s->migration_blocker,
|
||||
"Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'",
|
||||
s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag);
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
}
|
||||
out:
|
||||
put_fid(pdu, fidp);
|
||||
out_nofid:
|
||||
|
||||
+25
-15
@@ -1003,7 +1003,8 @@ static const VMStateDescription vmstate_virtio_gpu_scanouts = {
|
||||
},
|
||||
};
|
||||
|
||||
static void virtio_gpu_save(QEMUFile *f, void *opaque, size_t size)
|
||||
static int virtio_gpu_save(QEMUFile *f, void *opaque, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
VirtIOGPU *g = opaque;
|
||||
struct virtio_gpu_simple_resource *res;
|
||||
@@ -1028,9 +1029,12 @@ static void virtio_gpu_save(QEMUFile *f, void *opaque, size_t size)
|
||||
qemu_put_be32(f, 0); /* end of list */
|
||||
|
||||
vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size)
|
||||
static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
VirtIOGPU *g = opaque;
|
||||
struct virtio_gpu_simple_resource *res;
|
||||
@@ -1132,6 +1136,7 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
|
||||
VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
|
||||
VirtIOGPU *g = VIRTIO_GPU(qdev);
|
||||
bool have_virgl;
|
||||
Error *local_err = NULL;
|
||||
int i;
|
||||
|
||||
if (g->conf.max_outputs > VIRTIO_GPU_MAX_SCANOUTS) {
|
||||
@@ -1139,14 +1144,6 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
g->config_size = sizeof(struct virtio_gpu_config);
|
||||
g->virtio_config.num_scanouts = g->conf.max_outputs;
|
||||
virtio_init(VIRTIO_DEVICE(g), "virtio-gpu", VIRTIO_ID_GPU,
|
||||
g->config_size);
|
||||
|
||||
g->req_state[0].width = 1024;
|
||||
g->req_state[0].height = 768;
|
||||
|
||||
g->use_virgl_renderer = false;
|
||||
#if !defined(CONFIG_VIRGL) || defined(HOST_WORDS_BIGENDIAN)
|
||||
have_virgl = false;
|
||||
@@ -1157,6 +1154,24 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
|
||||
g->conf.flags &= ~(1 << VIRTIO_GPU_FLAG_VIRGL_ENABLED);
|
||||
}
|
||||
|
||||
if (virtio_gpu_virgl_enabled(g->conf)) {
|
||||
error_setg(&g->migration_blocker, "virgl is not yet migratable");
|
||||
migrate_add_blocker(g->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(g->migration_blocker);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
g->config_size = sizeof(struct virtio_gpu_config);
|
||||
g->virtio_config.num_scanouts = g->conf.max_outputs;
|
||||
virtio_init(VIRTIO_DEVICE(g), "virtio-gpu", VIRTIO_ID_GPU,
|
||||
g->config_size);
|
||||
|
||||
g->req_state[0].width = 1024;
|
||||
g->req_state[0].height = 768;
|
||||
|
||||
if (virtio_gpu_virgl_enabled(g->conf)) {
|
||||
/* use larger control queue in 3d mode */
|
||||
g->ctrl_vq = virtio_add_queue(vdev, 256, virtio_gpu_handle_ctrl_cb);
|
||||
@@ -1183,11 +1198,6 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
|
||||
dpy_gfx_replace_surface(g->scanout[i].con, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (virtio_gpu_virgl_enabled(g->conf)) {
|
||||
error_setg(&g->migration_blocker, "virgl is not yet migratable");
|
||||
migrate_add_blocker(g->migration_blocker);
|
||||
}
|
||||
}
|
||||
|
||||
static void virtio_gpu_device_unrealize(DeviceState *qdev, Error **errp)
|
||||
|
||||
+11
-6
@@ -510,6 +510,17 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!kvm_arm_gic_can_save_restore(s)) {
|
||||
error_setg(&s->migration_blocker, "This operating system kernel does "
|
||||
"not support vGICv2 migration");
|
||||
migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gic_init_irqs_and_mmio(s, kvm_arm_gicv2_set_irq, NULL);
|
||||
|
||||
for (i = 0; i < s->num_irq - GIC_INTERNAL; i++) {
|
||||
@@ -558,12 +569,6 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
|
||||
KVM_VGIC_V2_ADDR_TYPE_CPU,
|
||||
s->dev_fd);
|
||||
|
||||
if (!kvm_arm_gic_can_save_restore(s)) {
|
||||
error_setg(&s->migration_blocker, "This operating system kernel does "
|
||||
"not support vGICv2 migration");
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
}
|
||||
|
||||
if (kvm_has_gsi_routing()) {
|
||||
/* set up irq routing */
|
||||
kvm_init_irq_routing(kvm_state);
|
||||
|
||||
@@ -56,6 +56,19 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)
|
||||
static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev);
|
||||
Error *local_err = NULL;
|
||||
|
||||
/*
|
||||
* Block migration of a KVM GICv3 ITS device: the API for saving and
|
||||
* restoring the state in the kernel is not yet available
|
||||
*/
|
||||
error_setg(&s->migration_blocker, "vITS migration is not implemented");
|
||||
migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
return;
|
||||
}
|
||||
|
||||
s->dev_fd = kvm_create_device(kvm_state, KVM_DEV_TYPE_ARM_VGIC_ITS, false);
|
||||
if (s->dev_fd < 0) {
|
||||
@@ -73,13 +86,6 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
gicv3_its_init_mmio(s, NULL);
|
||||
|
||||
/*
|
||||
* Block migration of a KVM GICv3 ITS device: the API for saving and
|
||||
* restoring the state in the kernel is not yet available
|
||||
*/
|
||||
error_setg(&s->migration_blocker, "vITS migration is not implemented");
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
|
||||
kvm_msi_use_devid = true;
|
||||
kvm_gsi_direct_mapping = false;
|
||||
kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();
|
||||
|
||||
+12
-7
@@ -103,6 +103,18 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
gicv3_init_irqs_and_mmio(s, kvm_arm_gicv3_set_irq, NULL);
|
||||
|
||||
/* Block migration of a KVM GICv3 device: the API for saving and restoring
|
||||
* the state in the kernel is not yet finalised in the kernel or
|
||||
* implemented in QEMU.
|
||||
*/
|
||||
error_setg(&s->migration_blocker, "vGICv3 migration is not implemented");
|
||||
migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Try to create the device via the device control API */
|
||||
s->dev_fd = kvm_create_device(kvm_state, KVM_DEV_TYPE_ARM_VGIC_V3, false);
|
||||
if (s->dev_fd < 0) {
|
||||
@@ -122,13 +134,6 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
|
||||
kvm_arm_register_device(&s->iomem_redist, -1, KVM_DEV_ARM_VGIC_GRP_ADDR,
|
||||
KVM_VGIC_V3_ADDR_TYPE_REDIST, s->dev_fd);
|
||||
|
||||
/* Block migration of a KVM GICv3 device: the API for saving and restoring
|
||||
* the state in the kernel is not yet finalised in the kernel or
|
||||
* implemented in QEMU.
|
||||
*/
|
||||
error_setg(&s->migration_blocker, "vGICv3 migration is not implemented");
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
|
||||
if (kvm_has_gsi_routing()) {
|
||||
/* set up irq routing */
|
||||
kvm_init_irq_routing(kvm_state);
|
||||
|
||||
@@ -286,7 +286,8 @@ static void kvm_s390_release_adapter_routes(S390FLICState *fs,
|
||||
* increase until buffer is sufficient or maxium size is
|
||||
* reached
|
||||
*/
|
||||
static void kvm_flic_save(QEMUFile *f, void *opaque, size_t size)
|
||||
static int kvm_flic_save(QEMUFile *f, void *opaque, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
KVMS390FLICState *flic = opaque;
|
||||
int len = FLIC_SAVE_INITIAL_SIZE;
|
||||
@@ -319,6 +320,8 @@ static void kvm_flic_save(QEMUFile *f, void *opaque, size_t size)
|
||||
count * sizeof(struct kvm_s390_irq));
|
||||
}
|
||||
g_free(buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,7 +334,8 @@ static void kvm_flic_save(QEMUFile *f, void *opaque, size_t size)
|
||||
* Note: Do nothing when no interrupts where stored
|
||||
* in QEMUFile
|
||||
*/
|
||||
static int kvm_flic_load(QEMUFile *f, void *opaque, size_t size)
|
||||
static int kvm_flic_load(QEMUFile *f, void *opaque, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
uint64_t len = 0;
|
||||
uint64_t count = 0;
|
||||
|
||||
+10
-4
@@ -840,6 +840,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
uint8_t *pci_conf;
|
||||
uint8_t attr = PCI_BASE_ADDRESS_SPACE_MEMORY |
|
||||
PCI_BASE_ADDRESS_MEM_PREFETCH;
|
||||
Error *local_err = NULL;
|
||||
|
||||
/* IRQFD requires MSI */
|
||||
if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD) &&
|
||||
@@ -903,9 +904,6 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
vmstate_register_ram(s->ivshmem_bar2, DEVICE(s));
|
||||
pci_register_bar(PCI_DEVICE(s), 2, attr, s->ivshmem_bar2);
|
||||
|
||||
if (s->master == ON_OFF_AUTO_AUTO) {
|
||||
s->master = s->vm_id == 0 ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;
|
||||
}
|
||||
@@ -913,8 +911,16 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
if (!ivshmem_is_master(s)) {
|
||||
error_setg(&s->migration_blocker,
|
||||
"Migration is disabled when using feature 'peer mode' in device 'ivshmem'");
|
||||
migrate_add_blocker(s->migration_blocker);
|
||||
migrate_add_blocker(s->migration_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
error_free(s->migration_blocker);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
vmstate_register_ram(s->ivshmem_bar2, DEVICE(s));
|
||||
pci_register_bar(PCI_DEVICE(s), 2, attr, s->ivshmem_bar2);
|
||||
}
|
||||
|
||||
static void ivshmem_exit(PCIDevice *dev)
|
||||
|
||||
+1
-1
@@ -593,7 +593,7 @@ static const VMStateDescription e1000e_vmstate = {
|
||||
.pre_save = e1000e_pre_save,
|
||||
.post_load = e1000e_post_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_PCIE_DEVICE(parent_obj, E1000EState),
|
||||
VMSTATE_PCI_DEVICE(parent_obj, E1000EState),
|
||||
VMSTATE_MSIX(parent_obj, E1000EState),
|
||||
|
||||
VMSTATE_UINT32(ioaddr, E1000EState),
|
||||
|
||||
+19
-7
@@ -2451,7 +2451,8 @@ static void vmxnet3_put_tx_stats_to_file(QEMUFile *f,
|
||||
qemu_put_be64(f, tx_stat->pktsTxDiscard);
|
||||
}
|
||||
|
||||
static int vmxnet3_get_txq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_get_txq_descr(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
Vmxnet3TxqDescr *r = pv;
|
||||
|
||||
@@ -2465,7 +2466,8 @@ static int vmxnet3_get_txq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vmxnet3_put_txq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_put_txq_descr(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
Vmxnet3TxqDescr *r = pv;
|
||||
|
||||
@@ -2474,6 +2476,8 @@ static void vmxnet3_put_txq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
qemu_put_byte(f, r->intr_idx);
|
||||
qemu_put_be64(f, r->tx_stats_pa);
|
||||
vmxnet3_put_tx_stats_to_file(f, &r->txq_stats);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateInfo txq_descr_info = {
|
||||
@@ -2512,7 +2516,8 @@ static void vmxnet3_put_rx_stats_to_file(QEMUFile *f,
|
||||
qemu_put_be64(f, rx_stat->pktsRxError);
|
||||
}
|
||||
|
||||
static int vmxnet3_get_rxq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_get_rxq_descr(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
Vmxnet3RxqDescr *r = pv;
|
||||
int i;
|
||||
@@ -2530,7 +2535,8 @@ static int vmxnet3_get_rxq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vmxnet3_put_rxq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_put_rxq_descr(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
Vmxnet3RxqDescr *r = pv;
|
||||
int i;
|
||||
@@ -2543,6 +2549,8 @@ static void vmxnet3_put_rxq_descr(QEMUFile *f, void *pv, size_t size)
|
||||
qemu_put_byte(f, r->intr_idx);
|
||||
qemu_put_be64(f, r->rx_stats_pa);
|
||||
vmxnet3_put_rx_stats_to_file(f, &r->rxq_stats);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vmxnet3_post_load(void *opaque, int version_id)
|
||||
@@ -2575,7 +2583,8 @@ static const VMStateInfo rxq_descr_info = {
|
||||
.put = vmxnet3_put_rxq_descr
|
||||
};
|
||||
|
||||
static int vmxnet3_get_int_state(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_get_int_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
Vmxnet3IntState *r = pv;
|
||||
|
||||
@@ -2586,13 +2595,16 @@ static int vmxnet3_get_int_state(QEMUFile *f, void *pv, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vmxnet3_put_int_state(QEMUFile *f, void *pv, size_t size)
|
||||
static int vmxnet3_put_int_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
Vmxnet3IntState *r = pv;
|
||||
|
||||
qemu_put_byte(f, r->is_masked);
|
||||
qemu_put_byte(f, r->is_pending);
|
||||
qemu_put_byte(f, r->is_asserted);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateInfo int_state_info = {
|
||||
@@ -2619,7 +2631,7 @@ static const VMStateDescription vmstate_vmxnet3_pcie_device = {
|
||||
.minimum_version_id = 1,
|
||||
.needed = vmxnet3_vmstate_need_pcie_device,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_PCIE_DEVICE(parent_obj, VMXNET3State),
|
||||
VMSTATE_PCI_DEVICE(parent_obj, VMXNET3State),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -94,18 +94,22 @@ struct _eeprom_t {
|
||||
This is a Big hack, but it is how the old state did it.
|
||||
*/
|
||||
|
||||
static int get_uint16_from_uint8(QEMUFile *f, void *pv, size_t size)
|
||||
static int get_uint16_from_uint8(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
uint16_t *v = pv;
|
||||
*v = qemu_get_ubyte(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void put_unused(QEMUFile *f, void *pv, size_t size)
|
||||
static int put_unused(QEMUFile *f, void *pv, size_t size, VMStateField *field,
|
||||
QJSON *vmdesc)
|
||||
{
|
||||
fprintf(stderr, "uint16_from_uint8 is used only for backwards compatibility.\n");
|
||||
fprintf(stderr, "Never should be used to write a new state.\n");
|
||||
exit(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateInfo vmstate_hack_uint16_from_uint8 = {
|
||||
|
||||
+6
-2
@@ -555,17 +555,21 @@ static void fw_cfg_reset(DeviceState *d)
|
||||
Or we broke compatibility in the state, or we can't use struct tm
|
||||
*/
|
||||
|
||||
static int get_uint32_as_uint16(QEMUFile *f, void *pv, size_t size)
|
||||
static int get_uint32_as_uint16(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
{
|
||||
uint32_t *v = pv;
|
||||
*v = qemu_get_be16(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void put_unused(QEMUFile *f, void *pv, size_t size)
|
||||
static int put_unused(QEMUFile *f, void *pv, size_t size, VMStateField *field,
|
||||
QJSON *vmdesc)
|
||||
{
|
||||
fprintf(stderr, "uint32_as_uint16 is only used for backward compatibility.\n");
|
||||
fprintf(stderr, "This functions shouldn't be called.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateInfo vmstate_hack_uint32_as_uint16 = {
|
||||
|
||||
@@ -180,7 +180,7 @@ static const VMStateDescription vmstate_ioh3420 = {
|
||||
.minimum_version_id = 1,
|
||||
.post_load = pcie_cap_slot_post_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_PCIE_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
|
||||
VMSTATE_PCI_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
|
||||
VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log,
|
||||
PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
||||
@@ -166,7 +166,7 @@ static const VMStateDescription vmstate_xio3130_downstream = {
|
||||
.minimum_version_id = 1,
|
||||
.post_load = pcie_cap_slot_post_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_PCIE_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
|
||||
VMSTATE_PCI_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
|
||||
VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log,
|
||||
PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user