From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKU6w-0006oF-80 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 13:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKU6r-0008Qs-3g for qemu-devel@nongnu.org; Tue, 05 Jul 2016 13:26:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKU6q-0008QX-SH for qemu-devel@nongnu.org; Tue, 05 Jul 2016 13:26:09 -0400 References: <1467624719-6645-1-git-send-email-lma@suse.com> <1467624719-6645-3-git-send-email-lma@suse.com> From: Max Reitz Message-ID: Date: Tue, 5 Jul 2016 19:26:05 +0200 MIME-Version: 1.0 In-Reply-To: <1467624719-6645-3-git-send-email-lma@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L6kDBXiHVH984Xt9LAnwsmB2QEuPiJs6i" Subject: Re: [Qemu-devel] [PATCH 2/2 V4] hmp: show all of snapshot info on every block dev in output of 'info snapshots' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma , qemu-devel@nongnu.org Cc: kwolf@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L6kDBXiHVH984Xt9LAnwsmB2QEuPiJs6i From: Max Reitz To: Lin Ma , qemu-devel@nongnu.org Cc: kwolf@redhat.com Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/2 V4] hmp: show all of snapshot info on every block dev in output of 'info snapshots' References: <1467624719-6645-1-git-send-email-lma@suse.com> <1467624719-6645-3-git-send-email-lma@suse.com> In-Reply-To: <1467624719-6645-3-git-send-email-lma@suse.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 04.07.2016 11:31, Lin Ma wrote: > Currently, the output of 'info snapshots' shows fully available snapsho= ts. > It's opaque, hides some snapshot information to users. It's not conveni= ent > if users want to know more about all of snapshot information on every b= lock > device via monitor. >=20 > Follow Kevin's and Max's proposals, The patch makes the output more det= ailed: > (qemu) info snapshots > List of snapshots present on all disks: > ID TAG VM SIZE DATE VM CLO= CK > -- checkpoint-1 165M 2016-05-22 16:58:07 00:02:06.8= 13 >=20 > List of partial (non-loadable) snapshots on 'drive_image1': > ID TAG VM SIZE DATE VM CLO= CK > 1 snap1 0 2016-05-22 16:57:31 00:01:30.5= 67 >=20 > 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. > --- > migration/savevm.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++= ++++---- > 1 file changed, 90 insertions(+), 7 deletions(-) >=20 > 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 QDi= ct *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, NULL= ); > + 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 > + SnapshotEntry *next_sn; > + QTAILQ_FOREACH_SAFE(snapshot_entry, &image_entry->snapshots, n= ext, > + next_sn) { > + g_free(snapshot_entry); > + } > + g_free(image_entry); > + } > g_free(sn_tab); > - g_free(available_snapshots); > + g_free(global_snapshots); > =20 > } > =20 >=20 --L6kDBXiHVH984Xt9LAnwsmB2QEuPiJs6i 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 iQEvBAEBCAAZBQJXe+2tEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrUpu B/0RthjZhYCpHqGLqmMj2sM40e+xMG2Dkg6oYeSp92F6bgmq37bWkfV7XtQTSY8x Ccyg7tp6MtERX1wykwW3G+8qw7tQp09jw2EZlmGthC+eJhnIMYkKFyfGER3Eu1Wg j/xWRt6NbRdG91C8uo0+bmZlyQpo125VjRTlGkSnE02DF+2GXVLf4OqdIZal3uaQ jPMRfAlIe93HMNvXyiGDNOiCSaIToXisMQBxOH00Q7c7ebksZQthLpOEg/oa1cxv gR000Z49kbfYcrskisiK7ISyC/butlvJTAeryNgVrtWiANfoqybz2J/f92xdW+ji dsBEKHkJRh9Z7VW2660DBGsf =W82g -----END PGP SIGNATURE----- --L6kDBXiHVH984Xt9LAnwsmB2QEuPiJs6i--