Revision d8aeeb31

b/block.c
1704 1704

  
1705 1705
    bs_dict = qobject_to_qdict(obj);
1706 1706

  
1707
    monitor_printf(mon, "%s: type=%s removable=%d",
1707
    monitor_printf(mon, "%s: removable=%d",
1708 1708
                        qdict_get_str(bs_dict, "device"),
1709
                        qdict_get_str(bs_dict, "type"),
1710 1709
                        qdict_get_bool(bs_dict, "removable"));
1711 1710

  
1712 1711
    if (qdict_get_bool(bs_dict, "removable")) {
......
1747 1746

  
1748 1747
    QTAILQ_FOREACH(bs, &bdrv_states, list) {
1749 1748
        QObject *bs_obj;
1750
        const char *type = "unknown";
1751

  
1752
        switch(bs->type) {
1753
        case BDRV_TYPE_HD:
1754
            type = "hd";
1755
            break;
1756
        case BDRV_TYPE_CDROM:
1757
            type = "cdrom";
1758
            break;
1759
        case BDRV_TYPE_FLOPPY:
1760
            type = "floppy";
1761
            break;
1762
        }
1763 1749

  
1764
        bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': %s, "
1750
        bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': 'unknown', "
1765 1751
                                    "'removable': %i, 'locked': %i }",
1766
                                    bs->device_name, type, bs->removable,
1752
                                    bs->device_name, bs->removable,
1767 1753
                                    bs->locked);
1768 1754

  
1769 1755
        if (bs->drv) {
b/qmp-commands.hx
1039 1039

  
1040 1040
- "device": device name (json-string)
1041 1041
- "type": device type (json-string)
1042
         - Possible values: "hd", "cdrom", "floppy", "unknown"
1042
         - deprecated, retained for backward compatibility
1043
         - Possible values: "unknown"
1043 1044
- "removable": true if the device is removable, false otherwise (json-bool)
1044 1045
- "locked": true if the device is locked, false otherwise (json-bool)
1045 1046
- "inserted": only present if the device is inserted, it is a json-object
......
1070 1071
               "encrypted":false,
1071 1072
               "file":"disks/test.img"
1072 1073
            },
1073
            "type":"hd"
1074
            "type":"unknown"
1074 1075
         },
1075 1076
         {
1076 1077
            "device":"ide1-cd0",
1077 1078
            "locked":false,
1078 1079
            "removable":true,
1079
            "type":"cdrom"
1080
            "type":"unknown"
1080 1081
         },
1081 1082
         {
1082 1083
            "device":"floppy0",
1083 1084
            "locked":false,
1084 1085
            "removable":true,
1085
            "type": "floppy"
1086
            "type":"unknown"
1086 1087
         },
1087 1088
         {
1088 1089
            "device":"sd0",
1089 1090
            "locked":false,
1090 1091
            "removable":true,
1091
            "type":"floppy"
1092
            "type":"unknown"
1092 1093
         }
1093 1094
      ]
1094 1095
   }

Also available in: Unified diff