From patchwork Wed Nov 7 13:09:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 10672357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2127B14D6 for ; Wed, 7 Nov 2018 13:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DC3B2BB51 for ; Wed, 7 Nov 2018 13:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B66D2BB92; Wed, 7 Nov 2018 13:19:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B20292B386 for ; Wed, 7 Nov 2018 13:19:08 +0000 (UTC) Received: from localhost ([::1]:48203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKNjf-0000wc-Qu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Nov 2018 08:19:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKNbZ-0006nv-9n for qemu-devel@nongnu.org; Wed, 07 Nov 2018 08:10:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKNbV-0002oM-Mt for qemu-devel@nongnu.org; Wed, 07 Nov 2018 08:10:44 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:41008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKNbP-00028I-P1 for qemu-devel@nongnu.org; Wed, 07 Nov 2018 08:10:37 -0500 Received: by mail-qk1-x744.google.com with SMTP id 189so20593713qkj.8 for ; Wed, 07 Nov 2018 05:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=muFoVX9HW5TmiFnIFMC7BXzPx5M7jxicTqhk5yOVyHk=; b=Ep//x1iu7KZo/n6CmN1Jf1fKX0xgC5DHflb8LyFlR9PmkivDspcbFdBBSmfKUuPVVl bQdMPl5K3qK0ATTYxts1q0YBWUlS/2njkFra81L6MzttSOA5wnQSQmQVNuYMXUOcaeS2 DEDycTtLXU/FloBz/qXh7XMuoXUZHq94aTsDpvGOubDdfzVPUttwjs7FFatJzFw2PQo5 bkYCXeEIv+z10PjT1Iq70J21/gn398qTXov93RFk6wb+inkY9paWdnRJahBMrqcbDebS YCuyYI251GG0QhGSf2GmiRTCCzjN2EAecbwIgExu0+qfNcz5VcPIvj7+z2tYIV6dKQzH gmbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=muFoVX9HW5TmiFnIFMC7BXzPx5M7jxicTqhk5yOVyHk=; b=WO87ZiXs4XMyPn5NEL2lBP/O0UXhLYuv4K+erZlB5boJszVoLaqLMpCfJ2hOgn+5vN Zg7ptjI1nlxqnJWFu1DYmibHxUKbueT2F7cR0lBzLukJog5Jgk71ODEUZhxXDHrg7V1h RP+rRr89g7qrx/ZSFsoZ/y3jmH4eSHM865Kci7u6lg1/KgPTl1sgEXIxFqyXQqYMcqvm xdb46k1MnCH266tPNZmu88FM32LCCAWnGWlRAbfekGNbKEVG3WYJSiIGnZtg+hIOa32p z76UG6UfrK53/jRwXwyV4a266SvK21qo+tf2MmAZ63Mfj//nqC1VUDgZFHLSvGCTgpUg Xivw== X-Gm-Message-State: AGRZ1gIaAVmrjoihjE7jR854pxQ5ybupvJrGOTKrAqJCEZ6EOD5hBdv5 pJLd4LcdD2+kUyvGjhcPOVShvTSfwio= X-Google-Smtp-Source: AJdET5eLSJ8cQGaksZNTSNV8cr1McmCOKhY1ffuDW8Ek8+/YiBDGPKepPQZj/Jg6A8REJtFnC/0zog== X-Received: by 2002:ac8:1416:: with SMTP id k22-v6mr138672qtj.390.1541596223072; Wed, 07 Nov 2018 05:10:23 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:ba45:6a73:9179:662c:d5bc]) by smtp.gmail.com with ESMTPSA id i35-v6sm317282qtb.16.2018.11.07.05.10.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Nov 2018 05:10:22 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Wed, 7 Nov 2018 11:09:57 -0200 Message-Id: <20181107131000.27744-1-danielhb413@gmail.com> X-Mailer: git-send-email 2.17.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 Subject: [Qemu-devel] [PATCH for-3.2 v3 0/3] HMP/snapshot changes - do not use ID anymore X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, armbru@redhat.com, Daniel Henrique Barboza , dgilbert@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP changes in v3: - rebased to v3.1.0-rc0 tag - hmp-commands.hx documentation now mentions the change of semantics starting version 3.2. - previous version link: http://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg00629.html It is not uncommon to see bugs being opened by testers that attempt to create VM snapshots using HMP. It turns out that "0" and "1" are quite common snapshot names and they trigger a lot of bugs. I gave an example in the commit message of patch 1, but to sum up here: QEMU treats the input of savevm/loadvm/delvm sometimes as 'ID', sometimes as 'name'. It is documented as such, but this can lead to strange situations. Given that it is strange for an API to consider a parameter to be 2 fields at the same time, and inadvently treating them as one or the other, and that removing the ID field is too drastic, my idea here is to keep the ID field for internal control, but do not let the user set it. This series simplifies the meaning of savevm/loadvm/delvm to be up to par to what the QEMU code (and Libvirt) is already doing: snapshot operations using "tag" semantics only, leaving the "id" to be automatically calculated by the block drivers and used internally only. This change of semantics does not affect existing snapshots. What changes is that any HMP operations with them will use the updated semantics. Daniel Henrique Barboza (3): block/snapshot.c: eliminate use of ID input in snapshot operations block/snapshot: remove bdrv_snapshot_delete_by_id_or_name qcow2-snapshot: remove redundant find_snapshot_by_id_and_name call block/qcow2-snapshot.c | 5 ----- block/snapshot.c | 25 +++---------------------- hmp-commands.hx | 32 ++++++++++++++++++++------------ include/block/snapshot.h | 3 --- qemu-img.c | 15 +++++++++++---- 5 files changed, 34 insertions(+), 46 deletions(-)