|
From: | seeteena |
Subject: | Re: [Qemu-devel] [PATCH v1] hmp: 'info snapshots' not showing the id |
Date: | Wed, 13 Dec 2017 10:20:01 +0530 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
Hi David, While creating snapshots when tag name '0' used in the very first and followed by tag name '1' then snapshot created with tag name '0' is getting erased. A snapshot is identified by a name computed either from an id, which is basically a numerical counter starting at 1 for qcow2, or from a tag, which is a string (provided by the user or automatically computed). (qemu) savevm 0 This creates a snapshot with tag '0' and id '1'.
(qemu) savevm 1
This deletes snapshot with name '1' (ie, with id '1') and creates snapshot with tag '1' and id '1'. From the output of 'info snapshots' id '1' is not seen for tag '0' instead seeing an empty field. ID TAG VM SIZE DATE VM CLOCK -- 0 338M 2017-10-16 13:44:35 00:02:07.491 If an ID shown as '1' in the above then user can understand the above documented stuff i.e "If there is already a snapshot with the same tag or ID, it is replaced". The '--' in ID field is annoying. On 12/12/2017 10:11 PM, Dr. David Alan Gilbert wrote:
* Seeteena Thoufeek (address@hidden) wrote:(qemu) info snapshots List of snapshots present on all disks: ID TAG VM SIZE DATE VM CLOCK -- 1 314M 2017-11-15 15:22:18 00:02:25.695 -- 2 319M 2017-11-15 15:23:03 00:02:45.970 -- 3 319M 2017-11-15 15:23:37 00:02:56.328 ID field is showing -- with no information. Signed-off-by: Seeteena Thoufeek <address@hidden>Hi Seeteena, Your change doesn't seem to be consistent with the comment above it. I don't know the detailed history of snapshots, but that comment and the pstrcpy comes from Lin Ma's commit 3a1ee711 which seems to be saying the ID can't be trusted. Dave--- hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 35a7041..1921b3b 100644 --- a/hmp.c +++ b/hmp.c @@ -1454,7 +1454,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict) /* The ID is not guaranteed to be the same on all images, so * overwrite it. */ - pstrcpy(sn->id_str, sizeof(sn->id_str), "--"); + pstrcpy(sn->id_str, sizeof(sn->id_str), sn->id_str); bdrv_snapshot_dump((fprintf_function)monitor_printf, mon, sn); monitor_printf(mon, "\n"); } -- 1.8.3.1-- Dr. David Alan Gilbert / address@hidden / Manchester, UK
[Prev in Thread] | Current Thread | [Next in Thread] |