Received: from eggs.gnu.org ([2001:4830:134:3::10]:40183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKm8K-0004t3-40 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKm8I-0000V1-SV for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:40:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKm8I-0000Uv-KD for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:40:50 -0400 References: <1467624719-6645-1-git-send-email-lma@suse.com> <1467624719-6645-3-git-send-email-lma@suse.com> <577D0AA80200006200082928@prv-mh.provo.novell.com> From: Max Reitz Message-ID: <5d886995-3d2b-54e8-c7c9-328fce3182f9@redhat.com> Date: Wed, 6 Jul 2016 14:40:47 +0200 MIME-Version: 1.0 In-Reply-To: <577D0AA80200006200082928@prv-mh.provo.novell.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pupebi80DsFakFsNkgFCPfwqUWpVoaUa7" Subject: Re: [Qemu-devel] =?utf-8?b?562U5aSN77yaIFJlOiAgW1BBVENIIDIvMiBWNF0g?= =?utf-8?q?hmp=3A_show_all_of_snapshot_info_on_every_block_dev_in_output_o?= =?utf-8?q?f_=27info_snapshots=27?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma Cc: qemu-devel@nongnu.org, kwolf@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pupebi80DsFakFsNkgFCPfwqUWpVoaUa7 From: Max Reitz To: Lin Ma Cc: qemu-devel@nongnu.org, kwolf@redhat.com Message-ID: <5d886995-3d2b-54e8-c7c9-328fce3182f9@redhat.com> Subject: =?UTF-8?B?UmU6IOetlOWkje+8miBSZTogW1FlbXUtZGV2ZWxdIFtQQVRDSCAyLzIg?= =?UTF-8?Q?V4]_hmp:_show_all_of_snapshot_info_on_every_block_dev_in_output_o?= =?UTF-8?Q?f_'info_snapshots'?= References: <1467624719-6645-1-git-send-email-lma@suse.com> <1467624719-6645-3-git-send-email-lma@suse.com> <577D0AA80200006200082928@prv-mh.provo.novell.com> In-Reply-To: <577D0AA80200006200082928@prv-mh.provo.novell.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06.07.2016 07:42, Lin Ma wrote: >=20 >=20 >>>> Max Reitz 2016/7/6 =E6=98=9F=E6=9C=9F=E4=B8=89 =E4= =B8=8A=E5=8D=88 1:26 >>> >>On 04.07.2016 11:31, Lin Ma wrote: >>> Currently, the output of 'info snapshots' shows fully available > snapshots. >>> It's opaque, hides some snapshot information to users. It's not > convenient >>> if users want to know more about all of snapshot information on every= > block >>> device via monitor. >>> >>> Follow Kevin's and Max's proposals, The patch makes the output more > detailed: >>> (qemu) info snapshots >>> List of snapshots present on all disks: >>> ID TAG VM SIZE DATE VM C= LOCK >>> -- checkpoint-1 165M 2016-05-22 16:58:07 00:02:06= =2E813 >>> >>> List of partial (non-loadable) snapshots on 'drive_image1': >>> ID TAG VM SIZE DATE VM C= LOCK >>> 1 snap1 0 2016-05-22 16:57:31 00:01:30= =2E567 >>> >>> Signed-off-by: Lin Ma >>> Reviewed-by: Max Reitz >> >>I said it looked good apart from what I said, but I didn't give an R-b,= >>so this shouldn't be here. > Got it. >=20 >> >>> --- >>> migration/savevm.c | 97 > ++++++++++++++++++++++++++++++++++++++++++++++++++---- >>> 1 file changed, 90 insertions(+), 7 deletions(-) >>> >>> diff --git a/migration/savevm.c b/migration/savevm.c >>> index a8f22da..95e9efa 100644 >>> --- a/migration/savevm.c >>> +++ b/migration/savevm.c >> >>[...] >> >>> @@ -2249,11 +2308,35 @@ void hmp_info_snapshots(Monitor *mon, const > QDict *qdict) >>> monitor_printf(mon, "\n"); >>> } >>> } else { >>> - monitor_printf(mon, "There is no suitable snapshot > available\n"); >>> + monitor_printf(mon, "None\n"); >>> } >>>=20 >>> + QTAILQ_FOREACH(image_entry, &image_list, next) { >>> + if (QTAILQ_EMPTY(&image_entry->snapshots)) { >>> + continue; >>> + } >>> + monitor_printf(mon, >>> + "\nList of partial (non-loadable) snapshots > on '%s':\n", >>> + image_entry->imagename); >>> + bdrv_snapshot_dump((fprintf_function)monitor_printf, mon, NU= LL); >>> + monitor_printf(mon, "\n"); >>> + QTAILQ_FOREACH(snapshot_entry, &image_entry->snapshots, next= ) { >>> + bdrv_snapshot_dump((fprintf_function)monitor_printf, mon= , >>> + &snapshot_entry->sn); >>> + monitor_printf(mon, "\n"); >>> + } >>> + } >>> + >>> + QTAILQ_FOREACH(image_entry, &image_list, next) { >> >>This needs to be a QTAILQ_FOREACH_SAFE(), too. >> >>Max > OK, I'd like to define such a var: 'ImageEntry *next_ie' for this > QTAILQ_FOREACH_SAFE, > put it above this line. > How about it? You should put the definition at the start of this function, since the qemu coding style mandates variable declarations to only be at the start of the block they are in. Max --pupebi80DsFakFsNkgFCPfwqUWpVoaUa7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEvBAEBCAAZBQJXfPxPEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrYnz B/9n3hVmOVDTjy6hj/NsyxS6437a/6fLF2KfZoF7vp0ZxUZCy/ZDxOpKnwHr7Ru7 W/nBVV7UhdKFD28QtsbMKoqr1+M9CrquXbsg33lHva+8IcyuOpv9d60HzC9J5daU tSClDPry6jN+zYAe8MKEeraRgcnKOIGYjE0MPDHiiU/JSZWzNwi1n4SQAUvdJCNA 75V3ovm7Jvs3gWlcrP2UU3bPGeCOFHfdNYxElBwRq6RwLwgd18u8XiIodMVFKhvF O9Sr6DoZtZSnuqqumjY3e50ngYHP5kkXWz9/aLaZpnqfCh+msTOWeG9wtMFw9u4O iwSEiYS5uSsXWGFJtbXEdXYA =s/GX -----END PGP SIGNATURE----- --pupebi80DsFakFsNkgFCPfwqUWpVoaUa7--