From nobody Sun Feb 8 19:56:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1589556508; cv=none; d=zohomail.com; s=zohoarc; b=JZnNzOE8Di4x6s90Q6ubiLcFZQWqcDfMDAfyepzuzlVWBHjPIf+OqVfD2jFX7fhvsF/q7VHsObw+VclpjSru4pu8+RPVl03EI1nvDV6hKX1zOwAxyTnuVk/pe7dN3Ch2ScxKynhebqHSMOonhjAlx/T9mhqOL0PmaGSW9eY53a0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589556508; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xin8fWNuc4GIW220dw52IOtzhDkHSHmNM9dnB0723Ww=; b=QCcmMlW0E1MRNjAxIgOINbyTNddpAQglosweEUFT2IVOdTMTwK6MzrZxuPiD4PpdINhRBpb7r2M4K4PD1PyrDekiNWcA3KbTDGnDtO6t9c5FjaK7ewudFg/PGXUb8OQL3Y1rf/ZvV6/DWVXEWpYkZpmc29XhoI7Qc/1VNSk4xJY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1589556508004476.4154099889953; Fri, 15 May 2020 08:28:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-303-ufz4h2XdMdekpmBu9C4JhA-1; Fri, 15 May 2020 11:28:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E9478018AC; Fri, 15 May 2020 15:28:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 895A360C05; Fri, 15 May 2020 15:28:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5B9221809554; Fri, 15 May 2020 15:28:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04FFSEtx011122 for ; Fri, 15 May 2020 11:28:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id C9A3F5D9D7; Fri, 15 May 2020 15:28:14 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B2945D9C9 for ; Fri, 15 May 2020 15:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589556506; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Xin8fWNuc4GIW220dw52IOtzhDkHSHmNM9dnB0723Ww=; b=Wc5LWBGNZ/yZI6JC4G6/9EkeDHjnLbujFMhCuMWaCnKhj60+CO7T5IdYNnH1r3fP7k49Wm iI4wAVX9QhJ9cx52j9NTWmYvN7uSHwGk+1enL5sQcDNHKy6cptBCVCn5RHzhmFy+ib86bS E6GH2WghuWzPQSUIi32k9YkhNOynZY8= X-MC-Unique: ufz4h2XdMdekpmBu9C4JhA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/21] qemuMonitorJSONParseKeywords: remove constant argument Date: Fri, 15 May 2020 17:27:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There's just one caller that always passes '1'. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_monitor_json.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 505b31a78a..66422a8489 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -604,16 +604,15 @@ qemuMonitorJSONParseKeywordsFree(int nkeywords, /* * Takes a string containing a set of key=3Dvalue,key=3Dvalue,key... * parameters and splits them up, returning two arrays with - * the individual keys and values. If allowEmptyValue is nonzero, - * the "=3Dvalue" part is optional and if a key with no value is found, + * the individual keys and values. + * The "=3Dvalue" part is optional and if a key with no value is found, * NULL is be placed into corresponding place in retvalues. */ static int qemuMonitorJSONParseKeywords(const char *str, char ***retkeywords, char ***retvalues, - int *retnkeywords, - int allowEmptyValue) + int *retnkeywords) { int keywordCount =3D 0; int keywordAlloc =3D 0; @@ -645,14 +644,8 @@ qemuMonitorJSONParseKeywords(const char *str, if (!(separator =3D strchr(start, '=3D'))) separator =3D end; - if (separator >=3D endmark) { - if (!allowEmptyValue) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("malformed keyword arguments in '%s'"), s= tr); - goto error; - } + if (separator >=3D endmark) separator =3D endmark; - } keyword =3D g_strndup(start, separator - start); @@ -708,7 +701,7 @@ qemuMonitorJSONKeywordStringToJSON(const char *str, con= st char *firstkeyword) int nkeywords =3D 0; size_t i; - if (qemuMonitorJSONParseKeywords(str, &keywords, &values, &nkeywords, = 1) < 0) + if (qemuMonitorJSONParseKeywords(str, &keywords, &values, &nkeywords) = < 0) goto error; for (i =3D 0; i < nkeywords; i++) { --=20 2.26.2