diff options
author | Michael S. Tsirkin | 2011-05-05 15:39:47 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2011-05-05 15:39:47 +0200 |
commit | 5300f1a5487f67f0bde8ee1081b799108668cb1d (patch) | |
tree | 5274ff496f2665487736a4eec23bf76601e4da44 /hw/empty_slot.c | |
parent | CPUPhysMemoryClient: Pass guest physical address not region offset (diff) | |
parent | NBD: Avoid leaking a couple of strings when the NBD device is closed (diff) | |
download | qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.gz qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.xz qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.zip |
Merge remote branch 'origin/master' into pci
Conflicts:
exec.c
Diffstat (limited to 'hw/empty_slot.c')
-rw-r--r-- | hw/empty_slot.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/hw/empty_slot.c b/hw/empty_slot.c index 664b8d9c4d..da8adc4d03 100644 --- a/hw/empty_slot.c +++ b/hw/empty_slot.c @@ -53,18 +53,21 @@ static CPUWriteMemoryFunc * const empty_slot_write[3] = { void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size) { - DeviceState *dev; - SysBusDevice *s; - EmptySlot *e; + if (slot_size > 0) { + /* Only empty slots larger than 0 byte need handling. */ + DeviceState *dev; + SysBusDevice *s; + EmptySlot *e; - dev = qdev_create(NULL, "empty_slot"); - s = sysbus_from_qdev(dev); - e = FROM_SYSBUS(EmptySlot, s); - e->size = slot_size; + dev = qdev_create(NULL, "empty_slot"); + s = sysbus_from_qdev(dev); + e = FROM_SYSBUS(EmptySlot, s); + e->size = slot_size; - qdev_init_nofail(dev); + qdev_init_nofail(dev); - sysbus_mmio_map(s, 0, addr); + sysbus_mmio_map(s, 0, addr); + } } static int empty_slot_init1(SysBusDevice *dev) |