From nobody Mon Feb 9 03:00:05 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=1616164461; cv=none; d=zohomail.com; s=zohoarc; b=MX3yixhXaVi9QwdolKnZhOIRc11bgDvH6kGhSWXo8DsLoD2Z1DjdS/49XeBXTOLyW4EfYTq4b96FMU+42a2u16e1V+8zQvqxjLKc+7dekPW+srituzerRk34FZv7FoY9Z2uIup077mmmF3SWo6gRdEyKI04JHBYK1FjL7iJNaTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616164461; 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=MZCh25WLkLiRwWAmkNCZ2Mad8E13XvdFqlLpi84z+mw=; b=aZIlF68Jazt5YgOimIhz7vbJMOGbxfNE3gfn1MgX6A8x3zRZMcRiTXrQJXIoaF/HUcLAymv1A8KHJYhH5l4+bvezEMPJftCDX7Nczt2+6RFKHhXReMs7ZTxshtpYA7icyTCIlIP88nGLIk/ju34xQJTVm/S33bByL4evnI1wfes= 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 1616164461490163.005875345631; Fri, 19 Mar 2021 07:34:21 -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-412-q9y280V7OaGC6TBTdt9_lA-1; Fri, 19 Mar 2021 10:34:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A11CE81626; Fri, 19 Mar 2021 14:34:12 +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 7E38F5C3E6; Fri, 19 Mar 2021 14:34:12 +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 3AA1C180C5AA; Fri, 19 Mar 2021 14:34:12 +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 12JEXsQ3027542 for ; Fri, 19 Mar 2021 10:33:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1D145D72F; Fri, 19 Mar 2021 14:33:54 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 288CD5D72E for ; Fri, 19 Mar 2021 14:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164460; 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=MZCh25WLkLiRwWAmkNCZ2Mad8E13XvdFqlLpi84z+mw=; b=YlpthrPvP/FNZA4ifjqpfhW9W1cv9r4va/4x/cTd7y4pmfh9tR4K6Rh92C7IMmgsZcnfgp SrQ9sHYd0RyKlFggxzDleKLLznpX3kRX2Z0DCzLS3wNK/1QBKrr7Htn5Mft8pxl8k4R0Kw kQ2TbUdW4CtdIfdr4tkYm2nDMjnl1oQ= X-MC-Unique: q9y280V7OaGC6TBTdt9_lA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v4 05/13] qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps Date: Fri, 19 Mar 2021 15:33:36 +0100 Message-Id: <448699109cf707687c3b35bfc35227423a98d6ed.1616164286.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.16 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 5717f7b98d..b60f297331 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 5a5a98d3e7..d26ea94803 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3017,21 +3017,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 c812aa9cc3..9106f966da 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