Merge tag 'staging-pull-request' of https://gitlab.com/peterx/qemu into staging

mem + migration pull for 10.2

- Fabiano's patch to fix snapshot crash by rejecting some caps
- Marco's mapped-ram support on snapshot save/load
- Steve's cpr maintainers entry update on retirement
- Peter's coverity fixes
- Chenyi's tdx fix on hugetlbfs regression
- Peter's doc update on migrate resume flag
- Peter's doc update on HMP set parameter for cpr-exec-command's char** parsing
- Xiaoyao's guest-memfd fix for enabling shmem
- Arun's fix on error_fatal regression for migration errors
- Bin's fix on redundant error free for add block failures
- Markus's cleanup around MigMode sets
- Peter's two patches (out of loadvm threadify) to cleanup qio read peek process
- Thomas's vmstate-static-checker update for possible deprecation of argparse use
- Stefan's fix on windows deadlock by making unassigned MMIOs lockless

# -----BEGIN PGP SIGNATURE-----
#
# iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCaQkZPBIccGV0ZXJ4QHJl
# ZGhhdC5jb20ACgkQO1/MzfOr1wZhTgEA8eCBMpM7PusNSdzzeIygKnIp2A8I70ca
# eIJz3ZM+FiUBAPVDrIZ59EhZA6NPcJb8Ya9OY4lT63F4BxrvN+f+uG4N
# =GUBi
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 03 Nov 2025 10:06:04 PM CET
# gpg:                using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706
# gpg:                issuer "peterx@redhat.com"
# gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [unknown]
# gpg:                 aka "Peter Xu <peterx@redhat.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D  D1A9 3B5F CCCD F3AB D706

* tag 'staging-pull-request' of https://gitlab.com/peterx/qemu: (36 commits)
  migration: Introduce POSTCOPY_DEVICE state
  migration: Make postcopy listen thread joinable
  migration: Respect exit-on-error when migration fails before resuming
  migration: Refactor all incoming cleanup info migration_incoming_destroy()
  migration: Introduce postcopy incoming setup and cleanup functions
  migration: Move postcopy_ram_listen_thread() to postcopy-ram.c
  migration: Do not try to start VM if disk activation fails
  migration: Flush migration channel after sending data of CMD_PACKAGED
  system/physmem: mark io_mem_unassigned lockless
  scripts/vmstate-static-checker: Fix deprecation warnings with latest argparse
  migration: vmsd errp handlers: return bool
  migration/vmstate: stop reporting error number for new _errp APIs
  tmp_emulator: improve and fix use of errp
  migration: vmstate_save_state_v(): fix error path
  migration: Properly wait on G_IO_IN when peeking messages
  io: Add qio_channel_wait_cond() helper
  migration: Put Error **errp parameter last
  migration: Use bitset of MigMode instead of variable arguments
  migration: Use unsigned instead of int for bit set of MigMode
  migration: Don't free the reason after calling migrate_add_blocker
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson
2025-11-04 16:19:35 +01:00
49 changed files with 684 additions and 380 deletions
+2 -1
View File
@@ -3114,7 +3114,8 @@ T: git https://gitlab.com/jsnow/qemu.git jobs
T: git https://gitlab.com/vsementsov/qemu.git block
CheckPoint and Restart (CPR)
R: Steve Sistare <steven.sistare@oracle.com>
R: Peter Xu <peterx@redhat.com>
R: Fabiano Rosas <farosas@suse.de>
S: Supported
F: hw/vfio/cpr*
F: include/hw/vfio/vfio-cpr.h
+1
View File
@@ -54,6 +54,7 @@ have_fd:
/* Let's do the same as memory-backend-ram,share=on would do. */
ram_flags = RAM_SHARED;
ram_flags |= backend->reserve ? 0 : RAM_NORESERVE;
ram_flags |= backend->guest_memfd ? RAM_GUEST_MEMFD : 0;
return memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend),
backend_name, backend->size,
+43 -30
View File
@@ -308,22 +308,22 @@ static int tpm_emulator_check_caps(TPMEmulator *tpm_emu)
return 0;
}
static int tpm_emulator_stop_tpm(TPMBackend *tb)
static int tpm_emulator_stop_tpm(TPMBackend *tb, Error **errp)
{
TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
ptm_res res;
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_STOP, &res, 0,
sizeof(ptm_res), sizeof(res)) < 0) {
error_report("tpm-emulator: Could not stop TPM: %s",
strerror(errno));
error_setg(errp, "tpm-emulator: Could not stop TPM: %s",
strerror(errno));
return -1;
}
res = be32_to_cpu(res);
if (res) {
error_report("tpm-emulator: TPM result for CMD_STOP: 0x%x %s", res,
tpm_emulator_strerror(res));
error_setg(errp, "tpm-emulator: TPM result for CMD_STOP: 0x%x %s", res,
tpm_emulator_strerror(res));
return -1;
}
@@ -362,12 +362,13 @@ static int tpm_emulator_lock_storage(TPMEmulator *tpm_emu)
static int tpm_emulator_set_buffer_size(TPMBackend *tb,
size_t wanted_size,
size_t *actual_size)
size_t *actual_size,
Error **errp)
{
TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
ptm_setbuffersize psbs;
if (tpm_emulator_stop_tpm(tb) < 0) {
if (tpm_emulator_stop_tpm(tb, errp) < 0) {
return -1;
}
@@ -376,16 +377,17 @@ static int tpm_emulator_set_buffer_size(TPMBackend *tb,
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_BUFFERSIZE, &psbs,
sizeof(psbs.u.req), sizeof(psbs.u.resp.tpm_result),
sizeof(psbs.u.resp)) < 0) {
error_report("tpm-emulator: Could not set buffer size: %s",
strerror(errno));
error_setg(errp, "tpm-emulator: Could not set buffer size: %s",
strerror(errno));
return -1;
}
psbs.u.resp.tpm_result = be32_to_cpu(psbs.u.resp.tpm_result);
if (psbs.u.resp.tpm_result != 0) {
error_report("tpm-emulator: TPM result for set buffer size : 0x%x %s",
psbs.u.resp.tpm_result,
tpm_emulator_strerror(psbs.u.resp.tpm_result));
error_setg(errp,
"tpm-emulator: TPM result for set buffer size : 0x%x %s",
psbs.u.resp.tpm_result,
tpm_emulator_strerror(psbs.u.resp.tpm_result));
return -1;
}
@@ -402,7 +404,7 @@ static int tpm_emulator_set_buffer_size(TPMBackend *tb,
}
static int tpm_emulator_startup_tpm_resume(TPMBackend *tb, size_t buffersize,
bool is_resume)
bool is_resume, Error **errp)
{
TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
ptm_init init = {
@@ -413,7 +415,7 @@ static int tpm_emulator_startup_tpm_resume(TPMBackend *tb, size_t buffersize,
trace_tpm_emulator_startup_tpm_resume(is_resume, buffersize);
if (buffersize != 0 &&
tpm_emulator_set_buffer_size(tb, buffersize, NULL) < 0) {
tpm_emulator_set_buffer_size(tb, buffersize, NULL, errp) < 0) {
goto err_exit;
}
@@ -424,15 +426,15 @@ static int tpm_emulator_startup_tpm_resume(TPMBackend *tb, size_t buffersize,
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init),
sizeof(init.u.resp.tpm_result),
sizeof(init)) < 0) {
error_report("tpm-emulator: could not send INIT: %s",
strerror(errno));
error_setg(errp, "tpm-emulator: could not send INIT: %s",
strerror(errno));
goto err_exit;
}
res = be32_to_cpu(init.u.resp.tpm_result);
if (res) {
error_report("tpm-emulator: TPM result for CMD_INIT: 0x%x %s", res,
tpm_emulator_strerror(res));
error_setg(errp, "tpm-emulator: TPM result for CMD_INIT: 0x%x %s", res,
tpm_emulator_strerror(res));
goto err_exit;
}
return 0;
@@ -441,18 +443,31 @@ err_exit:
return -1;
}
static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
static int do_tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize,
Error **errp)
{
/* TPM startup will be done from post_load hook */
if (runstate_check(RUN_STATE_INMIGRATE)) {
if (buffersize != 0) {
return tpm_emulator_set_buffer_size(tb, buffersize, NULL);
return tpm_emulator_set_buffer_size(tb, buffersize, NULL, errp);
}
return 0;
}
return tpm_emulator_startup_tpm_resume(tb, buffersize, false);
return tpm_emulator_startup_tpm_resume(tb, buffersize, false, errp);
}
static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
{
Error *local_err = NULL;
int ret = do_tpm_emulator_startup_tpm(tb, buffersize, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
return ret;
}
static bool tpm_emulator_get_tpm_established_flag(TPMBackend *tb)
@@ -546,7 +561,7 @@ static size_t tpm_emulator_get_buffer_size(TPMBackend *tb)
{
size_t actual_size;
if (tpm_emulator_set_buffer_size(tb, 0, &actual_size) < 0) {
if (tpm_emulator_set_buffer_size(tb, 0, &actual_size, NULL) < 0) {
return 4096;
}
@@ -889,7 +904,7 @@ static int tpm_emulator_set_state_blobs(TPMBackend *tb, Error **errp)
trace_tpm_emulator_set_state_blobs();
if (tpm_emulator_stop_tpm(tb) < 0) {
if (tpm_emulator_stop_tpm(tb, errp) < 0) {
trace_tpm_emulator_set_state_blobs_error("Could not stop TPM");
return -EIO;
}
@@ -947,24 +962,22 @@ static void tpm_emulator_vm_state_change(void *opaque, bool running,
/*
* Load the TPM state blobs into the TPM.
*
* Returns negative errno codes in case of error.
*/
static int tpm_emulator_post_load(void *opaque, int version_id, Error **errp)
static bool tpm_emulator_post_load(void *opaque, int version_id, Error **errp)
{
TPMBackend *tb = opaque;
int ret;
ret = tpm_emulator_set_state_blobs(tb, errp);
if (ret < 0) {
return ret;
return false;
}
if (tpm_emulator_startup_tpm_resume(tb, 0, true) < 0) {
return -EIO;
if (tpm_emulator_startup_tpm_resume(tb, 0, true, errp) < 0) {
return false;
}
return 0;
return true;
}
static const VMStateDescription vmstate_tpm_emulator = {
+3 -3
View File
@@ -446,15 +446,15 @@ The functions to do that are inside a vmstate definition, and are called:
Following are the errp variants of these functions.
- ``int (*pre_load_errp)(void *opaque, Error **errp);``
- ``bool (*pre_load_errp)(void *opaque, Error **errp);``
This function is called before we load the state of one device.
- ``int (*post_load_errp)(void *opaque, int version_id, Error **errp);``
- ``bool (*post_load_errp)(void *opaque, int version_id, Error **errp);``
This function is called after we load the state of one device.
- ``int (*pre_save_errp)(void *opaque, Error **errp);``
- ``bool (*pre_save_errp)(void *opaque, Error **errp);``
This function is called before we save the state of one device.
+14 -7
View File
@@ -1225,7 +1225,8 @@ static int virtio_gpu_save(QEMUFile *f, void *opaque, size_t size,
{
VirtIOGPU *g = opaque;
struct virtio_gpu_simple_resource *res;
int i;
Error *err = NULL;
int i, ret;
/* in 2d mode we should never find unprocessed commands here */
assert(QTAILQ_EMPTY(&g->cmdq));
@@ -1248,8 +1249,12 @@ static int virtio_gpu_save(QEMUFile *f, void *opaque, size_t size,
}
qemu_put_be32(f, 0); /* end of list */
return vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL,
&error_fatal);
ret = vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL,
&err);
if (ret < 0) {
error_report_err(err);
}
return ret;
}
static bool virtio_gpu_load_restore_mapping(VirtIOGPU *g,
@@ -1288,7 +1293,7 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
Error *err = NULL;
struct virtio_gpu_simple_resource *res;
uint32_t resource_id, pformat;
int i;
int i, ret;
g->hostmem = 0;
@@ -1348,9 +1353,11 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
}
/* load & apply scanout state */
vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1, &error_fatal);
return 0;
ret = vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1, &err);
if (ret < 0) {
error_report_err(err);
}
return ret;
}
static int virtio_gpu_blob_save(QEMUFile *f, void *opaque, size_t size,
-1
View File
@@ -841,7 +841,6 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
error_setg(&kvm_nv_migration_blocker,
"Live migration disabled because KVM nested virt is enabled");
if (migrate_add_blocker(&kvm_nv_migration_blocker, errp)) {
error_free(kvm_nv_migration_blocker);
return;
}
+13 -2
View File
@@ -921,21 +921,32 @@ const VMStateDescription vmstate_pci_device = {
void pci_device_save(PCIDevice *s, QEMUFile *f)
{
Error *local_err = NULL;
int ret;
/* Clear interrupt status bit: it is implicit
* in irq_state which we are saving.
* This makes us compatible with old devices
* which never set or clear this bit. */
s->config[PCI_STATUS] &= ~PCI_STATUS_INTERRUPT;
vmstate_save_state(f, &vmstate_pci_device, s, NULL, &error_fatal);
ret = vmstate_save_state(f, &vmstate_pci_device, s, NULL, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
/* Restore the interrupt status bit. */
pci_update_irq_status(s);
}
int pci_device_load(PCIDevice *s, QEMUFile *f)
{
Error *local_err = NULL;
int ret;
ret = vmstate_load_state(f, &vmstate_pci_device, s, s->version_id,
&error_fatal);
&local_err);
if (ret < 0) {
error_report_err(local_err);
}
/* Restore the interrupt status bit. */
pci_update_irq_status(s);
return ret;
+15 -2
View File
@@ -1130,13 +1130,26 @@ static int virtio_ccw_load_queue(DeviceState *d, int n, QEMUFile *f)
static void virtio_ccw_save_config(DeviceState *d, QEMUFile *f)
{
VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
vmstate_save_state(f, &vmstate_virtio_ccw_dev, dev, NULL, &error_fatal);
Error *local_err = NULL;
int ret;
ret = vmstate_save_state(f, &vmstate_virtio_ccw_dev, dev, NULL, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
}
static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)
{
VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
return vmstate_load_state(f, &vmstate_virtio_ccw_dev, dev, 1, &error_fatal);
Error *local_err = NULL;
int ret;
ret = vmstate_load_state(f, &vmstate_virtio_ccw_dev, dev, 1, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
return ret;
}
static void virtio_ccw_pre_plugged(DeviceState *d, Error **errp)
+8 -2
View File
@@ -628,10 +628,16 @@ static const VMStateDescription vmstate_spapr_vscsi_req = {
static void vscsi_save_request(QEMUFile *f, SCSIRequest *sreq)
{
vscsi_req *req = sreq->hba_private;
Error *local_err = NULL;
int rc;
assert(req->active);
vmstate_save_state(f, &vmstate_spapr_vscsi_req, req, NULL, &error_fatal);
rc = vmstate_save_state(f, &vmstate_spapr_vscsi_req, req, NULL, &local_err);
if (rc < 0) {
error_report_err(local_err);
return;
}
trace_spapr_vscsi_save_request(req->qtag, req->cur_desc_num,
req->cur_desc_offset);
}
+3 -3
View File
@@ -977,9 +977,9 @@ static bool vfio_legacy_attach_device(const char *name, VFIODevice *vbasedev,
if (vbasedev->mdev) {
error_setg(&vbasedev->cpr.mdev_blocker,
"CPR does not support vfio mdev %s", vbasedev->name);
if (migrate_add_blocker_modes(&vbasedev->cpr.mdev_blocker, errp,
MIG_MODE_CPR_TRANSFER, MIG_MODE_CPR_EXEC,
-1) < 0) {
if (migrate_add_blocker_modes(&vbasedev->cpr.mdev_blocker,
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC),
errp) < 0) {
goto hiod_unref_exit;
}
}
+3 -3
View File
@@ -158,9 +158,9 @@ bool vfio_iommufd_cpr_register_iommufd(IOMMUFDBackend *be, Error **errp)
Error **cpr_blocker = &be->cpr_blocker;
if (!vfio_cpr_supported(be, cpr_blocker)) {
return migrate_add_blocker_modes(cpr_blocker, errp,
MIG_MODE_CPR_TRANSFER,
MIG_MODE_CPR_EXEC, -1) == 0;
return migrate_add_blocker_modes(cpr_blocker,
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_TRANSFER),
errp);
}
vmstate_register(NULL, -1, &iommufd_cpr_vmstate, be);
+4 -4
View File
@@ -176,9 +176,9 @@ bool vfio_legacy_cpr_register_container(VFIOLegacyContainer *container,
MIG_MODE_CPR_REBOOT);
if (!vfio_cpr_supported(container, cpr_blocker)) {
return migrate_add_blocker_modes(cpr_blocker, errp,
MIG_MODE_CPR_TRANSFER,
MIG_MODE_CPR_EXEC, -1) == 0;
return migrate_add_blocker_modes(cpr_blocker,
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC),
errp) == 0;
}
vfio_cpr_add_kvm_notifier();
@@ -187,7 +187,7 @@ bool vfio_legacy_cpr_register_container(VFIOLegacyContainer *container,
migration_add_notifier_modes(&container->cpr.transfer_notifier,
vfio_cpr_fail_notifier,
MIG_MODE_CPR_TRANSFER, MIG_MODE_CPR_EXEC, -1);
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC));
return true;
}
+2 -3
View File
@@ -197,8 +197,7 @@ void vfio_cpr_add_kvm_notifier(void)
if (!kvm_close_notifier.notify) {
migration_add_notifier_modes(&kvm_close_notifier,
vfio_cpr_kvm_close_notifier,
MIG_MODE_CPR_TRANSFER, MIG_MODE_CPR_EXEC,
-1);
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC));
}
}
@@ -285,7 +284,7 @@ void vfio_cpr_pci_register_device(VFIOPCIDevice *vdev)
{
migration_add_notifier_modes(&vdev->cpr.transfer_notifier,
vfio_cpr_pci_notifier,
MIG_MODE_CPR_TRANSFER, MIG_MODE_CPR_EXEC, -1);
BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC));
}
void vfio_cpr_pci_unregister_device(VFIOPCIDevice *vdev)
+2 -2
View File
@@ -345,8 +345,8 @@ bool vfio_device_get_name(VFIODevice *vbasedev, Error **errp)
"vfio device with fd=%d needs an id property",
vbasedev->fd);
return migrate_add_blocker_modes(&vbasedev->cpr.id_blocker,
errp, MIG_MODE_CPR_TRANSFER,
-1) == 0;
BIT(MIG_MODE_CPR_TRANSFER),
errp) == 0;
}
}
}
+13 -2
View File
@@ -612,15 +612,26 @@ static const VMStateDescription vmstate_virtio_mmio = {
static void virtio_mmio_save_extra_state(DeviceState *opaque, QEMUFile *f)
{
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque);
Error *local_err = NULL;
int ret;
vmstate_save_state(f, &vmstate_virtio_mmio, proxy, NULL, &error_fatal);
ret = vmstate_save_state(f, &vmstate_virtio_mmio, proxy, NULL, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
}
static int virtio_mmio_load_extra_state(DeviceState *opaque, QEMUFile *f)
{
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque);
Error *local_err = NULL;
int ret;
return vmstate_load_state(f, &vmstate_virtio_mmio, proxy, 1, &error_fatal);
ret = vmstate_load_state(f, &vmstate_virtio_mmio, proxy, 1, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
return ret;
}
static bool virtio_mmio_has_extra_state(DeviceState *opaque)
+13 -2
View File
@@ -187,15 +187,26 @@ static bool virtio_pci_has_extra_state(DeviceState *d)
static void virtio_pci_save_extra_state(DeviceState *d, QEMUFile *f)
{
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
Error *local_err = NULL;
int ret;
vmstate_save_state(f, &vmstate_virtio_pci, proxy, NULL, &error_fatal);
ret = vmstate_save_state(f, &vmstate_virtio_pci, proxy, NULL, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
}
static int virtio_pci_load_extra_state(DeviceState *d, QEMUFile *f)
{
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
Error *local_err = NULL;
int ret;
return vmstate_load_state(f, &vmstate_virtio_pci, proxy, 1, &error_fatal);
ret = vmstate_load_state(f, &vmstate_virtio_pci, proxy, 1, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
return ret;
}
static void virtio_pci_save_queue(DeviceState *d, int n, QEMUFile *f)
+7 -3
View File
@@ -3030,7 +3030,7 @@ int virtio_save(VirtIODevice *vdev, QEMUFile *f)
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
uint32_t guest_features_lo = (vdev->guest_features & 0xffffffff);
int i;
int i, ret;
Error *local_err = NULL;
if (k->save_config) {
@@ -3075,7 +3075,7 @@ int virtio_save(VirtIODevice *vdev, QEMUFile *f)
}
if (vdc->vmsd) {
int ret = vmstate_save_state(f, vdc->vmsd, vdev, NULL, &local_err);
ret = vmstate_save_state(f, vdc->vmsd, vdev, NULL, &local_err);
if (ret) {
error_report_err(local_err);
return ret;
@@ -3083,7 +3083,11 @@ int virtio_save(VirtIODevice *vdev, QEMUFile *f)
}
/* Subsections */
return vmstate_save_state(f, &vmstate_virtio, vdev, NULL, &error_fatal);
ret = vmstate_save_state(f, &vmstate_virtio, vdev, NULL, &local_err);
if (ret < 0) {
error_report_err(local_err);
}
return ret;
}
/* A wrapper for use as a VMState .put function */
+15
View File
@@ -871,6 +871,21 @@ void qio_channel_wake_read(QIOChannel *ioc);
void qio_channel_wait(QIOChannel *ioc,
GIOCondition condition);
/**
* qio_channel_wait_cond:
* @ioc: the channel object
* @condition: the I/O condition to wait for
*
* Block execution from the current thread until
* the condition indicated by @condition becomes
* available.
*
* This will work with/without a coroutine context, by automatically select
* the proper API to wait.
*/
void qio_channel_wait_cond(QIOChannel *ioc,
GIOCondition condition);
/**
* qio_channel_set_aio_fd_handler:
* @ioc: the channel object
+3 -6
View File
@@ -16,8 +16,6 @@
#include "qapi/qapi-types-migration.h"
#define MIG_MODE_ALL MIG_MODE__MAX
/**
* @migrate_add_blocker - prevent all modes of migration from proceeding
*
@@ -82,16 +80,15 @@ int migrate_add_blocker_normal(Error **reasonp, Error **errp);
*
* @reasonp - address of an error to be returned whenever migration is attempted
*
* @errp - [out] The reason (if any) we cannot block migration right now.
* @modes - the migration modes to be blocked, a bit set of MigMode
*
* @mode - one or more migration modes to be blocked. The list is terminated
* by -1 or MIG_MODE_ALL. For the latter, all modes are blocked.
* @errp - [out] The reason (if any) we cannot block migration right now.
*
* @returns - 0 on success, -EBUSY/-EACCES on failure, with errp set.
*
* *@reasonp is freed and set to NULL if failure is returned.
* On success, the caller must not free *@reasonp before the blocker is removed.
*/
int migrate_add_blocker_modes(Error **reasonp, Error **errp, MigMode mode, ...);
int migrate_add_blocker_modes(Error **reasonp, unsigned modes, Error **errp);
#endif
+2 -2
View File
@@ -41,7 +41,7 @@ MigMode cpr_get_incoming_mode(void);
void cpr_set_incoming_mode(MigMode mode);
bool cpr_is_incoming(void);
int cpr_state_save(MigrationChannel *channel, Error **errp);
bool cpr_state_save(MigrationChannel *channel, Error **errp);
int cpr_state_load(MigrationChannel *channel, Error **errp);
void cpr_state_close(void);
struct QIOChannel *cpr_state_ioc(void);
@@ -56,7 +56,7 @@ QEMUFile *cpr_transfer_input(MigrationChannel *channel, Error **errp);
void cpr_exec_init(void);
QEMUFile *cpr_exec_output(Error **errp);
QEMUFile *cpr_exec_input(Error **errp);
void cpr_exec_persist_state(QEMUFile *f);
bool cpr_exec_persist_state(QEMUFile *f, Error **errp);
bool cpr_exec_has_state(void);
void cpr_exec_unpersist_state(void);
void cpr_exec_unpreserve_fds(void);

Some files were not shown because too many files have changed in this diff Show More