]> git.ipfire.org Git - thirdparty/qemu.git/commit
include/hw: VM state takes precedence in virtio_device_should_start
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 30 Nov 2022 11:24:39 +0000 (11:24 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Dec 2022 07:30:18 +0000 (02:30 -0500)
commit4987e5bf2e9262094fd89d2b8e4d5bd6c4c7312f
tree107c367ba4eaf10664823f369872e553472557e8
parent71e076a07dc195129fe25d90d4b276be3b2f12d8
include/hw: VM state takes precedence in virtio_device_should_start

The VM status should always preempt the device status for these
checks. This ensures the device is in the correct state when we
suspend the VM prior to migrations. This restores the checks to the
order they where in before the refactoring moved things around.

While we are at it lets improve our documentation of the various
fields involved and document the two functions.

Fixes: 9f6bcfd99f (hw/virtio: move vm_running check to virtio_device_started)
Fixes: 259d69c00b (hw/virtio: introduce virtio_device_should_start)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20221130112439.2527228-6-alex.bennee@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/hw/virtio/virtio.h