[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH] virtio: re-order vm_running and use_started checks
|
From: |
Michael S. Tsirkin |
|
Subject: |
Re: [RFC PATCH] virtio: re-order vm_running and use_started checks |
|
Date: |
Thu, 3 Nov 2022 12:31:15 -0400 |
On Fri, Oct 14, 2022 at 02:21:08PM +0100, Alex Bennée wrote:
> During migration the virtio device state can be restored before we
> restart the VM. As no devices can be running while the VM is paused it
> makes sense to bail out early in that case.
>
> This returns the order introduced in:
>
> 9f6bcfd99f (hw/virtio: move vm_running check to virtio_device_started)
>
> to what virtio-sock was doing longhand.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Still checking but this seems to cause make check to fail on Fedora 36 under
ubsan.
> ---
> include/hw/virtio/virtio.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index f41b4a7e64..ebb58feaac 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -385,14 +385,14 @@ static inline bool virtio_is_big_endian(VirtIODevice
> *vdev)
>
> static inline bool virtio_device_started(VirtIODevice *vdev, uint8_t status)
> {
> - if (vdev->use_started) {
> - return vdev->started;
> - }
> -
> if (!vdev->vm_running) {
> return false;
> }
>
> + if (vdev->use_started) {
> + return vdev->started;
> + }
> +
> return status & VIRTIO_CONFIG_S_DRIVER_OK;
> }
>
> --
> 2.34.1
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks,
Michael S. Tsirkin <=
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Michael S. Tsirkin, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Christian Borntraeger, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Michael S. Tsirkin, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Michael S. Tsirkin, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Christian Borntraeger, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Christian Borntraeger, 2022/11/04
- Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Michael S. Tsirkin, 2022/11/04
Re: [RFC PATCH] virtio: re-order vm_running and use_started checks, Alex Bennée, 2022/11/04