From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5cm6-0000bR-CO for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5cm0-0003cS-Fk for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:30:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5cm0-0003bD-7o for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:30:08 -0400 Message-ID: <53C002FB.3000805@redhat.com> Date: Fri, 11 Jul 2014 09:30:03 -0600 From: Eric Blake MIME-Version: 1.0 References: <1405064666-5359-1-git-send-email-drjones@redhat.com> In-Reply-To: <1405064666-5359-1-git-send-email-drjones@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nO3nOMF77c73SGkkR9mvOVDCWCJeIeEJS" Subject: Re: [Qemu-devel] [PATCH] backends: Introduce chr-testdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Jones , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nO3nOMF77c73SGkkR9mvOVDCWCJeIeEJS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/11/2014 01:44 AM, Andrew Jones wrote: > From: Paolo Bonzini >=20 > From: Paolo Bonzini >=20 > 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. >=20 > 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. >=20 > It can be used as: > $QEMU ... \ > -device virtio-serial-device \ > -device virtserialport,chardev=3Dctd -chardev testdev,id=3Dctd >=20 > or, use: > $QEMU ... \ > -device virtio-serial-device \ > -device virtconsole,chardev=3Dctd -chardev testdev,id=3Dctd >=20 > to bind it to virtio-serial port0. >=20 > + > + 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' =3D> 1, '1q' =3D> 3, '2q' =3D> 5, '3q' =3D> 7. It means tha= t at most, I can do '127q' =3D> 255 before I suffer from exit() limiting thing= s 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nO3nOMF77c73SGkkR9mvOVDCWCJeIeEJS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTwAL7AAoJEKeha0olJ0Nqj5sH/jMrxWk/QMuLurd+oWTh7s6P u9qlkSqwsrSfH7ruRhtzeUdPzcXCo/UIp5RFRMVLMjaVQWTDSLL1oKjd0p8iiroV 0n1d4SEKIn4EWX2bjWM5QZzuJwqD0ng3DrWqq+6hkYp/G8r+9YqeBIutifJRr87n 74s4cQnluR76X3LS+O5q1u1hJOxMg0MAmr2z0PrxO9mQLMsM2qqn673mQLhHNlSr 7QvROd5Q2dDRuh3RACg8FI80ESzLqOwHQe5jBULjPaUuVP/xELJqSjudTXU+SmJ3 h32BartFfPj/oyY2MTnNtCjvTSJOHsxiNd7sYUMZNSwbaz8aFNCwNSHp+11LUAg= =a/ez -----END PGP SIGNATURE----- --nO3nOMF77c73SGkkR9mvOVDCWCJeIeEJS--