diff -Nru qemu-4.2/debian/changelog qemu-4.2/debian/changelog --- qemu-4.2/debian/changelog 2022-06-22 01:36:53.000000000 +1000 +++ qemu-4.2/debian/changelog 2022-10-24 14:53:33.000000000 +1000 @@ -1,3 +1,17 @@ +qemu (1:4.2-3ubuntu6.23~cloud0lp1982284b3) bionic; urgency=medium + + * d/p/lp1982284-migration-Read-state-once.patch + (LP: #1982284) + + -- Brett Milford Mon, 24 Oct 2022 04:53:33 +0000 + +qemu (1:4.2-3ubuntu6.23~cloud0lp1982284b2) bionic; urgency=medium + + * d/p/lp1982284-migration-Read-state-once.patch + (LP: #1982284) + + -- Brett Milford Mon, 17 Oct 2022 10:30:35 +1000 + qemu (1:4.2-3ubuntu6.23~cloud0) bionic-ussuri; urgency=medium * New update for the Ubuntu Cloud Archive. diff -Nru qemu-4.2/debian/patches/lp1982284-migration-Read-state-once.patch qemu-4.2/debian/patches/lp1982284-migration-Read-state-once.patch --- qemu-4.2/debian/patches/lp1982284-migration-Read-state-once.patch 1970-01-01 10:00:00.000000000 +1000 +++ qemu-4.2/debian/patches/lp1982284-migration-Read-state-once.patch 2022-10-24 14:52:45.000000000 +1000 @@ -0,0 +1,55 @@ +From 552de79bfdd5e9e53847eb3c6d6e4cd898a4370e Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 13 Apr 2022 12:33:29 +0100 +Subject: [PATCH] migration: Read state once + +The 'status' field for the migration is updated normally using +an atomic operation from the migration thread. +Most readers of it aren't that careful, and in most cases it doesn't +matter. + +In query_migrate->fill_source_migration_info the 'state' +is read twice; the first time to decide which state fields to fill in, +and then secondly to copy the state to the status field; that can end up +with a status that's inconsistent; e.g. setting up the fields +for 'setup' and then having an 'active' status. In that case +libvirt gets upset by the lack of ram info. +The symptom is: + libvirt.libvirtError: internal error: migration was active, but no RAM info was set + +Read the state exactly once in fill_source_migration_info. + +This is a possible fix for: +https://bugzilla.redhat.com/show_bug.cgi?id=2074205 + +Signed-off-by: Dr. David Alan Gilbert +Message-Id: <20220413113329.103696-1-dgilbert@redhat.com> +Reviewed-by: Juan Quintela +Reviewed-by: Peter Xu +Signed-off-by: Dr. David Alan Gilbert +--- + migration/migration.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -915,8 +915,9 @@ static void populate_disk_info(Migration + static void fill_source_migration_info(MigrationInfo *info) + { + MigrationState *s = migrate_get_current(); ++ int state = atomic_read(&s->state); + +- switch (s->state) { ++ switch (state) { + case MIGRATION_STATUS_NONE: + /* no migration has happened ever */ + /* do not overwrite destination migration status */ +@@ -960,7 +961,7 @@ static void fill_source_migration_info(M + info->has_status = true; + break; + } +- info->status = s->state; ++ info->status = state; + } + + /** diff -Nru qemu-4.2/debian/patches/series qemu-4.2/debian/patches/series --- qemu-4.2/debian/patches/series 2022-06-22 01:37:47.000000000 +1000 +++ qemu-4.2/debian/patches/series 2022-10-24 14:51:36.000000000 +1000 @@ -346,3 +346,4 @@ CVE-2021-4207.patch CVE-2022-26353.patch CVE-2022-26354.patch +lp1982284-migration-Read-state-once.patch