From nobody Mon Feb 9 13:59:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1614182409; cv=none; d=zohomail.com; s=zohoarc; b=JDkAnrFjMjW4NA8Yly7U+jWPVUNN/Tq6ShDDBhkC2z5zqcbWbfTEe92GuS8W9NpXUu1Kp4Mm/NPWbKxrzdrJ1s+bay4hA5pwpsNm9BnBG54PZg0HwYZPleKHXdDqFyEffqIUNXiHsJZV6jWsWdtwjlu6jgFONamU2g7z3jlmOCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614182409; 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=hddrcK0E5nqHDdNvhtTrh1kNcLEbuKlyKEl+F8MhqM8=; b=hDrbgQUMudS/IBw1HaAAJ/m/ax0COP4+KzgSnVjx2qTCAeFtMVlc7lnTK5vp10MKaarZ7pD1fSvzMjJFnBZluOaApF1nzoEwEIhKsoN8lc6E1kOXCZECkkPFYH0fqbzpq9JA1yMgSJjlI0hhb1TEfuJn0Es/AoJXj9dTgFNCw3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614182409789613.7875083148468; Wed, 24 Feb 2021 08:00:09 -0800 (PST) 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-242-Bydu6PH-NKSWGwugUwhtLw-1; Wed, 24 Feb 2021 10:59:01 -0500 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 E56A8804056; Wed, 24 Feb 2021 15:58:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C459760BF3; Wed, 24 Feb 2021 15:58:51 +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 8E12358079; Wed, 24 Feb 2021 15:58:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11OFwJvn010847 for ; Wed, 24 Feb 2021 10:58:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id A750F100239A; Wed, 24 Feb 2021 15:58:19 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12BE0100239F for ; Wed, 24 Feb 2021 15:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614182408; 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=hddrcK0E5nqHDdNvhtTrh1kNcLEbuKlyKEl+F8MhqM8=; b=dxAjTx568cJJLXMJIDhxjahSQiZFQ4G1t7xBuvQ+Fhrrc/3pTz8kgock2TfcUMFWYCOc4M LVHH8kra4ZdrdjaJytpQ0TyBjzGANwC0UOByPOepvi9LX4DCKpxzxXgxxjmCChnPKthGtB 5qJv1uBCdhbhxhpR1njyu8Ksyn8O9bM= X-MC-Unique: Bydu6PH-NKSWGwugUwhtLw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 08/12] qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps Date: Wed, 24 Feb 2021 16:58:02 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 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) Content-Type: text/plain; charset="utf-8" There's just one caller left. Since qemuBuildMemoryBackendProps is too complex to be modified for now, just move the adding of 'id' and 'qom' type directly into the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 ++++-- src/qemu/qemu_monitor.c | 15 --------------- src/qemu/qemu_monitor.h | 4 ---- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c4bb6a87bb..31b20a4f12 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3284,10 +3284,12 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, rc =3D 0; } - if (!(*backendProps =3D qemuMonitorCreateObjectPropsWrap(backendType, = alias, - &props))) + if (virJSONValueObjectPrependString(props, "id", alias) < 0 || + virJSONValueObjectPrependString(props, "qom-type", backendType) < = 0) return -1; + *backendProps =3D g_steal_pointer(&props); + return rc; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8b88c8f922..121c21be5c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3010,21 +3010,6 @@ qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, } -virJSONValuePtr -qemuMonitorCreateObjectPropsWrap(const char *type, - const char *alias, - virJSONValuePtr *props) -{ - - if (virJSONValueObjectPrependString(*props, "id", alias) < 0 || - virJSONValueObjectPrependString(*props, "qom-type", type)) - return NULL; - - return g_steal_pointer(props); -} - - - /** * qemuMonitorCreateObjectProps: * @propsret: returns full object properties diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index d25c26343a..c6ffd51ce8 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1006,10 +1006,6 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon, int qemuMonitorDelDevice(qemuMonitorPtr mon, const char *devalias); -virJSONValuePtr qemuMonitorCreateObjectPropsWrap(const char *type, - const char *alias, - virJSONValuePtr *props); - int qemuMonitorCreateObjectProps(virJSONValuePtr *propsret, const char *type, const char *alias, --=20 2.29.2