qdev: two little fixes.
cover qdev: two little fixes.
Hi,
This just brings two little bugfixes as incremental patches for the qdev patch series posted last friday, found them while coding / testing more qdev stuff.
If prefered I can also fold them in and repost the whole series.
cheers,
Gerd
PATCH 1/2 qdev: catch unknown devices in -device
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/qdev.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
hw/qdev.c +5 -0
@@ -133,6 +133,11 @@ DeviceState *qdev_device_add(const char *cmdline) } info =qdev_find_info (NULL , driver); +if (!info) { +fprintf (stderr,"Device \"%s\" not found. Try -device '?' for a list.\n" , + driver); +return NULL ; + }if (!info->bus_info->add) {fprintf (stderr,"bus \"%s\" can't add devices.\n" , info->bus_info->name);
Signature · 1 line
1.6.2.5
PATCH 2/2 qdev: fix nic/id windup.
In reply to Gerd HoffmannSigned-off-by Gerd Hoffmann <[email protected]>
--- hw/pci.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
hw/pci.c +2 -1
@@ -821,7 +821,8 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,for (i =0 ; pci_nic_models[i]; i++) {if (strcmp (nd->model, pci_nic_models[i]) ==0 ) { dev =pci_create (pci_nic_names[i], devaddr); -snprintf (dev->id,sizeof (dev->id),"%s" , nd->id); +if (nd->id) +snprintf (dev->id,sizeof (dev->id),"%s" , nd->id); dev->nd = nd;qdev_init (dev); nd->private = dev;
Signature · 1 line
1.6.2.5