From: Max Reitz <mreitz@redhat.com>
To: Lin Ma <lma@suse.com>
Cc: qemu-devel@nongnu.org, kwolf@redhat.com
Subject: Re: [Qemu-devel] 答复: Re: [PATCH] Show all of snapshot info on every block device in output of 'info snapshots'
Date: Sat, 18 Jun 2016 14:49:16 +0200 [thread overview]
Message-ID: <e6b97866-a5dc-873f-e684-6f2dbc6881f9@redhat.com> (raw)
In-Reply-To: <576422DB020000620007AFA0@prv-mh.provo.novell.com>
[-- Attachment #1: Type: text/plain, Size: 4206 bytes --]
On 17.06.2016 10:18, Lin Ma wrote:
>
>
>>>> Max Reitz mreitz@redhat.com> 2016/6/15 星期三 上午 1:43 >>
> <mailto:mreitz@redhat.com> 2016/6/15 星期三 上午 1:43 >>>
> ......
>>I have many comments, but don't worry, it's nothing that can't be fixed.
>>The overall design looks good to me.
> Thank you so much for reviewing the patch very carefully and gave me so many
> comments. I would take most of your comments but except some of below:
>
> ......
>>Nit pick: The following code will always leave an empty line after
>>everything. I think that's superfluous, and it can be amended as follows
>>(if you want to amend it, that is; if you really like that empty line,
>>then feel free to disregard my suggestion):
>>
>>> + monitor_printf(mon, "\n");
>>
>>Drop this.
>>
>>> + QTAILQ_FOREACH(image_entry, &image_list, next) {
>>> + if (QTAILQ_EMPTY(&image_entry->snapshots)) {
>>> + continue;
>>> + }
>>
>>Put monitor_printf(mon, "\n"); here.
> OK.
>
>>> + monitor_printf(mon, "List of partial (non-loadable)
> snapshots on '%s':",
>>> + image_entry->imagename);
>>> + monitor_printf(mon, "\n");
>>
>>(Why did you not concatenate these two strings in a single
>>monitor_printf() call?)
> OK.
>
>>> + bdrv_snapshot_dump((fprintf_function)monitor_printf, mon, NULL);
>>> + monitor_printf(mon, "\n");
>>
>>Drop this.
>>
>>> + QTAILQ_FOREACH(snapshot_entry, &image_entry->snapshots, next) {
>>
>>Put monitor_printf(mon, "\n"); here.
> If so, It causes the output looks like this:
> -FROM:
> List of partial (non-loadable) snapshots on 'drive_image1':
> ID TAG VM SIZE DATE VM CLOCK
> 3 snapb 0 2016-06-16 17:37:25 00:00:00.000
> 4 snapc 0 2016-06-16 17:37:30 00:00:00.000
> 5 snap2 0 2016-06-16 17:37:34 00:00:00.000
> (qemu)
> -TO:
> List of partial (non-loadable) snapshots on 'drive_image1':
> ID TAG VM SIZE DATE VM CLOCK
> 3 snapb 0 2016-06-16 17:37:25 00:00:00.000
>
> 4 snapc 0 2016-06-16 17:37:30 00:00:00.000
>
> 5 snap2 0 2016-06-16 17:37:34 00:00:00.000
> (qemu)
>
> So I'll keep the code.
>
>>> + bdrv_snapshot_dump((fprintf_function)monitor_printf, mon,
>>> + snapshot_entry->sn);
>>> + monitor_printf(mon, "\n");
>>
>>And drop this. Again, the suggestions on moving the
>>monitor_printf(mon, "\n"); calls around are just suggestions, and it's
>>up to you whether you want to follow them or not.
> If so, It causes the output looks like this:
> -FROM:
> List of partial (non-loadable) snapshots on 'drive_image1':
> ID TAG VM SIZE DATE VM CLOCK
> 3 snapb 0 2016-06-16 17:37:25 00:00:00.000
> 4 snapc 0 2016-06-16 17:37:30 00:00:00.000
> 5 snap2 0 2016-06-16 17:37:34 00:00:00.000
> (qemu)
> -TO:
> List of partial (non-loadable) snapshots on 'drive_image1':
> ID TAG VM SIZE DATE VM CLOCK
> 3 snapb 0 2016-06-16 17:37:25 00:00:00.0004 snapc 0 2016-06-16 17:37:30 00:00:00.0005 snap2 0 2016-06-16 17:37:34
> 00:00:00.000(qemu)
>
> So I'll keep the code.
Well, the idea was to do all of the suggestions, and then these two
would counteract each other.
However, I just noticed that I was completely wrong about my nit pick
anyway. The code won't leave an empty line after printing everything, I
made a mistake there.
My suggestion instead leads to not having an end-of-line after
everything, which is definitely wrong (sorry!).
So you should probably leave all the monitor_printf(mon, "\n")
statements as they are, except the one where I asked about concatenating
it with the previous one.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-06-18 12:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-12 15:38 [Qemu-devel] [] [PATCH] Show all of snapshot info on every block device in output of 'info snapshots' Lin Ma
2016-06-14 17:43 ` Max Reitz
2016-06-17 8:18 ` [Qemu-devel] 答复: " Lin Ma
2016-06-18 12:49 ` Max Reitz [this message]
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=e6b97866-a5dc-873f-e684-6f2dbc6881f9@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lma@suse.com \
--cc=qemu-devel@nongnu.org \
/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).