From nobody Sun Feb 8 18:43:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1558079148; cv=none; d=zoho.com; s=zohoarc; b=hsN5sh/PU/xHgrIUWf5cPHzUyGqImoJfl+OBw5cQAJXJKRJhLbgZkeJDmnU99+R7TJ1vR/1/rOz5y0mFbnaq4kt5EpJ7xgXjSEj33fTA5YqCWV7kkoi8AFql0QoNjvClFvilZzHBEP+RKT8V+fLAHQUYY7UD19MDENZnPezi+A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558079148; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=W/cidnGe3XEe3vepIo85R7dFm2ItDuk/ghYO4TtAG04=; b=EgAqwsatOQcI9u7dmGgwbQjW22ImBGnJBTvwXGsr+WGF9QPs4M6s2rhxbrXT2pA8IhXaB9O6f9FOAt82k7/R1Oh3VdQ2cDNBcV0cxsrK9PsRbwm/N1KuBxiX4e6iD+3jMZj7VTXnINnJcg5WRXSVqn1Bvw4iP/4m/qRNm636eLA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558079148519176.95930066480935; Fri, 17 May 2019 00:45:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D9B93DE0E; Fri, 17 May 2019 07:45:33 +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 4727E5D9CD; Fri, 17 May 2019 07:45:33 +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 F37B71806B13; Fri, 17 May 2019 07:45:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4H7irGS025511 for ; Fri, 17 May 2019 03:44:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF82117152; Fri, 17 May 2019 07:44:53 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6906217142; Fri, 17 May 2019 07:44:52 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 17 May 2019 09:45:16 +0200 Message-Id: <1558079119-320634-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1558079119-320634-1-git-send-email-imammedo@redhat.com> References: <1558079119-320634-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, pbonzini@redhat.com, ehabkost@redhat.com Subject: [libvirt] [PATCH v3 3/6] qmp: qmp_qom_list_properties(): ignore empty string options 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 17 May 2019 07:45:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Current QAPI semantics return empty "" string in case string property value hasn't been set (i.e. NULL). Do not show initial value in this case in "qom-list-properties" command output to reduce clutter. Signed-off-by: Igor Mammedov --- qmp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qmp.c b/qmp.c index 8415541..463c7d4 100644 --- a/qmp.c +++ b/qmp.c @@ -41,6 +41,7 @@ #include "qom/object_interfaces.h" #include "hw/mem/memory-device.h" #include "hw/acpi/acpi_dev_interface.h" +#include "qapi/qmp/qstring.h" =20 NameInfo *qmp_query_name(Error **errp) { @@ -596,7 +597,16 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const = char *typename, if (obj) { info->q_default =3D object_property_get_qobject(obj, info->name, NULL); - info->has_q_default =3D !!info->q_default; + if (info->q_default) { + if (qobject_type(info->q_default) =3D=3D QTYPE_QSTRING) { + QString *value =3D qobject_to(QString, info->q_default); + if (!strcmp(qstring_get_str(value), "")) { + qobject_unref(info->q_default); + info->q_default =3D NULL; + } + } + info->has_q_default =3D !!info->q_default; + } } =20 entry =3D g_malloc0(sizeof(*entry)); --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list