Bug 1161184

Summary: RFE: support input-send-event command in libvirt/virsh
Product: [Community] Virtualization Tools Reporter: Amos Kong <akong>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Fangge Jin <fjin>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ailan, armbru, crobinso, dyuan, hhuang, huding, juzhang, lcapitulino, lhuang, libvirt-maint, michen, mrezanin, mzhan, rbalakri, virt-bugs, virt-maint, xfu, xuzhang, yvugenfi
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1145028 Environment:
Last Closed: 2017-01-24 18:46:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1145028    
Bug Blocks:    

Comment 2 Martin Kletzander 2014-11-10 14:07:00 UTC
Hi Amos, I have got three question to make sure we'll do this correctly.

1) How do you number the consoles, i.e. how should I know what number should I use for the 'console' parameter?  And is it mandatory?  I presume we will always want to use '0' as that should represent the default (first) display, am I right?

2) What is the difference between:

{ "execute": "send-key", "arguments": { "keys": [{"type": "qcode", "data": "ctrl_r"} ] } }

and:

{ "execute": "input-send-event", "arguments": { "console": 0, "events": [ { "type": "key", "data" : { "down": true, "key": {"type": "qcode", "data": "ctrl_r" } } }, { "type": "key", "data" : { "down": false, "key": {"type": "qcode", "data": "ctrl_r" } } } ] } }

or do they have the same functionality?  I guess they do, I just want to be sure.

Thank you in advance for the answers.

Comment 3 Amos Kong 2014-11-10 14:57:43 UTC
(In reply to Martin Kletzander from comment #2)
> Hi Amos, I have got three question to make sure we'll do this correctly.
> 
> 1) How do you number the consoles, i.e. how should I know what number should
> I use for the 'console' parameter?  And is it mandatory?  I presume we will
> always want to use '0' as that should represent the default (first) display,
> am I right?

I posted a patch to make the 'console' parameter optional, so the default parameter should be none, then QEMU will use the first available console.
http://lists.nongnu.org/archive/html/qemu-devel/2014-11/msg01188.html
 
> 2) What is the difference between:
> 
> { "execute": "send-key", "arguments": { "keys": [{"type": "qcode", "data":
> "ctrl_r"} ] } }
> 
> and:
> 
> { "execute": "input-send-event", "arguments": { "console": 0, "events": [ {
> "type": "key", "data" : { "down": true, "key": {"type": "qcode", "data":
> "ctrl_r" } } }, { "type": "key", "data" : { "down": false, "key": {"type":
> "qcode", "data": "ctrl_r" } } } ] } }
> 
> or do they have the same functionality?  I guess they do, I just want to be
> sure.

Yes. But we can split second command to two commands, even send other key events by input-send-event between two commands, it's more flexible.

> Thank you in advance for the answers.

Thank you.

Comment 10 Martin Kletzander 2017-01-24 15:01:40 UTC
The original need for input-send-event was fixed by other means, so this is just nice to have. Moving to upstream.

Comment 11 Cole Robinson 2017-01-24 18:46:05 UTC

*** This bug has been marked as a duplicate of bug 636163 ***