Socket
Socket
Sign inDemoInstall

qemu-qmp

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    qemu-qmp

Node.js library for connecting to QEMU Machine Protocol (QMP)


Version published
Maintainers
1
Install size
28.7 kB
Created

Readme

Source

node-qemu-qmp

Node.js library for connecting to QEMU Machine Protocol (QMP)

Example

var QMP = require('qemu-qmp');

var qmp = new QMP();
qmp.connect('/tmp/qmp-sock', function(err) {
  if (err) throw err;
  console.info('QEMU version %d.%d.%d', qmp.version.qemu.major, qmp.version.qemu.minor, qmp.version.qemu.micro);

  qmp.execute('query-status', function(err, status) {
    if (err) throw err;
    console.info('Current VM status: %s', status.status);

    if (!status.running)
      this.end();

    console.info('Waiting for VM shutdown...');

    this.on('shutdown', function() {
      this.end();
    });
  });
});

Commands

The execute() method is used to execute QEMU QMP commands. For a list of commands see https://raw.githubusercontent.com/qemu/qemu/master/qmp-commands.hx

To get a list of commands supported by your version of QEMU, use the "query-commands" command:

qmp.execute('query-commands', function(err, commands) {
  if (err) throw err;
  console.log(commands);
});

Events

The library emits all the standard net.Socket events, as well as all the QEMU QMP events. For a list of QEMU QMP events, see https://raw.githubusercontent.com/qemu/qemu/master/docs/qmp/qmp-events.txt

FAQs

Last updated on 08 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc