File:  [Qemu by Fabrice Bellard] / qemu / QMP / vm-info
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:31:30 2018 UTC (8 years, 2 months ago) by root
Branches: qemu, MAIN
CVS tags: qemu0130, HEAD
qemu 0.13.0

#!/usr/bin/python
#
# Print Virtual Machine information
#
# Usage:
#
# Start QEMU with:
#
# $ qemu [...] -monitor control,unix:./qmp,server
#
# Run vm-info:
#
# $ vm-info ./qmp
#
# Luiz Capitulino <[email protected]>

import qmp
from sys import argv,exit

def main():
    if len(argv) != 2:
        print 'vm-info <unix-socket>'
        exit(1)

    qemu = qmp.QEMUMonitorProtocol(argv[1])
    qemu.connect()
    qemu.send("qmp_capabilities")

    for cmd in [ 'version', 'kvm', 'status', 'uuid', 'balloon' ]:
        print cmd + ': ' + str(qemu.send('query-' + cmd))

if __name__ == '__main__':
    main()

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.