diff mbox

pci-assign: Catch missing KVM support

Message ID 4CD6A4B1.9010401@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Nov. 7, 2010, 1:08 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index bde231d..5f5bde1 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1440,6 +1440,11 @@  static int assigned_initfn(struct PCIDevice *pci_dev)
     uint8_t e_device, e_intx;
     int r;
 
+    if (!kvm_enabled()) {
+        error_report("pci-assign: error: requires KVM support");
+        return -1;
+    }
+
     if (!dev->host.seg && !dev->host.bus && !dev->host.dev && !dev->host.func) {
         error_report("pci-assign: error: no host device specified");
         return -1;