diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-09-22 13:53:20 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-05 09:32:50 -0500 |
commit | 41b5e892b7dbf553b356b51004a6966233e71a6d (patch) | |
tree | 36bc8b7606bfb90dcea60f6d4675d799a67e0b4f /hw/qdev-properties.c | |
parent | 99244fa151f03bb504892ba729ab2553dc359424 (diff) |
qdev: don't crash on unset drive properties.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r-- | hw/qdev-properties.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index c4fb15c020..5c627fae40 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -208,7 +208,7 @@ static int parse_drive(DeviceState *dev, Property *prop, const char *str) static int print_drive(DeviceState *dev, Property *prop, char *dest, size_t len) { DriveInfo **ptr = qdev_get_prop_ptr(dev, prop); - return snprintf(dest, len, "%s", (*ptr)->id); + return snprintf(dest, len, "%s", (*ptr) ? (*ptr)->id : "<null>"); } PropertyInfo qdev_prop_drive = { |