qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes


From: Greg Kurz
Subject: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled
Date: Thu, 12 May 2016 11:45:58 +0200
User-agent: StGit/0.17.1-dirty

Without presuming if we got there because of a user mistake or some
more subtile bug in the tooling, it doesn't hurt to log somewhere that
the device won't be functional.

Signed-off-by: Greg Kurz <address@hidden>
---
 hw/virtio/virtio-pci.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 0f634d2d776e..a74978cb5e83 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1639,6 +1639,10 @@ static void virtio_pci_device_plugged(DeviceState *d, 
Error **errp)
     uint32_t size;
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
 
+    if (!legacy && !modern) {
+        error_report("Warning: device is unserviceable when both legacy and 
modern modes are disabled. At least one of the disable-modern or disable-legacy 
properties should be set to false.");
+    }
+
     config = proxy->pci_dev.config;
     if (proxy->class_code) {
         pci_config_set_class(config, proxy->class_code);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]