qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qom: Crash more nicely on object_property_get_link() failure

Pass &error_abort instead of NULL where the returned value is
dereferenced or asserted to be non-null. Drop a now redundant
assertion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-24-armbru@redhat.com>

+10 -7
+3 -3
hw/core/platform-bus.c
··· 22 22 #include "qemu/osdep.h" 23 23 #include "hw/platform-bus.h" 24 24 #include "hw/qdev-properties.h" 25 + #include "qapi/error.h" 25 26 #include "qemu/error-report.h" 26 27 #include "qemu/module.h" 27 28 ··· 63 64 return -1; 64 65 } 65 66 66 - parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL); 67 - 68 - assert(parent_mr); 67 + parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", 68 + &error_abort); 69 69 if (parent_mr != pbus_mr_obj) { 70 70 /* MMIO region is not mapped on platform bus */ 71 71 return -1;
+2 -1
hw/ppc/spapr_drc.c
··· 870 870 continue; 871 871 } 872 872 873 - obj = object_property_get_link(root_container, prop->name, NULL); 873 + obj = object_property_get_link(root_container, prop->name, 874 + &error_abort); 874 875 drc = SPAPR_DR_CONNECTOR(obj); 875 876 drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); 876 877
+2 -1
hw/ppc/spapr_hcall.c
··· 1655 1655 continue; 1656 1656 } 1657 1657 drc = SPAPR_DR_CONNECTOR(object_property_get_link(drc_container, 1658 - prop->name, NULL)); 1658 + prop->name, 1659 + &error_abort)); 1659 1660 1660 1661 if (spapr_drc_transient(drc)) { 1661 1662 spapr_drc_reset(drc);
+2 -1
hw/ppc/spapr_pci_nvlink2.c
··· 358 358 for (i = 0; i < sphb->nvgpus->num; ++i) { 359 359 SpaprPhbPciNvGpuSlot *nvslot = &sphb->nvgpus->slots[i]; 360 360 Object *nv_mrobj = object_property_get_link(OBJECT(nvslot->gpdev), 361 - "nvlink2-mr[0]", NULL); 361 + "nvlink2-mr[0]", 362 + &error_abort); 362 363 uint32_t associativity[] = { 363 364 cpu_to_be32(0x4), 364 365 SPAPR_GPU_NUMA_ID,
+1 -1
ui/vnc.c
··· 568 568 &info->vencrypt, &info->has_vencrypt); 569 569 if (vd->dcl.con) { 570 570 dev = DEVICE(object_property_get_link(OBJECT(vd->dcl.con), 571 - "device", NULL)); 571 + "device", &error_abort)); 572 572 info->has_display = true; 573 573 info->display = g_strdup(dev->id); 574 574 }