Re: [Qemu-devel] [PATCH] backends: Introduce chr-testdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/11/2014 01:44 AM, Andrew Jones wrote:
> From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> 
> From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> 
> chr-testdev enables a virtio serial channel to be used for guest
> initiated qemu exits. hw/misc/debugexit already enables guest
> initiated qemu exits, but only for PC targets. chr-testdev supports
> any virtio-capable target. kvm-unit-tests/arm is already making use
> of this backend.
> 
> Currently there is a single command implemented, "q".  It takes a
> (prefix) argument for the exit code, thus an exit is implemented by
> writing, e.g. "1q", to the virtio-serial port.
> 
> It can be used as:
>    $QEMU ... \
>      -device virtio-serial-device \
>      -device virtserialport,chardev=ctd -chardev testdev,id=ctd
> 
> or, use:
>    $QEMU ... \
>      -device virtio-serial-device \
>      -device virtconsole,chardev=ctd -chardev testdev,id=ctd
> 
> to bind it to virtio-serial port0.
> 

> +
> +    switch (c) {
> +    case 'q':
> +        exit((arg << 1) | 1);
> +        break;

I'm trying to figure out the motive for only exiting with odd numbers.
That is, 'q' => 1, '1q' => 3, '2q' => 5, '3q' => 7.  It means that at
most, I can do '127q' => 255 before I suffer from exit() limiting things
to 8 bits.  This wasn't explained in the commit message.

> +++ b/qapi-schema.json
> @@ -2764,6 +2764,7 @@
>                                         'mux'    : 'ChardevMux',
>                                         'msmouse': 'ChardevDummy',
>                                         'braille': 'ChardevDummy',
> +                                       'testdev': 'ChardevDummy',
>                                         'stdio'  : 'ChardevStdio',

It would be nice to have some sort of 'testdev since 2.2' documentation.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux