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. > > For the hmp monitor an optional device parameter has been added to the > esisting screendump command. > > https://bugzilla.redhat.com/show_bug.cgi?id=903910 > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > --- > qapi-schema.json | 15 +++++++++++++++ > qmp-commands.hx | 25 +++++++++++++++++++++++++ > ui/console.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 92 insertions(+) > > 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'} } > > ## > +# @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 = opaque; > + DisplaySurface *surface; > + > + surface = 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. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature