diff options
| author | Haoqian He <haoqian.he@smartx.com> | 2025-04-15 22:47:26 -0400 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2025-05-14 05:39:14 -0400 |
| commit | e0f300b36da1ee794fd81aa95f56e7bc9f010d46 (patch) | |
| tree | 92108e6532ae82ee40f3d2cf803d67f4733ed2ee /hw/scsi/scsi-bus.c | |
| parent | 8717987fb528ff704e275a1a99f59a20e0b272f5 (diff) | |
| download | focaccia-qemu-e0f300b36da1ee794fd81aa95f56e7bc9f010d46.tar.gz focaccia-qemu-e0f300b36da1ee794fd81aa95f56e7bc9f010d46.zip | |
system/runstate: add VM state change cb with return value
This patch adds the new VM state change cb type `VMChangeStateHandlerWithRet`, which has return value for `VMChangeStateEntry`. Thus, we can register a new VM state change cb with return value for device. Note that `VMChangeStateHandler` and `VMChangeStateHandlerWithRet` are mutually exclusive and cannot be provided at the same time. This patch is the pre patch for 'vhost-user: return failure if backend crashes when live migration', which makes the live migration aware of the loss of connection with the vhost-user backend and aborts the live migration. Virtio device will use VMChangeStateHandlerWithRet. Signed-off-by: Haoqian He <haoqian.he@smartx.com> Message-Id: <20250416024729.3289157-2-haoqian.he@smartx.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-bus.c')
| -rw-r--r-- | hw/scsi/scsi-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 70be4a7367..9b12ee7f1c 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -400,7 +400,7 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp) return; } dev->vmsentry = qdev_add_vm_change_state_handler(DEVICE(dev), - scsi_dma_restart_cb, dev); + scsi_dma_restart_cb, NULL, dev); } static void scsi_qdev_unrealize(DeviceState *qdev) |