public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci-assign: Catch missing KVM support
@ 2010-11-07 13:08 Jan Kiszka
  2010-11-09 10:43 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-11-07 13:08 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm

From: Jan Kiszka <jan.kiszka@siemens.com>

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

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/device-assignment.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-09 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-07 13:08 [PATCH] pci-assign: Catch missing KVM support Jan Kiszka
2010-11-09 10:43 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox