Revision 637503d1 block.c
b/block.c | ||
---|---|---|
1444 | 1444 |
qlist_iter(qobject_to_qlist(data), bdrv_print_dict, mon); |
1445 | 1445 |
} |
1446 | 1446 |
|
1447 |
/** |
|
1448 |
* bdrv_info(): Block devices information |
|
1449 |
* |
|
1450 |
* Each block device information is stored in a QDict and the |
|
1451 |
* returned QObject is a QList of all devices. |
|
1452 |
* |
|
1453 |
* The QDict contains the following: |
|
1454 |
* |
|
1455 |
* - "device": device name |
|
1456 |
* - "type": device type |
|
1457 |
* - "removable": true if the device is removable, false otherwise |
|
1458 |
* - "locked": true if the device is locked, false otherwise |
|
1459 |
* - "inserted": only present if the device is inserted, it is a QDict |
|
1460 |
* containing the following: |
|
1461 |
* - "file": device file name |
|
1462 |
* - "ro": true if read-only, false otherwise |
|
1463 |
* - "drv": driver format name |
|
1464 |
* - "backing_file": backing file name if one is used |
|
1465 |
* - "encrypted": true if encrypted, false otherwise |
|
1466 |
* |
|
1467 |
* Example: |
|
1468 |
* |
|
1469 |
* [ { "device": "ide0-hd0", "type": "hd", "removable": false, "locked": false, |
|
1470 |
* "inserted": { "file": "/tmp/foobar", "ro": false, "drv": "qcow2" } }, |
|
1471 |
* { "device": "floppy0", "type": "floppy", "removable": true, |
|
1472 |
* "locked": false } ] |
|
1473 |
*/ |
|
1474 | 1447 |
void bdrv_info(Monitor *mon, QObject **ret_data) |
1475 | 1448 |
{ |
1476 | 1449 |
QList *bs_list; |
... | ... | |
1576 | 1549 |
return res; |
1577 | 1550 |
} |
1578 | 1551 |
|
1579 |
/** |
|
1580 |
* bdrv_info_stats(): show block device statistics |
|
1581 |
* |
|
1582 |
* Each device statistic information is stored in a QDict and |
|
1583 |
* the returned QObject is a QList of all devices. |
|
1584 |
* |
|
1585 |
* The QDict contains the following: |
|
1586 |
* |
|
1587 |
* - "device": device name |
|
1588 |
* - "stats": A QDict with the statistics information, it contains: |
|
1589 |
* - "rd_bytes": bytes read |
|
1590 |
* - "wr_bytes": bytes written |
|
1591 |
* - "rd_operations": read operations |
|
1592 |
* - "wr_operations": write operations |
|
1593 |
* - "wr_highest_offset": Highest offset of a sector written since the |
|
1594 |
* BlockDriverState has been opened |
|
1595 |
* - "parent": A QDict recursively holding the statistics of the underlying |
|
1596 |
* protocol (e.g. the host file for a qcow2 image). If there is no |
|
1597 |
* underlying protocol, this field is omitted. |
|
1598 |
* |
|
1599 |
* Example: |
|
1600 |
* |
|
1601 |
* [ { "device": "ide0-hd0", |
|
1602 |
* "stats": { "rd_bytes": 512, |
|
1603 |
* "wr_bytes": 0, |
|
1604 |
* "rd_operations": 1, |
|
1605 |
* "wr_operations": 0, |
|
1606 |
* "wr_highest_offset": 0 }, |
|
1607 |
* "parent": { |
|
1608 |
* "stats": { "rd_bytes": 1024, |
|
1609 |
* "wr_bytes": 0, |
|
1610 |
* "rd_operations": 2, |
|
1611 |
* "wr_operations": 0, |
|
1612 |
* "wr_highest_offset": 0, |
|
1613 |
* } } }, |
|
1614 |
* { "device": "ide1-cd0", |
|
1615 |
* "stats": { "rd_bytes": 0, |
|
1616 |
* "wr_bytes": 0, |
|
1617 |
* "rd_operations": 0, |
|
1618 |
* "wr_operations": 0, |
|
1619 |
* "wr_highest_offset": 0 } }, |
|
1620 |
*/ |
|
1621 | 1552 |
void bdrv_info_stats(Monitor *mon, QObject **ret_data) |
1622 | 1553 |
{ |
1623 | 1554 |
QObject *obj; |
Also available in: Unified diff