mbox series

[v2,0/6] vhost-user-blk: live resize additional APIs

Message ID 20240301171143.809835-1-vsementsov@yandex-team.ru
Headers show
Series vhost-user-blk: live resize additional APIs | expand

Message

Vladimir Sementsov-Ogievskiy March 1, 2024, 5:11 p.m. UTC
v2:
- now based on master
- drop x- prefixes, still keep new APIs "unstable"

Also:

01: add a-b by Raphael
    add note about removed comment "valid for resize only"
02-03: new patches, following review of old "02", which is now 04
04: use GenericError
    wording
    keep short name device-sync-config still
06: rename event to VIRTIO_CONFIG_READ

===

In vhost-user protocol we have VHOST_USER_BACKEND_CONFIG_CHANGE_MSG,
which backend may send to notify Qemu, that we should re-read the
config, and notify the guest.

Still that's not always convenient: backend may not support this
message. Also, having QMP command to force config sync is more reliable
than waiting for notification from external program. It also may be
helpful for debug/restore: if we have changed disk size, but guest
doesn't see that, it's good to have a separate QMP command to trigger
resync of the config.

So, the series proposes two experimental APIs:

1. device-sync-config command, to trigger config synchronization

2. CONFIG_READ event, which notify management tool that guest read the
updated config. Of course, that can't guarantee that the guest correctly
handled the updated config, but it's still better than nothing: for sure
guest will not show new disk size until it read the updated config. So,
management tool may wait for this event to report success to the user.

Vladimir Sementsov-Ogievskiy (6):
  vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change
  qdev-monitor: fix error message in find_device_state()
  qdev-monitor: add option to report GenericError from find_device_state
  qapi: introduce device-sync-config
  qapi: device-sync-config: check runstate
  qapi: introduce CONFIG_READ event

 hw/block/vhost-user-blk.c | 32 +++++++++++-------
 hw/virtio/virtio-pci.c    | 18 ++++++++++
 include/hw/qdev-core.h    |  3 ++
 include/monitor/qdev.h    |  2 ++
 include/sysemu/runstate.h |  1 +
 monitor/monitor.c         |  1 +
 qapi/qdev.json            | 43 ++++++++++++++++++++++++
 stubs/qdev.c              |  6 ++++
 system/qdev-monitor.c     | 71 ++++++++++++++++++++++++++++++++++++---
 system/runstate.c         |  5 +++
 10 files changed, 165 insertions(+), 17 deletions(-)