Trivial patches for August 4 to 12 2011
The following changes since commit 8cc7c3952d4d0a681d8d4c3ac89a206a5bfd7f00:
etrax-ser: printf -> qemu_log. (2011-08-11 12:02:30 +0200)
are available in the git repository at:
ssh://repo.or.cz/srv/git/qemu/stefanha.git trivial-patches
Paolo Bonzini (1):
fix QLIST usage for RAM list
Peter Maydell (1):
hw/qdev: Don't crash if qdev_create(NULL, ...) fails
Zhi Yong Wu (1):
scsi-bus: use DO_UPCAST
cpu-all.h | 2 +- exec.c | 2 +- hw/qdev.c | 7 ++++++- hw/scsi-bus.c | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/3 scsi-bus: use DO_UPCAST
From: Zhi Yong Wu <[email protected]>
--- hw/scsi-bus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/scsi-bus.c +1 -1
@@ -725,7 +725,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev)static char *scsibus_get_fw_dev_path (DeviceState *dev) { -SCSIDevice *d = (SCSIDevice *)dev; +SCSIDevice *d =DO_UPCAST (SCSIDevice, qdev, dev);SCSIBus *bus =scsi_bus_from_device (d);char path[100 ];int i;
Signature · 1 line
1.7.5.4
PATCH 2/3 hw/qdev: Don't crash if qdev_create(NULL, ...) fails
In reply to Stefan HajnocziFrom: Peter Maydell <[email protected]>
If an attempt to create a qdev device on the default sysbus (by passing NULL as the bus to qdev_create) fails, print a useful error message rather than crashing trying to dereference a NULL pointer.
--- hw/qdev.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
hw/qdev.c +6 -1
@@ -111,7 +111,12 @@ DeviceState *qdev_create(BusState *bus, const char *name) dev =qdev_try_create (bus, name);if (!dev) { -hw_error ("Unknown device '%s' for bus '%s'\n" , name, bus->info->name); +if (bus) { +hw_error ("Unknown device '%s' for bus '%s'\n" , name, + bus->info->name); + }else { +hw_error ("Unknown device '%s' for default sysbus\n" , name); + } }return dev;
Signature · 1 line
1.7.5.4
PATCH 3/3 fix QLIST usage for RAM list
In reply to Stefan HajnocziFrom: Paolo Bonzini <[email protected]>
Spotted while reviewing the migration thread patches.
--- cpu-all.h | 2 +- exec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
cpu-all.h +1 -1
@@ -488,7 +488,7 @@ typedef struct RAMBlock {typedef struct RAMList {uint8_t *phys_dirty; - QLIST_HEAD(ram, RAMBlock) blocks; + QLIST_HEAD(, RAMBlock) blocks; }RAMList ;extern RAMList ram_list;
exec.c +1 -1
@@ -110,7 +110,7 @@ static uint8_t *code_gen_ptr;int phys_ram_fd;static int in_migration; -RAMList ram_list = { .blocks =QLIST_HEAD_INITIALIZER (ram_list) }; +RAMList ram_list = { .blocks =QLIST_HEAD_INITIALIZER (ram_list.blocks) };static MemoryRegion *system_memory;static MemoryRegion *system_io;
Signature · 1 line
1.7.5.4