aboutsummaryrefslogtreecommitdiff
path: root/include/hw/misc/unimp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/misc/unimp.h')
-rw-r--r--include/hw/misc/unimp.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h
index 44d87be903..e71ec17e13 100644
--- a/include/hw/misc/unimp.h
+++ b/include/hw/misc/unimp.h
@@ -10,6 +10,7 @@
#include "hw/qdev-properties.h"
#include "hw/sysbus.h"
+#include "qapi/error.h"
#define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
@@ -40,11 +41,11 @@ static inline void create_unimplemented_device(const char *name,
hwaddr base,
hwaddr size)
{
- DeviceState *dev = qdev_create(NULL, TYPE_UNIMPLEMENTED_DEVICE);
+ DeviceState *dev = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
qdev_prop_set_string(dev, "name", name);
qdev_prop_set_uint64(dev, "size", size);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, base, -1000);
}