Skip to contentSkip to conversation

pci-assign: Catch missing KVM support

PATCH Applied Jan Kiszka 2 participants 2 messages Nov 7, 2010 – Nov 9, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 pci-assign: Catch missing KVM support

From: Jan Kiszka <[email protected]>

Report an error instead of raising a SEGV when a pci-assign device is about to be initialized without KVM enabled.

---
 hw/device-assignment.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
hw/device-assignment.c +5 -0
index bde231d..5f5bde1 100644
@@ -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;
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Report an error instead of raising a SEGV when a pci-assign device is about to be initialized without KVM enabled.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function