[PATCH 0/3] Set runstate to RUN_STATE_RESTORE_VM when started with "-loadvm"

Joelle van Dyne posted 3 patches 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220813011031.3744-1-j@getutm.app
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
hw/usb/redirect.c  | 2 +-
softmmu/runstate.c | 1 +
softmmu/vl.c       | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
[PATCH 0/3] Set runstate to RUN_STATE_RESTORE_VM when started with "-loadvm"
Posted by Joelle van Dyne 1 year, 8 months ago
Previously, there was a bug in usbredir which prevented "-loadvm" from working
because libusbredir's usbredirparser_unserialize() fails when a HELLO packet is
sent as part of the device's initalization.

The fix was to not send HELLO when in the RUN_STATE_PRELAUNCH state. However,
recently we found that this breaks when QEMU is started with "-S" because it
is in the RUN_STATE_PRELAUNCH state while halted before boot as well.

This patch attempts to re-fix the issue by setting the run state to
RUN_STATE_RESTORE_VM when started with "-loadvm" and recognizing that state
in usbredir's initalization.

To make sure there's no unintended side effects, we searched for
"RUN_STATE_RESTORE_VM" in the code base and found only references in
migration/savevm.c, monitor/hmp-cmds.c, and replay/replay-debugging.c. None of
these seems to be affected by RUN_STATE_RESTORE_VM before RUN_STATE_RUNNING.

Joelle van Dyne (3):
  Revert "usbredir: avoid queuing hello packet on snapshot restore"
  vl: on -loadvm set run state to "restore-vm"
  usbredir: avoid queuing hello packet on snapshot restore

 hw/usb/redirect.c  | 2 +-
 softmmu/runstate.c | 1 +
 softmmu/vl.c       | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.28.0