Skip to content

Instantly share code, notes, and snippets.

@muxueqz
Created February 26, 2013 05:43
Show Gist options
  • Save muxueqz/5036181 to your computer and use it in GitHub Desktop.
Save muxueqz/5036181 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import qmp_shell
import sys
sock,file_name = sys.argv[1:]
print file_name
q = qmp_shell.QMPShell(sock)
q.connect()
cmd = 'blockdev-snapshot-sync device=ide0-hd0 snapshot-file=%s' % file_name
q._execute_cmd(cmd)
q.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment