mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
Migration pull for 9.1
- Het's new test cases for "channels" - Het's fix for a typo for vsock parsing - Cedric's VFIO error report series - Cedric's one more patch for dirty-bitmap error reports - Zhijian's rdma deprecation patch - Yuan's zeropage optimization to fix double faults on anon mem - Zhijian's COLO fix on a crash -----BEGIN PGP SIGNATURE----- iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZig4HxIccGV0ZXJ4QHJl ZGhhdC5jb20ACgkQO1/MzfOr1wbQiwD/V5nSJzSuAG4Ra1Fjo+LRG2TT6qk8eNCi fIytehSw6cYA/0wqarxOF0tr7ikeyhtG3w4xFf44kk6KcPkoVSl1tqoL =pJmQ -----END PGP SIGNATURE----- Merge tag 'migration-20240423-pull-request' of https://gitlab.com/peterx/qemu into staging Migration pull for 9.1 - Het's new test cases for "channels" - Het's fix for a typo for vsock parsing - Cedric's VFIO error report series - Cedric's one more patch for dirty-bitmap error reports - Zhijian's rdma deprecation patch - Yuan's zeropage optimization to fix double faults on anon mem - Zhijian's COLO fix on a crash # -----BEGIN PGP SIGNATURE----- # # iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZig4HxIccGV0ZXJ4QHJl # ZGhhdC5jb20ACgkQO1/MzfOr1wbQiwD/V5nSJzSuAG4Ra1Fjo+LRG2TT6qk8eNCi # fIytehSw6cYA/0wqarxOF0tr7ikeyhtG3w4xFf44kk6KcPkoVSl1tqoL # =pJmQ # -----END PGP SIGNATURE----- # gpg: Signature made Tue 23 Apr 2024 03:37:19 PM PDT # 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: This key 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 'migration-20240423-pull-request' of https://gitlab.com/peterx/qemu: (26 commits) migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed. migration/multifd: solve zero page causing multiple page faults migration: Add Error** argument to add_bitmaps_to_list() migration: Modify ram_init_bitmaps() to report dirty tracking errors migration: Add Error** argument to xbzrle_init() migration: Add Error** argument to ram_state_init() memory: Add Error** argument to the global_dirty_log routines migration: Introduce ram_bitmaps_destroy() memory: Add Error** argument to .log_global_start() handler migration: Add Error** argument to .load_setup() handler migration: Add Error** argument to .save_setup() handler migration: Add Error** argument to qemu_savevm_state_setup() migration: Add Error** argument to vmstate_save() migration: Always report an error in ram_save_setup() migration: Always report an error in block_save_setup() vfio: Always report an error in vfio_save_setup() s390/stattrib: Add Error** argument to set_migrationmode() handler tests/qtest/migration: Fix typo for vsock in SocketAddress_to_str tests/qtest/migration: Add negative tests to validate migration QAPIs tests/qtest/migration: Add multifd_tcp_plain test using list of channels instead of uri ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
88daa112d4
28 changed files with 558 additions and 216 deletions
|
@ -457,11 +457,12 @@ static void xen_log_sync(MemoryListener *listener, MemoryRegionSection *section)
|
|||
int128_get64(section->size));
|
||||
}
|
||||
|
||||
static void xen_log_global_start(MemoryListener *listener)
|
||||
static bool xen_log_global_start(MemoryListener *listener, Error **errp)
|
||||
{
|
||||
if (xen_enabled()) {
|
||||
xen_in_migration = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void xen_log_global_stop(MemoryListener *listener)
|
||||
|
@ -668,7 +669,7 @@ void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
|
|||
void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
|
||||
{
|
||||
if (enable) {
|
||||
memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION);
|
||||
memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION, errp);
|
||||
} else {
|
||||
memory_global_dirty_log_stop(GLOBAL_DIRTY_MIGRATION);
|
||||
}
|
||||
|
|
|
@ -2174,7 +2174,7 @@ static const VMStateDescription vmstate_spapr = {
|
|||
}
|
||||
};
|
||||
|
||||
static int htab_save_setup(QEMUFile *f, void *opaque)
|
||||
static int htab_save_setup(QEMUFile *f, void *opaque, Error **errp)
|
||||
{
|
||||
SpaprMachineState *spapr = opaque;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "sysemu/kvm.h"
|
||||
#include "exec/ram_addr.h"
|
||||
#include "kvm/kvm_s390x.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
Object *kvm_s390_stattrib_create(void)
|
||||
{
|
||||
|
@ -137,14 +138,21 @@ static void kvm_s390_stattrib_synchronize(S390StAttribState *sa)
|
|||
}
|
||||
}
|
||||
|
||||
static int kvm_s390_stattrib_set_migrationmode(S390StAttribState *sa, bool val)
|
||||
static int kvm_s390_stattrib_set_migrationmode(S390StAttribState *sa, bool val,
|
||||
Error **errp)
|
||||
{
|
||||
struct kvm_device_attr attr = {
|
||||
.group = KVM_S390_VM_MIGRATION,
|
||||
.attr = val,
|
||||
.addr = 0,
|
||||
};
|
||||
return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
|
||||
int r;
|
||||
|
||||
r = kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
|
||||
if (r) {
|
||||
error_setg_errno(errp, -r, "setting KVM_S390_VM_MIGRATION failed");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static long long kvm_s390_stattrib_get_dirtycount(S390StAttribState *sa)
|
||||
|
|
|
@ -60,11 +60,13 @@ void hmp_migrationmode(Monitor *mon, const QDict *qdict)
|
|||
S390StAttribState *sas = s390_get_stattrib_device();
|
||||
S390StAttribClass *sac = S390_STATTRIB_GET_CLASS(sas);
|
||||
uint64_t what = qdict_get_int(qdict, "mode");
|
||||
Error *local_err = NULL;
|
||||
int r;
|
||||
|
||||
r = sac->set_migrationmode(sas, what);
|
||||
r = sac->set_migrationmode(sas, what, &local_err);
|
||||
if (r < 0) {
|
||||
monitor_printf(mon, "Error: %s", strerror(-r));
|
||||
monitor_printf(mon, "Error: %s", error_get_pretty(local_err));
|
||||
error_free(local_err);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +168,7 @@ static int cmma_load(QEMUFile *f, void *opaque, int version_id)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int cmma_save_setup(QEMUFile *f, void *opaque)
|
||||
static int cmma_save_setup(QEMUFile *f, void *opaque, Error **errp)
|
||||
{
|
||||
S390StAttribState *sas = S390_STATTRIB(opaque);
|
||||
S390StAttribClass *sac = S390_STATTRIB_GET_CLASS(sas);
|
||||
|
@ -175,7 +177,7 @@ static int cmma_save_setup(QEMUFile *f, void *opaque)
|
|||
* Signal that we want to start a migration, thus needing PGSTE dirty
|
||||
* tracking.
|
||||
*/
|
||||
res = sac->set_migrationmode(sas, 1);
|
||||
res = sac->set_migrationmode(sas, true, errp);
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
|
@ -260,7 +262,7 @@ static void cmma_save_cleanup(void *opaque)
|
|||
{
|
||||
S390StAttribState *sas = S390_STATTRIB(opaque);
|
||||
S390StAttribClass *sac = S390_STATTRIB_GET_CLASS(sas);
|
||||
sac->set_migrationmode(sas, 0);
|
||||
sac->set_migrationmode(sas, false, NULL);
|
||||
}
|
||||
|
||||
static bool cmma_active(void *opaque)
|
||||
|
@ -293,7 +295,8 @@ static long long qemu_s390_get_dirtycount_stub(S390StAttribState *sa)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static int qemu_s390_set_migrationmode_stub(S390StAttribState *sa, bool value)
|
||||
static int qemu_s390_set_migrationmode_stub(S390StAttribState *sa, bool value,
|
||||
Error **errp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1066,7 +1066,8 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void vfio_listener_log_global_start(MemoryListener *listener)
|
||||
static bool vfio_listener_log_global_start(MemoryListener *listener,
|
||||
Error **errp)
|
||||
{
|
||||
VFIOContainerBase *bcontainer = container_of(listener, VFIOContainerBase,
|
||||
listener);
|
||||
|
@ -1083,6 +1084,7 @@ static void vfio_listener_log_global_start(MemoryListener *listener)
|
|||
ret, strerror(-ret));
|
||||
vfio_set_migration_error(ret);
|
||||
}
|
||||
return !ret;
|
||||
}
|
||||
|
||||
static void vfio_listener_log_global_stop(MemoryListener *listener)
|
||||
|
|
|
@ -376,11 +376,12 @@ static int vfio_save_prepare(void *opaque, Error **errp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int vfio_save_setup(QEMUFile *f, void *opaque)
|
||||
static int vfio_save_setup(QEMUFile *f, void *opaque, Error **errp)
|
||||
{
|
||||
VFIODevice *vbasedev = opaque;
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
uint64_t stop_copy_size = VFIO_MIG_DEFAULT_DATA_BUFFER_SIZE;
|
||||
int ret;
|
||||
|
||||
qemu_put_be64(f, VFIO_MIG_FLAG_DEV_SETUP_STATE);
|
||||
|
||||
|
@ -389,19 +390,19 @@ static int vfio_save_setup(QEMUFile *f, void *opaque)
|
|||
stop_copy_size);
|
||||
migration->data_buffer = g_try_malloc0(migration->data_buffer_size);
|
||||
if (!migration->data_buffer) {
|
||||
error_report("%s: Failed to allocate migration data buffer",
|
||||
vbasedev->name);
|
||||
error_setg(errp, "%s: Failed to allocate migration data buffer",
|
||||
vbasedev->name);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (vfio_precopy_supported(vbasedev)) {
|
||||
int ret;
|
||||
|
||||
switch (migration->device_state) {
|
||||
case VFIO_DEVICE_STATE_RUNNING:
|
||||
ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_PRE_COPY,
|
||||
VFIO_DEVICE_STATE_RUNNING);
|
||||
if (ret) {
|
||||
error_setg(errp, "%s: Failed to set new PRE_COPY state",
|
||||
vbasedev->name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -412,6 +413,8 @@ static int vfio_save_setup(QEMUFile *f, void *opaque)
|
|||
/* vfio_save_complete_precopy() will go to STOP_COPY */
|
||||
break;
|
||||
default:
|
||||
error_setg(errp, "%s: Invalid device state %d", vbasedev->name,
|
||||
migration->device_state);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
@ -420,7 +423,12 @@ static int vfio_save_setup(QEMUFile *f, void *opaque)
|
|||
|
||||
qemu_put_be64(f, VFIO_MIG_FLAG_END_OF_STATE);
|
||||
|
||||
return qemu_file_get_error(f);
|
||||
ret = qemu_file_get_error(f);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "%s: save setup failed", vbasedev->name);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void vfio_save_cleanup(void *opaque)
|
||||
|
@ -580,12 +588,17 @@ static void vfio_save_state(QEMUFile *f, void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
static int vfio_load_setup(QEMUFile *f, void *opaque)
|
||||
static int vfio_load_setup(QEMUFile *f, void *opaque, Error **errp)
|
||||
{
|
||||
VFIODevice *vbasedev = opaque;
|
||||
int ret;
|
||||
|
||||
return vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_RESUMING,
|
||||
ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_RESUMING,
|
||||
vbasedev->migration->device_state);
|
||||
if (ret) {
|
||||
error_setg(errp, "%s: Failed to set RESUMING state", vbasedev->name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int vfio_load_cleanup(void *opaque)
|
||||
|
|
|
@ -1044,7 +1044,7 @@ check_dev_state:
|
|||
return r;
|
||||
}
|
||||
|
||||
static void vhost_log_global_start(MemoryListener *listener)
|
||||
static bool vhost_log_global_start(MemoryListener *listener, Error **errp)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
@ -1052,6 +1052,7 @@ static void vhost_log_global_start(MemoryListener *listener)
|
|||
if (r < 0) {
|
||||
abort();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void vhost_log_global_stop(MemoryListener *listener)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue