bs_dict = qobject_to_qdict(obj);
- monitor_printf(mon, "%s: type=%s removable=%d",
+ monitor_printf(mon, "%s: removable=%d",
qdict_get_str(bs_dict, "device"),
- qdict_get_str(bs_dict, "type"),
qdict_get_bool(bs_dict, "removable"));
if (qdict_get_bool(bs_dict, "removable")) {
QTAILQ_FOREACH(bs, &bdrv_states, list) {
QObject *bs_obj;
- const char *type = "unknown";
-
- switch(bs->type) {
- case BDRV_TYPE_HD:
- type = "hd";
- break;
- case BDRV_TYPE_CDROM:
- type = "cdrom";
- break;
- case BDRV_TYPE_FLOPPY:
- type = "floppy";
- break;
- }
- bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': %s, "
+ bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': 'unknown', "
"'removable': %i, 'locked': %i }",
- bs->device_name, type, bs->removable,
+ bs->device_name, bs->removable,
bs->locked);
if (bs->drv) {
- "device": device name (json-string)
- "type": device type (json-string)
- - Possible values: "hd", "cdrom", "floppy", "unknown"
+ - deprecated, retained for backward compatibility
+ - Possible values: "unknown"
- "removable": true if the device is removable, false otherwise (json-bool)
- "locked": true if the device is locked, false otherwise (json-bool)
- "inserted": only present if the device is inserted, it is a json-object
"encrypted":false,
"file":"disks/test.img"
},
- "type":"hd"
+ "type":"unknown"
},
{
"device":"ide1-cd0",
"locked":false,
"removable":true,
- "type":"cdrom"
+ "type":"unknown"
},
{
"device":"floppy0",
"locked":false,
"removable":true,
- "type": "floppy"
+ "type":"unknown"
},
{
"device":"sd0",
"locked":false,
"removable":true,
- "type":"floppy"
+ "type":"unknown"
}
]
}