Projects
home:dongzhihai
qemu
_service:tar_scm:vhost-implement-post-resume-bh...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:vhost-implement-post-resume-bh.patch of Package qemu
From 229737ca91d4e81b4a14143da9981bd59b80a539 Mon Sep 17 00:00:00 2001 From: libai <libai12@huawei.com> Date: Mon, 4 Dec 2023 15:57:35 +0800 Subject: [PATCH] vhost: implement post resume bh Set vdpa device mig state to post start when vm post start Signed-off-by: libai <libai12@huawei.com> --- hw/virtio/vdpa-dev-mig.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/virtio/vdpa-dev-mig.c b/hw/virtio/vdpa-dev-mig.c index 662d4a29dc..1872f11f3f 100644 --- a/hw/virtio/vdpa-dev-mig.c +++ b/hw/virtio/vdpa-dev-mig.c @@ -26,6 +26,7 @@ #include "qemu/error-report.h" #include "hw/virtio/vdpa-dev-mig.h" #include "migration/qemu-file-types.h" +#include "qemu/main-loop.h" /* * Flags used as delimiter: @@ -218,6 +219,18 @@ err_host_notifiers: return ret; } +static void vdpa_dev_migration_handle_incoming_bh(void *opaque) +{ + struct vhost_dev *hdev = opaque; + int ret; + + /* Post start device, unsupport rollback if failed! */ + ret = vhost_vdpa_set_mig_state(hdev, VDPA_DEVICE_POST_START); + if (ret) { + error_report("Failed to set state: POST_START\n"); + } +} + static void vdpa_dev_vmstate_change(void *opaque, bool running, RunState state) { VhostVdpaDevice *vdpa = VHOST_VDPA_DEVICE(opaque); @@ -247,6 +260,10 @@ static void vdpa_dev_vmstate_change(void *opaque, bool running, RunState state) if (mis->state == RUN_STATE_RESTORE_VM) { vhost_vdpa_call(hdev, VHOST_VDPA_RESUME, NULL); + /* post resume */ + mis->bh = qemu_bh_new(vdpa_dev_migration_handle_incoming_bh, + hdev); + qemu_bh_schedule(mis->bh); } } } -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2