[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] Allow to specify a display device ID and hea
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v2] Allow to specify a display device ID and head whith the screendump command |
Date: |
Mon, 5 Mar 2018 11:53:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 05.03.2018 11:09, Gerd Hoffmann wrote:
>> -void qmp_screendump(const char *filename, Error **errp)
>> +void qmp_screendump(const char *filename, bool has_device, const char
>> *device,
>> + bool has_head, int64_t head, Error **errp)
>> {
>> QemuConsole *con = qemu_console_lookup_by_index(0);
>
> This initialization can be dropped ...
D'oh, copy-n-paste error ... I'll send a v3 ...
Thomas
>> DisplaySurface *surface;
>>
>> - if (con == NULL) {
>> - error_setg(errp, "There is no QemuConsole I can screendump from.");
>> - return;
>> + if (has_device) {
>> + con = qemu_console_lookup_by_device_name(device, has_head ? head :
>> 0,
>> + errp);
>> + if (!con) {
>> + return;
>> + }
>> + } else {
>> + if (has_head) {
>> + error_setg(errp, "'head' must be specified together with
>> 'device'");
>> + return;
>> + }
>> + con = qemu_console_lookup_by_index(0);
>
> ... because it is called here now.
>
> Otherwise looks fine now.
>
> cheers,
> Gerd
>