On 2025/9/23 17:06,“Stefano Garzarella”<sgarz...@redhat.com <mailto:sgarz...@redhat.com>> wrote:
>CCing Cindy since she introduced this code with commit >f9a09ca3ea ("vhost: add support for configure interrupt"), so she can >help to review this, since I don't really get this change. >On Mon, Sep 22, 2025 at 11:19:32PM +0800, Li Zhaoxin wrote: >>From: lizhaoxin <lizhaoxi...@baidu.com <mailto:lizhaoxi...@baidu.com>> >> >>After the VM is suspended/resumed or live-migrated, >>we do not want the guest to output information such as >>the capacity of the block device, as this is noticeable to the tenant. >>Also, there is no need to immediately send a config notifier >>for the virtio device after vhost_dev_start. >Can you explain more clearly what your problem is and why this patch >solves it? >Thanks, >Stefano Hi Stefano and Cindy, In the vhost-vdpa scenario, after executing virsh suspend vm followed by virsh resume vm, or when live migrating the VM to the destination host, the guest kernel will output the following additional logs: [Tue Sep 23 19:07:04 2025] virtio_blk virtio1: [vda] new size: 20971520 512-byte logical blocks (10.7 GB/10.0 GiB) [Tue Sep 23 19:07:04 2025] virtio_blk virtio3: [vdb] new size: 20971520 512-byte logical blocks (10.7 GB/10.0 GiB) This occurs because when the vhost device is started, the sequence vhost_dev_start -> vhost_start_config_intr -> event_notifier_set(&dev->vdev->config_notifier) is triggered, which sends a configuration change notification (config notification) to the guest. However, it appears that actively sending this notification is currently unnecessary, and no additional processing is performed in the event of a sending failure. So, we removed the call to event_notifier_set(&dev->vdev->config_notifier). Thanks, Li Zhaoxin >> >>Co-developed-by: Gao Shiyuan <gaoshiy...@baidu.com >><mailto:gaoshiy...@baidu.com>> >>Signed-off-by: Gao Shiyuan <gaoshiy...@baidu.com >><mailto:gaoshiy...@baidu.com>> >>Signed-off-by: Li Zhaoxin <lizhaoxi...@baidu.com >><mailto:lizhaoxi...@baidu.com>> >>--- >> hw/virtio/vhost.c | 7 +------ >> 1 file changed, 1 insertion(+), 6 deletions(-) >> >>diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c >>index 6557c58d12..1f8a495ef8 100644 >>--- a/hw/virtio/vhost.c >>+++ b/hw/virtio/vhost.c >>@@ -1847,15 +1847,10 @@ static void vhost_stop_config_intr(struct vhost_dev >>*dev) >> >> static void vhost_start_config_intr(struct vhost_dev *dev) >> { >>- int r; >>- >> assert(dev->vhost_ops); >> int fd = event_notifier_get_fd(&dev->vdev->config_notifier); >> if (dev->vhost_ops->vhost_set_config_call) { >>- r = dev->vhost_ops->vhost_set_config_call(dev, fd); >>- if (!r) { >>- event_notifier_set(&dev->vdev->config_notifier); >>- } >>+ dev->vhost_ops->vhost_set_config_call(dev, fd); >> } >> } >> >>-- >>2.34.1 >>