From nobody Tue May 14 07:17:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1657277365; cv=none; d=zohomail.com; s=zohoarc; b=M1h9coJ96G6FPj8cencHu2n8YZgNfeKKZ9wjwxbhPXmogExtY7FzH8igXByY0bYfe1wasuZ0V+mg2Zix85CWun+OiArjwEqK7XQsxHUypPhB6lYyMMghjnKeTbyO/ZTou171AFSVLnYLAdlgoXaYB0ggnE2qi8zcmy8pmAxRofU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657277365; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ORHx6ARo7QPfelCMQNQ90208GCw68771cF5Tju6YW10=; b=Ghh06nUZsoHMsvY2rZfc092E5KJ8aqRdMM1u4MtN6IgjLM3o5Q8hdujiS2PUD2UHTa/WLpVm1dRlTH7LjKc0pnbYJW63Qne4Cg31VatjyGAnxkWdVeLuCzEwk8u2QCiSBQkIjxzT53QQ6zHNTOjI7S5rGUg3PyIRiB/BEPMQNQ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1657277365813904.1614166446116; Fri, 8 Jul 2022 03:49:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-8-Dj8F44Npmvbj5S_Zu-zw-1; Fri, 08 Jul 2022 06:49:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F31A93C0E23B; Fri, 8 Jul 2022 10:49:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E41818EB5; Fri, 8 Jul 2022 10:49:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB069194706C; Fri, 8 Jul 2022 10:49:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 347FF194706B for ; Fri, 8 Jul 2022 10:49:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1ED91C28118; Fri, 8 Jul 2022 10:49:18 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBD90C202C5 for ; Fri, 8 Jul 2022 10:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657277364; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ORHx6ARo7QPfelCMQNQ90208GCw68771cF5Tju6YW10=; b=TOF1q33Cj4bnMQEmR1xvVyr93DKLHoC8OH2ulvQnn1t9EMJ4i8qvLbox69+PybX1avNGWK JJwUfqoxJbgZWEW/JUpODs393hyERhv3jKWGmIrabCsIaXB49MTj3bgzalsZNbe/G9BWpN wXOLh/qLI2eYXM8DawVegchPA9U7SBw= X-MC-Unique: 8-Dj8F44Npmvbj5S_Zu-zw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virsh: Require --xpath for dumpxml Date: Fri, 8 Jul 2022 12:49:13 +0200 Message-Id: <74f68edcc76493695f8bd5db104558c698eb8d06.1657277353.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1657277366922100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Historically, the dumpxml command reject any unknown arguments, for instance: virsh dumpxml fedora xxx However, after v8.5.0-rc1~31 the second argument ('xxx') is treated as an XPath, but it's not that clearly visible. Therefore, require the --xpath switch, like this: virsh dumpxml fedora --xpath xxx Yes, this breaks already released virsh, but I think we can argue that the pool of users of this particular function is very small. The sooner we do this change, the better. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2103524 Signed-off-by: Michal Privoznik --- tools/virsh-domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 43034f2f81..a181ae005f 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10461,6 +10461,7 @@ static const vshCmdOptDef opts_dumpxml[] =3D { }, {.name =3D "xpath", .type =3D VSH_OT_STRING, + .flags =3D VSH_OFLAG_REQ_OPT, .completer =3D virshCompleteEmpty, .help =3D N_("xpath expression to filter the XML document") }, --=20 2.35.1