From nobody Sun Feb 8 18:31:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1606762630; cv=none; d=zohomail.com; s=zohoarc; b=it603O3kF5tjbZyuoMz9DaR1mHsg/FQiPDi2zdxUnIOtnpv7UK1deHxWFWiRf7n5eixly94Zn07F9cdjMBP+LkBhKxKSbzTCY5EzL1agPA1NdXPqL0ZlixOCt56ns+0/0TIiP/YlP+hxeNm9Kc+THLrSUrbmRCOkARuHN9JhJYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606762630; 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=6XSqIejFSeoZnYx/CCZE/W8h4wQRWSrEaskSsHvSVxM=; b=eomCQXD4866ATmmVTOMZo3TLpaYCcPdCOpp8qTvWZ9//BbXEqRHzAqoGwdLtVbTiW8XkRVjruCVbxm7/QnzLRQt2dxlYcS0br+m+14GflEIHEuhWhYMG5uocitXYstScn8fFKVoN33qqZT3jpVfoGLfsDLILdkeRHrm62Lo2lNk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606762630682332.2753436589644; Mon, 30 Nov 2020 10:57:10 -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-21-rD923jKVMcq1W2f4Ne9QRw-1; Mon, 30 Nov 2020 13:56:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 951561074653; Mon, 30 Nov 2020 18:56:15 +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 72A1760873; Mon, 30 Nov 2020 18:56:15 +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 3F4D35003C; Mon, 30 Nov 2020 18:56:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AUIuCfQ014425 for ; Mon, 30 Nov 2020 13:56:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7210960C6A; Mon, 30 Nov 2020 18:56:12 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id C463D60C67 for ; Mon, 30 Nov 2020 18:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606762629; 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=6XSqIejFSeoZnYx/CCZE/W8h4wQRWSrEaskSsHvSVxM=; b=EiI82Am03mdKArsZxlg2/XmnO/WU/6yUf1mMt0jRDEpn/vSoiXKi3zj3atm7fusXwd8oyQ X1M35PBOuJja4bzaswEy8ADBpM04ewfdaB8QkGPrYVjCp6obuIm9e6h+hEwVQZvJTLf5qn BKHE0xc1elH2P+p1kJ8FZltrIOGwtrs= X-MC-Unique: rD923jKVMcq1W2f4Ne9QRw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/24] qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps Date: Mon, 30 Nov 2020 19:55:33 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.13 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 4050e1e7af..e21cbb451e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3206,10 +3206,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 5da3213976..e0eee3ce9e 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3008,21 +3008,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 a7fba393bf..e02e131e3b 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1009,10 +1009,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.28.0