From: Zhang Xiaohe <zhangxh@cn.fujitsu.com>
To: Eric Blake <eblake@redhat.com>
Cc: qiaonuohan <qiaonuohan@cn.fujitsu.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 9/9] Make monitor command 'dump-guest-memory' dump in kdump-compressed format
Date: Fri, 10 May 2013 09:21:42 +0800 [thread overview]
Message-ID: <518C4BA6.7020302@cn.fujitsu.com> (raw)
In-Reply-To: <518BB7D7.5050002@redhat.com>
于 2013年05月09日 22:51, Eric Blake 写道:
> On 05/08/2013 11:27 PM, Zhang Xiaohe wrote:
>> 于 2013年05月09日 01:16, Eric Blake 写道:
>>> On 05/08/2013 02:50 AM, qiaonuohan wrote:
>>>>
>>>> Thanks for your suggestion. I will fix it like:
>>>>
>>>> { 'enum': 'DumpCompressionFormat',
>>>> 'data': [ 'zlib', 'lzo', 'snappy' ] }
>>>>
>>>> For zlib is treated as the default compression format, and
>>>> 'uncompressed' won't be an option.
>>>
>>> No, I was serious that you need to provide 'uncompressed' as an explicit
>>> enum value. It is very annoying to toggle between four states (three
>>> compression formats and a fourth state of no compression) when the
>>> fourth is available only by omitting a parameter. The default MUST be
>>> 'uncompressed' for backwards-compatibility, not 'zlib'.
>>>
>> We'd like to make sure that we understand you precisely.
>>
>> The definion is like below:
>> { 'enum': 'DumpGuestMemoryFormat',
>> 'data': [ 'uncompressed', 'zlib', 'lzo', 'snappy' ] }
>>
>> { 'command': 'dump-guest-memory',
>> 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
>> '*length': 'int', '*format': 'DumpCompressionFormat' } }
>
> Closer - make sure you use the same type name in both places (the enum
> name 'DumpGuestMemoryFormat' is slightly nicer than the command use of
> 'DumpCompressionFormat'.
>
>>
>> 'format' is optional:
>> 1. when 'format' is not specified, vmcore will be in ELF format.
>> 2. when 'format' is specified and its parameter is 'uncompressed',
>> vmcore will be in ELF format as well.
>> 3. when 'format' is specified and its parameter is 'zlib/lzo/snappy',
>> vmcore will be in kdump-compressed format.
>
> Correct. Or you could use the name 'elf' instead of 'uncompressed', if
> that makes more sense - as long as the enum calls out the names you are
> supporting.
>
>>
>> If this is what you suggest, then I don't think it is necessary to
>> add 'uncompressed'. The backwards-compatibility is assured by case 1,
>> in which the interface is exactly the same as before. So why do we
>> add another parameter to do the same thing again?
>
> Because it is nicer to apps to allow them to explicitly specify the
> default. Making 'format' optional allows older apps to still work, but
> for newer apps, it is easier to ALWAYS supply the format argument than
> it is to make the generation of the format argument conditional on
> whether the default behavior is desired.
>
> Trust me - I'm reviewing this as a potential user of your interface.
> When I ask for a fourth enum value, it's because I want to use it. When
> you keep coming back and complaining that you don't want to provide the
> fourth enum value because it is redundant, I feel like you aren't paying
> attention to your user base. I also think that implementation-wise, it
> will be easier to write your code if you have an enum supplying all four
> possibilities, since it is easier to write code that defaults a missing
> argument to a known enum value, and then have the rest of your code deal
> with enum values, than it is to write code that has to check everywhere
> whether the argument is missing (for one value) vs. one of three other
> enum values.
>
I think you give a good reason and we'll add the forth enum value as
'elf'. Thanks very much for your comments.
next prev parent reply other threads:[~2013-05-10 1:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-07 7:16 [Qemu-devel] [PATCH 0/9] Make monitor command 'dump-guest-memory' dump in kdump-compressed format Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 1/9] Add API to manipulate dump_bitmap Qiao Nuohan
2013-05-07 16:14 ` Eric Blake
2013-05-07 16:23 ` Daniel P. Berrange
2013-05-08 8:39 ` qiaonuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 2/9] Add API to manipulate cache_data Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 3/9] Move include and struct definition to dump.h Qiao Nuohan
2013-05-11 13:36 ` Andreas Färber
2013-05-07 7:16 ` [Qemu-devel] [PATCH 4/9] Add API to create header of vmcore Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 5/9] Add API to create data of dump bitmap Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 6/9] Add API to create page Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 7/9] Add API to free buf used by creating header, bitmap and page Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 8/9] Add API to write header, bitmap and page into vmcore Qiao Nuohan
2013-05-07 7:16 ` [Qemu-devel] [PATCH 9/9] Make monitor command 'dump-guest-memory' dump in kdump-compressed format Qiao Nuohan
2013-05-07 17:13 ` Eric Blake
2013-05-08 8:50 ` qiaonuohan
2013-05-08 17:16 ` Eric Blake
2013-05-09 5:27 ` Zhang Xiaohe
2013-05-09 14:51 ` Eric Blake
2013-05-10 1:21 ` Zhang Xiaohe [this message]
2013-05-08 9:03 ` [Qemu-devel] [PATCH 0/9] " HATAYAMA Daisuke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518C4BA6.7020302@cn.fujitsu.com \
--to=zhangxh@cn.fujitsu.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qiaonuohan@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).