Commit 41b5e892 authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Anthony Liguori
Browse files

qdev: don't crash on unset drive properties.

parent 99244fa1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 = {