From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxgnW-0005vb-Ce for qemu-devel@nongnu.org; Fri, 12 Jul 2013 13:06:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxgnV-0002SL-8I for qemu-devel@nongnu.org; Fri, 12 Jul 2013 13:06:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxgnV-0002S4-0B for qemu-devel@nongnu.org; Fri, 12 Jul 2013 13:06:21 -0400 Message-ID: <51E0378A.7040502@redhat.com> Date: Fri, 12 Jul 2013 11:06:18 -0600 From: Eric Blake MIME-Version: 1.0 References: <1371477707-7039-1-git-send-email-kraxel@redhat.com> <1371477707-7039-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1371477707-7039-3-git-send-email-kraxel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2FNKENJNGARQKTQORGGMN" Subject: Re: [Qemu-devel] [RfC PATCH 2/2] console: add screendump-device qmp cmd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "Markus Armbruster (supporter:QAPI Schema)" , "Anthony Liguori (maintainer:Graphics)" , alevy@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2FNKENJNGARQKTQORGGMN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/17/2013 08:01 AM, Gerd Hoffmann wrote: > Adds a screendump-device qmp command, which has an additional 'device' > parameter. This way it is possible to specify the device you want a > screendump from. >=20 > For the hmp monitor an optional device parameter has been added to the > esisting screendump command. >=20 > https://bugzilla.redhat.com/show_bug.cgi?id=3D903910 >=20 > Signed-off-by: Gerd Hoffmann > --- > qapi-schema.json | 15 +++++++++++++++ > qmp-commands.hx | 25 +++++++++++++++++++++++++ > ui/console.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++ > 3 files changed, 92 insertions(+) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index adcf801..719dc6e 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3125,6 +3125,21 @@ > { 'command': 'screendump', 'data': {'filename': 'str'} } > =20 > ## > +# @screendump-device: > +# > +# Write a PPM from the specified device to a file. > +# > +# @filename: the path of a new PPM file to store the image > +# @device: #optional device to take the screenshot from > +# > +# Returns: Nothing on success > +# > +# Since: 1.6 > +## > +{ 'command': 'screendump-device', 'data': {'filename': 'str', > + '*device' : 'str' }} Does this command need to return a job id, and does there need to be an event when it is completed? Can filename include /dev/fdset (that is, the file is opened via qemu_open, so we can use fd passing to pass in a pipe fd rather than requiring a trip through the filesystem)? > + > +static void qmp_screendump_bh(void *opaque) > +{ > + Error *local_err; > + struct screendump_job *j =3D opaque; > + DisplaySurface *surface; > + > + surface =3D qemu_console_surface(j->con); > + ppm_save(j->filename, surface, &local_err); Yes, ppm_save uses qemu_open(), so fd passing should be possible. > + /* TODO: send qmp completion (or error) event */ Aha, this explains why it is still rfc. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2FNKENJNGARQKTQORGGMN 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.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR4DeKAAoJEKeha0olJ0NqKMcH/A1eCQ8hyMNSOhY6MW6o48KX HS3tFHRrw3/bekgYorqiwD8DzKCTH+fHbaAtfP/qNOzYnRjvVu/h9phhyqVCM7ye mq7ZTtHS9kmfi/AjlFwEppp5tnZyYwb1qpAxpBbUrpqWN45t8J2cXaSC4ctXfI5G xYmvbrf3XvulTYd1y3l5DvG2SruSTSUescZgcjacvYRRe83GoJstIlXzysBpqSvb lOeW3PSnkSfL0xL/+Zn+M6YMH52MEI4Lio9d0rEOxdauCSriWgI3RJhPmAlRfNLG A6f8JNbPEZtBgZQ5GAU5X1yo+lXFfnEwSiAVmGkutL52K+VSiu50EIVb53j7G6U= =93JD -----END PGP SIGNATURE----- ------enig2FNKENJNGARQKTQORGGMN--