OSDN Git Service

virtio-pci: Added check for virtio device in PCI config cbs.
authorAndrew Melnychenko <andrew@daynix.com>
Wed, 9 Jun 2021 09:58:42 +0000 (12:58 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 3 Jul 2021 05:39:33 +0000 (01:39 -0400)
commitbf697371db87cc1a2d04f5e8dda1b4b3e2be0f0d
tree98684eabe4cfef9f2469c0ffbc8aba4647a31e5e
parent80ebfd69b906186a12f0dc892a49188b4d672fdc
virtio-pci: Added check for virtio device in PCI config cbs.

Now, if virtio device is not present on virtio-bus - pci config callbacks
will not lead to possible crush. The read will return "-1" which should be
interpreted by a driver that pci device may be unplugged.

Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Message-Id: <20210609095843.141378-3-andrew@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-pci.c