mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 13:31:52 -06:00
Migration pull request
Fixes for cpr-transfer (live update functionality). -----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmfUQEYQHGZhcm9zYXNA c3VzZS5kZQAKCRDHmNx0G+wxne24D/9iwMQyOuD+F3MYvX9tSmqD7KAxTsUOT1yk +jD6/b05FwuAqTQVFLOyIg3bowYuScdgDY6LOHf8T/+NtO9xe305RDE+q8ZXVA16 ldOPHc1Fvm7c79ShohAJIebec7h6UaWQ390kpbAyIXFRW8gZjvYe64hDAsRQLNQy ykkD+5G5dBWU4pOJh5w9Q+C3yIM3IMwyPcP3zJsmrDyAs20B/BrnC0kIaq90rAyS qYWIk1ttPrOckeOLK4bPM/bGNvIJWxzdBLgFqhRfTotfdSCj0YCDNhqN5JHKjQvY 6bPzqr1BVOql4TpuwykYpUFWONQLeFasTfJxckls8s0qifkUWYRpQXT7+gWYrdHt 3NId+0XG1Vq8gAXbEoQXCozsq0LAW9REryTQBCTZIJ1n8hwWuXLLUB1k9e2f1mXq SyKrko2CADvWAQKz1Nl7MQc73vuHI/rK8W+JHlhT1KHfMPeXM06K+bBU2w4kQLhn t8wfv5l1z4nH4Jmn4f5kmhbAzEfSny1FQXxGWwfamgw85FCYdmsJ0JTX0nosLIYf 5ntOeJp2KnILtbSyd3c44jE1u/eSlw5Yb05SWjiUwFpDKo/1LBi61deJtbxoG6rE pJauuOEM/X9GpAU1drlT9G0scwLRKGZBJ1FbOU43bMUbEF2fQiPi4pGeW428Ol4y ggk8QixbGg== =w3AQ -----END PGP SIGNATURE----- Merge tag 'migration-20250314-pull-request' of https://gitlab.com/farosas/qemu into staging Migration pull request Fixes for cpr-transfer (live update functionality). # -----BEGIN PGP SIGNATURE----- # # iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmfUQEYQHGZhcm9zYXNA # c3VzZS5kZQAKCRDHmNx0G+wxne24D/9iwMQyOuD+F3MYvX9tSmqD7KAxTsUOT1yk # +jD6/b05FwuAqTQVFLOyIg3bowYuScdgDY6LOHf8T/+NtO9xe305RDE+q8ZXVA16 # ldOPHc1Fvm7c79ShohAJIebec7h6UaWQ390kpbAyIXFRW8gZjvYe64hDAsRQLNQy # ykkD+5G5dBWU4pOJh5w9Q+C3yIM3IMwyPcP3zJsmrDyAs20B/BrnC0kIaq90rAyS # qYWIk1ttPrOckeOLK4bPM/bGNvIJWxzdBLgFqhRfTotfdSCj0YCDNhqN5JHKjQvY # 6bPzqr1BVOql4TpuwykYpUFWONQLeFasTfJxckls8s0qifkUWYRpQXT7+gWYrdHt # 3NId+0XG1Vq8gAXbEoQXCozsq0LAW9REryTQBCTZIJ1n8hwWuXLLUB1k9e2f1mXq # SyKrko2CADvWAQKz1Nl7MQc73vuHI/rK8W+JHlhT1KHfMPeXM06K+bBU2w4kQLhn # t8wfv5l1z4nH4Jmn4f5kmhbAzEfSny1FQXxGWwfamgw85FCYdmsJ0JTX0nosLIYf # 5ntOeJp2KnILtbSyd3c44jE1u/eSlw5Yb05SWjiUwFpDKo/1LBi61deJtbxoG6rE # pJauuOEM/X9GpAU1drlT9G0scwLRKGZBJ1FbOU43bMUbEF2fQiPi4pGeW428Ol4y # ggk8QixbGg== # =w3AQ # -----END PGP SIGNATURE----- # gpg: Signature made Fri 14 Mar 2025 10:42:14 EDT # gpg: using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D # gpg: issuer "farosas@suse.de" # gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown] # gpg: aka "Fabiano Almeida Rosas <fabiano.rosas@suse.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: AA1B 48B0 A223 26A5 A4C3 64CF C798 DC74 1BEC 319D * tag 'migration-20250314-pull-request' of https://gitlab.com/farosas/qemu: hw/qxl: fix cpr hw/loader: fix roms during cpr pflash: fix cpr migration: cpr_is_incoming Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
commit
aa90f1161b
5 changed files with 39 additions and 4 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "system/blockdev.h"
|
||||
#include "system/block-backend.h"
|
||||
#include "hw/block/block.h"
|
||||
#include "migration/cpr.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-types-block.h"
|
||||
|
||||
|
@ -66,6 +67,10 @@ bool blk_check_size_and_read_all(BlockBackend *blk, DeviceState *dev,
|
|||
int ret;
|
||||
g_autofree char *dev_id = NULL;
|
||||
|
||||
if (cpr_is_incoming()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
blk_len = blk_getlength(blk);
|
||||
if (blk_len < 0) {
|
||||
error_setg_errno(errp, -blk_len,
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "trace.h"
|
||||
#include "hw/hw.h"
|
||||
#include "disas/disas.h"
|
||||
#include "migration/cpr.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "system/reset.h"
|
||||
|
@ -1029,7 +1030,9 @@ static void *rom_set_mr(Rom *rom, Object *owner, const char *name, bool ro)
|
|||
vmstate_register_ram_global(rom->mr);
|
||||
|
||||
data = memory_region_get_ram_ptr(rom->mr);
|
||||
memcpy(data, rom->data, rom->datasize);
|
||||
if (!cpr_is_incoming()) {
|
||||
memcpy(data, rom->data, rom->datasize);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "qemu/module.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "system/runstate.h"
|
||||
#include "migration/cpr.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "trace.h"
|
||||
|
||||
|
@ -333,6 +334,10 @@ static void init_qxl_rom(PCIQXLDevice *d)
|
|||
uint32_t fb;
|
||||
int i, n;
|
||||
|
||||
if (cpr_is_incoming()) {
|
||||
goto skip_init;
|
||||
}
|
||||
|
||||
memset(rom, 0, d->rom_size);
|
||||
|
||||
rom->magic = cpu_to_le32(QXL_ROM_MAGIC);
|
||||
|
@ -390,6 +395,7 @@ static void init_qxl_rom(PCIQXLDevice *d)
|
|||
sizeof(rom->client_monitors_config));
|
||||
}
|
||||
|
||||
skip_init:
|
||||
d->shadow_rom = *rom;
|
||||
d->rom = rom;
|
||||
d->modes = modes;
|
||||
|
@ -403,6 +409,9 @@ static void init_qxl_ram(PCIQXLDevice *d)
|
|||
|
||||
buf = d->vga.vram_ptr;
|
||||
d->ram = (QXLRam *)(buf + le32_to_cpu(d->shadow_rom.ram_header_offset));
|
||||
if (cpr_is_incoming()) {
|
||||
return;
|
||||
}
|
||||
d->ram->magic = cpu_to_le32(QXL_RAM_MAGIC);
|
||||
d->ram->int_pending = cpu_to_le32(0);
|
||||
d->ram->int_mask = cpu_to_le32(0);
|
||||
|
@ -539,6 +548,10 @@ static void interface_set_compression_level(QXLInstance *sin, int level)
|
|||
|
||||
trace_qxl_interface_set_compression_level(qxl->id, level);
|
||||
qxl->shadow_rom.compression_level = cpu_to_le32(level);
|
||||
if (cpr_is_incoming()) {
|
||||
assert(qxl->rom->compression_level == cpu_to_le32(level));
|
||||
return;
|
||||
}
|
||||
qxl->rom->compression_level = cpu_to_le32(level);
|
||||
qxl_rom_set_dirty(qxl);
|
||||
}
|
||||
|
@ -997,7 +1010,8 @@ static void interface_set_client_capabilities(QXLInstance *sin,
|
|||
}
|
||||
|
||||
if (runstate_check(RUN_STATE_INMIGRATE) ||
|
||||
runstate_check(RUN_STATE_POSTMIGRATE)) {
|
||||
runstate_check(RUN_STATE_POSTMIGRATE) ||
|
||||
cpr_is_incoming()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1200,6 +1214,10 @@ static void qxl_reset_state(PCIQXLDevice *d)
|
|||
{
|
||||
QXLRom *rom = d->rom;
|
||||
|
||||
if (cpr_is_incoming()) {
|
||||
return;
|
||||
}
|
||||
|
||||
qxl_check_state(d);
|
||||
d->shadow_rom.update_id = cpu_to_le32(0);
|
||||
*rom = d->shadow_rom;
|
||||
|
@ -1370,8 +1388,11 @@ static int qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
|
|||
memslot.virt_start = virt_start + (guest_start - pci_start);
|
||||
memslot.virt_end = virt_start + (guest_end - pci_start);
|
||||
memslot.addr_delta = memslot.virt_start - delta;
|
||||
memslot.generation = d->rom->slot_generation = 0;
|
||||
qxl_rom_set_dirty(d);
|
||||
if (!cpr_is_incoming()) {
|
||||
d->rom->slot_generation = 0;
|
||||
qxl_rom_set_dirty(d);
|
||||
}
|
||||
memslot.generation = d->rom->slot_generation;
|
||||
|
||||
qemu_spice_add_memslot(&d->ssd, &memslot, async);
|
||||
d->guest_slots[slot_id].mr = mr;
|
||||
|
|
|
@ -21,6 +21,7 @@ int cpr_find_fd(const char *name, int id);
|
|||
|
||||
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);
|
||||
int cpr_state_load(MigrationChannel *channel, Error **errp);
|
||||
|
|
|
@ -128,6 +128,11 @@ void cpr_set_incoming_mode(MigMode mode)
|
|||
incoming_mode = mode;
|
||||
}
|
||||
|
||||
bool cpr_is_incoming(void)
|
||||
{
|
||||
return incoming_mode != MIG_MODE_NONE;
|
||||
}
|
||||
|
||||
int cpr_state_save(MigrationChannel *channel, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue