aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-30 11:05:38 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-06-01 20:51:10 -0300
commit668007818b3e683068ad5055b5b79672b602559e (patch)
treeccc888e9c11fb2a16935034863d46cd903c995c7 /hw/device-assignment.c
parentMerge branch 'upstream-merge' (diff)
downloadqemu-kvm-668007818b3e683068ad5055b5b79672b602559e.tar.gz
qemu-kvm-668007818b3e683068ad5055b5b79672b602559e.tar.bz2
qemu-kvm-668007818b3e683068ad5055b5b79672b602559e.zip
pci-assign: Hide ioport regions on lacking sysfs support
As suggested by Alex: Instead of failing if the kernel does not allow us to speak to an ioport region, warn the user but, hide the region and continue. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/device-assignment.c')
-rw-r--r--hw/device-assignment.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 9ad5de56a..077d81e9a 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -430,10 +430,11 @@ static int assigned_dev_register_regions(PCIRegion *io_regions,
ret);
abort();
} else if (errno != EINVAL) {
- fprintf(stderr,
- "Kernel doesn't support ioport resource access.\n");
+ fprintf(stderr, "Kernel doesn't support ioport resource "
+ "access, hiding this region.\n");
close(pci_dev->v_addrs[i].region->resource_fd);
- return -1;
+ cur_region->valid = 0;
+ continue;
}
pci_dev->v_addrs[i].u.r_baseport = cur_region->base_addr;