From patchwork Thu Sep 6 11:11:04 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: 10590455 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 0C4F9921 for ; Thu, 6 Sep 2018 11:12:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3F02286E6 for ; Thu, 6 Sep 2018 11:12:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5C59287D2; Thu, 6 Sep 2018 11:12:54 +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.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 886E9286E6 for ; Thu, 6 Sep 2018 11:12:54 +0000 (UTC) Received: from localhost ([::1]:60817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxsDV-0008IY-D5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Sep 2018 07:12:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxsCB-0007E4-C7 for qemu-devel@nongnu.org; Thu, 06 Sep 2018 07:11:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxsC9-0001lx-5R for qemu-devel@nongnu.org; Thu, 06 Sep 2018 07:11:30 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:38484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxsC8-0001jU-M5 for qemu-devel@nongnu.org; Thu, 06 Sep 2018 07:11:28 -0400 Received: by mail-qt0-x229.google.com with SMTP id x7-v6so11708769qtk.5 for ; Thu, 06 Sep 2018 04:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZB0UtTlG7H3D7LRWqEScRovdOQfhNuRPpb7/Lo/WIWE=; b=E5BpXxtGvuQkMEsImR9YtfPvg1RtIz6SdDJE32ZKCleO9NWcB3ajbrMonDFzt4nUpJ OvzqA1Xsc5kNXdrYVLG94UlOm2dsY9hkGEtjY56Jc41D20UsQ6+Gg231s7vz/wBGDR2K t+J9iOQK08kTnQCbSJryD8gaNgk1tVHmepDVa7BF5JlIXmI6P6vwDo9bJ6Q4+Hz6Z2DY 9M24oPeQM6hT1PB1TktxoHvu9Bv2oCsgH6QCG9gEEOX8GQLZBExqdmtMnQxg4kT1Z9GM h3NIUHl/vtL5v+kkkqfdegpXT1By/RvpzmJ9xBspXZ/AVklg0ArMEKNEpu7n36aFNsPC M8QQ== 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=ZB0UtTlG7H3D7LRWqEScRovdOQfhNuRPpb7/Lo/WIWE=; b=pApORIODc6zDaVDd649YKmM8kD//Ie66i1FItFPsyqJAkljksCFgsvSTFw4eB7lPTw zMyPgyui/nEzYoDGBPfJNYCvHt0/kS4kZoRpGDLA6QH/dK2okwtw0jXk5CvwAoGGp8xt NbLuR0UuXAG/LmjwKogJ0hTCh+FOvkv699JqVnq38lYO6fSWhepwOCNTFKouZ5LNpS7A 0ZZ+2ei7CFLCoVNYLIEDFalUb9z5fgBiVVewd/UPh30ACJrrLTFX0ThUokCQ4E8FYesH I63c55Np7NC086/U/eDDuETsEl/y6+wzF9CpYBi9X0OkP23QS6p3A+KpaGVC3zgVqvAQ UpPg== X-Gm-Message-State: APzg51AJ1RQxGds2kuix0MJ/2k7ywbJjEOT6WKr0vhhv3ENjMo9oysKt 4bewiuGvFQIro+qQxuqZukocFrM85Rs= X-Google-Smtp-Source: ANB0Vdbbw0jrQg5HDk8Yqy54Ygvgqc/ou1s6sYisFS/t2iVGTJeBIej+P9xvF7GopqD/5HesoMkzqQ== X-Received: by 2002:ac8:71d1:: with SMTP id i17-v6mr1551858qtp.65.1536232286981; Thu, 06 Sep 2018 04:11:26 -0700 (PDT) Received: from localhost.localdomain ([2804:431:f701:4c04:a888:3548:cd61:60d5]) by smtp.gmail.com with ESMTPSA id x26-v6sm3180169qth.15.2018.09.06.04.11.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Sep 2018 04:11:26 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Thu, 6 Sep 2018 08:11:04 -0300 Message-Id: <20180906111107.30684-1-danielhb413@gmail.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::229 Subject: [Qemu-devel] [PATCH v2 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, Daniel Henrique Barboza , armbru@redhat.com, dgilbert@redhat.com, muriloo@linux.ibm.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 v2: - removed the "RFC" marker; - added a new patch (patch 2) that removes bdrv_snapshot_delete_by_id_or_name from the code; - made changes in patch 1 as suggested by Murilo; - previous patch set link: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg04658.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. I guess there's room for discussion about considering this change an API change or not. It doesn't affect users of HMP and it doesn't affect Libvirt, but simplifying the meaning of the parameters of savevm/loadvm/delvm. 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 | 24 ++++++++++++------------ include/block/snapshot.h | 3 --- qemu-img.c | 15 +++++++++++---- 5 files changed, 26 insertions(+), 46 deletions(-)