Hide Forgot
Description of problem: Boot up a guest with spapr-vty device and install guest agent inside guest, then try to send some command to guest via guest agent, it does not work. There's even no "#qemu-ga -m spapr-vty" method inside guest when start the qemu-ga. Version-Release number of selected component (if applicable): kernel3.10.0-327.8.1.el7.ppc64le qemu-kvm-rhev-2.3.0-31.el7_2.7.ppc64le How reproducible: Always Steps to Reproduce: 1. Boot up a guest with spapr-vty device. /usr/libexec/qemu-kvm -name 'avocado-vt-vm1' -sandbox off -machine pseries -nodefaults -vga std -monitor stdio -device pci-ohci,id=usb1,bus=pci.0,addr=03 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=04,disable-legacy=off,disable-modern=on -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/root/test_home/qzhang/avocado-dir/usr/share/avocado/data/avocado-vt/images/RHEL-Server-7.2-ppc64le-virtio-scsi.qcow2 -device scsi-hd,id=image1,drive=drive_image1 -device virtio-net-pci,mac=9a:61:62:63:64:65,id=id344a0m,vectors=4,netdev=idvU0zLN,bus=pci.0,addr=05,disable-legacy=off,disable-modern=on -netdev tap,id=idvU0zLN,vhost=on -m 1024 -smp 4,maxcpus=4,cores=2,threads=1,sockets=2 -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :1 -rtc base=utc,clock=host -boot order=cdn,once=c,menu=off,strict=off -enable-kvm -chardev socket,id=serial,path=/tmp/serial,server,nowait -device spapr-vty,reg=0x30000000,chardev=serial -chardev socket,id=serial_id_org.qemu.guest_agent.0,path=/tmp/serial2,server,nowait -device spapr-vty,reg=0x40000000,chardev=serial_id_org.qemu.guest_agent.0 -device usb-kbd 2. Install qemu-guest-agent inside guest. 3. Inside guest: # qemu-ga -m spapr-vty -p /dev/ttyS1 1456827305.629045: critical: unsupported channel method/type: spapr-vty 1456827305.629056: critical: failed to initialize guest agent channel # qemu-ga --help Usage: qemu-ga [-m <method> -p <path>] [<options>] QEMU Guest Agent 2.3.0 -m, --method transport method: one of unix-listen, virtio-serial, or isa-serial (virtio-serial is the default) -p, --path device/socket path (the default for virtio-serial is: /dev/virtio-ports/org.qemu.guest_agent.0, the default for isa-serial is: /dev/ttyS0) ...... Actual results: No spapr-vty method when starting qemu-ga. Expected results: Guest agent should work with spapr-vty device. Additional info:
spapr-vty is not a serial device, although it works somewhat like one. So attempting to use /dev/ttyS1 for the qemu-ga certainly won't work. You will need /dev/hvc1 instead.
(In reply to David Gibson from comment #2) > spapr-vty is not a serial device, although it works somewhat like one. So > attempting to use /dev/ttyS1 for the qemu-ga certainly won't work. You will > need /dev/hvc1 instead. Yeah, thanks for the remind, /dev/hvc0-7 should be the device inside guest for spapr-vty. But there's still issue with spapr-vty: #qemu-ga -m First, there's no "spapr-vty" method currently. So I just tried "#qemu-ga -m isa-serial -p /dev/hvc1" (obviously this is not correct, just an experiment here) and "#qemu-ga -m unix-listen -p /dev/hvc1", neither of them works: (1) Inside guest: qemu-ga -m unix-listen -p /dev/hvc1 On host: # nc -U /tmp/serial2 {"execute":"guest-sync", "arguments":{"id":1234}} ======> No response (2) Inside guest: qemu-ga -m isa-serial -p /dev/hvc1 On host: # nc -U /tmp/serial2 {"execute":"guest-info"} {"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}} {"error": {"class": "GenericError", "desc": "JSON parse error, invalid keyword `nfo'"}}
So, spapr-vty is not a serial port but it should operate as a character channel just like a serial port. So using the same mode as for a virtserialport should the the right choice for qemu-ga.
(In reply to David Gibson from comment #4) > So, spapr-vty is not a serial port but it should operate as a character > channel just like a serial port. So using the same mode as for a > virtserialport should the the right choice for qemu-ga. Maybe the trial in comment 3 had some configuration issue or something else. Now the guest agent works for both "-m isa-seiral" and "-m virtio-serial". (1) In guest: # qemu-ga -m virtio-serial -p /dev/hvc1 On host: # nc -U /tmp/serial2 {"execute":"guest-sync", "arguments":{"id":1234}} {"execute":"guest-sync", "arguments":{"id":1234}} (==> this line is returned automatically, maybe a bug? ) {"return": 1234} (2) In guest: # qemu-ga -m isa-serial -p /dev/hvc1 On host: {"execute":"guest-sync", "arguments":{"id":1234}} {"return": 1234} Now the guest agent work, however "-m isa-serial" and "-m virtio-serial" obviously are not suitable although it's trivial issue, could we fix in qemu-guest-agent? Thanks, Qunfang
Hi, David Can something be fixed in guest agent according to comment 5?
So, I guess we could add spapr-vty as an alias to one of the other serial options in qemu-ga. It's pretty low priority, since AFAIK in every current use case we use virtio-serial for qemu-ga, instead of spapr-vty.
I've now looked at the guest agent code a bit more closely. Any machine with spapr-vty should also be capable of supporting virtio-serial, so I don't see that there's any real need for qemu-ga to support operating over spapr-vty, although it will work. So, there seems even less need to have an "spapr-vty" option.