qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Sam <batmanustc@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] How to use monitor socket in python to connect VM?
Date: Mon, 4 Sep 2017 13:59:40 +0100	[thread overview]
Message-ID: <20170904125940.GA27285@redhat.com> (raw)
In-Reply-To: <CAOE=1Z2E-OJKFGp1QWwTbBm0evbtLDubv7JVS5hC8dPqK_9M-Q@mail.gmail.com>

On Mon, Sep 04, 2017 at 08:31:29PM +0800, Sam wrote:
> Thank you, but I have to ask last question. My qemu is 2.6.0, and there is
> no -qmp option :

QEMU 2.6.0 supports it, but whatever person/application has run
the QEMU process shown here has not used the -qmp arg. You'll
need to get that changed somehow.

> 
> [root@yf-mos-test-net09 ~]# ps aux | grep qemu
> > root      5714  0.0  0.0 1669388 77736 ?       Sl   Sep01   0:09
> > /usr/local/bin/qemu-system-x86_64_2.6.0 -enable-kvm -cpu
> > qemu64,+vmx,+ssse3,+sse4.1,+sse4.2,+x2apic,+aes,+avx,+vme,+pat,+ss,+pclmulqdq,+xsave,level=13
> > -machine pc,accel=kvm -chardev
> > socket,id=hmqmondev,port=55919,host=127.0.0.1,nodelay,server,nowait -mon
> > chardev=hmqmondev,id=hmqmon,mode=readline -rtc
> > base=utc,clock=host,driftfix=none -usb -device usb-tablet -daemonize
> > -nodefaults -nodefconfig -no-kvm-pit-reinjection -global
> > kvm-pit.lost_tick_policy=discard -vga std -k en-us -smp 1 -name
> > mvs5-huanghuai -m 1024 -boot order=cdn -vnc :19,password -drive
> > file=/opt/cloud/workspace/disks/4a5148da-e34e-4c81-aada-12a247c0337e,if=none,id=drive_0,format=qcow2,cache=none,aio=native
> > -device virtio-blk-pci,id=dev_drive_0,drive=drive_0,bus=pci.0,addr=0x5
> > -drive
> > file=/opt/cloud/workspace/disks/08eb3f72-07ba-44e9-8ee9-4ab662dbbd1f,if=none,id=drive_1,format=qcow2,cache=none,aio=native
> > -device virtio-blk-pci,id=dev_drive_1,drive=drive_1,bus=pci.0,addr=0x6
> > -device ide-cd,drive=ide0-cd0,bus=ide.1,unit=1 -drive
> > id=ide0-cd0,media=cdrom,if=none -chardev
> > socket,id=char-n-f879ac2f,path=/usr/local/var/run/openvswitch/n-f879ac2f,server
> > -netdev type=vhost-user,id=n-f879ac2f,chardev=char-n-f879ac2f,vhostforce=on
> > -device
> > virtio-net-pci,netdev=n-f879ac2f,mac=00:22:f8:79:ac:2f,id=netdev-n-f879ac2f,addr=0xf
> > -object
> > memory-backend-file,id=mem,size=1024M,mem-path=/dev/hugepages,share=on
> > -numa node,memdev=mem -mem-prealloc -pidfile
> > /opt/cloud/workspace/servers/63ef2ec4-556f-47ea-93e0-23089bb59be5/pid
> > -chardev
> > socket,path=/opt/cloud/workspace/servers/63ef2ec4-556f-47ea-93e0-23089bb59be5/qga.sock,server,nowait,id=qga0
> > -device virtio-serial -device
> > virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 -incoming tcp:0:8081
> 
> 
>  After I use telnet like this `telnet localhost 55919`, then enter this cmd
> line:
> 
> [root@yf-mos-test-net09 ~]# telnet localhost 55919
> > Trying ::1...
> > telnet: connect to address ::1: Connection refused
> > Trying 127.0.0.1...
> > Connected to localhost.
> > Escape character is '^]'.
> > QEMU 2.6.0 monitor - type 'help' for more information
> > (qemu) help
> > help
> > acl_add aclname match allow|deny [index] -- add a match rule to the access
> > control list
> > ...
> > xp /fmt addr -- physical memory dump starting at 'addr'
> > (qemu)
> > (qemu)
> 
> (qemu) {"execute":"query-status"}
> > {"execute":"query-status"}
> > unknown command: '{"execute":"query-status"}'

This won't work - you're trying to send QMP commands to the HMP - they
speak completely different protocols.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

      parent reply	other threads:[~2017-09-04 13:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04  6:17 [Qemu-devel] How to use monitor socket in python to connect VM? Sam
2017-09-04  9:36 ` Daniel P. Berrange
2017-09-04 10:11   ` Sam
2017-09-04 10:16     ` Daniel P. Berrange
2017-09-04 12:31       ` Sam
2017-09-04 12:32         ` Sam
2017-09-04 13:00           ` Daniel P. Berrange
2017-09-04 12:59         ` Daniel P. Berrange [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170904125940.GA27285@redhat.com \
    --to=berrange@redhat.com \
    --cc=batmanustc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).