From: Michael S. Tsirkin Date: Mon, 11 Jan 2010 15:57:41 +0000 (+0200) Subject: virtio-pci: thinko fix X-Git-Tag: v0.12.2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=348af56faea99631c4326ac389945799b6539295;p=thirdparty%2Fqemu.git virtio-pci: thinko fix Since patch ed757e140c0ada220f213036e4497315d24ca8bct, virtio will sometimes clear all status registers on bus master disable, which loses information such as VIRTIO_CONFIG_S_FAILED bit. This is a result of a patch being misapplied: code uses ! instead of ~ for bit operations as in Yan's original patch. This obviously does not make sense. Signed-off-by: Michael S. Tsirkin Signed-off-by: Anthony Liguori (cherry picked from commit 49e75cf38848e6da70c0e9ddb4d994e9d71a9625) --- diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 62b46bd4849..3594152267f 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -372,7 +372,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, if (PCI_COMMAND == address) { if (!(val & PCI_COMMAND_MASTER)) { - proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK; + proxy->vdev->status &= ~VIRTIO_CONFIG_S_DRIVER_OK; } }