From nobody Mon Feb 9 05:20:01 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=1609941908; cv=none; d=zohomail.com; s=zohoarc; b=HY11muNBErZAaB+n3l0zwIpJ7+Eq8mw/uOo04OYkdKsDTaJQfg98wOf19axTXwZeJjJpWSywIJ1djIWTbn5CXIR/Hk8XORMHPd0YkEAaa7FjVppcvF/ow/HcJpC0Bv2pCJbJxS82/76zM8/1yuygxCwID8QoxAI8GtITmnks+nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609941908; 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=ndfLO9CnMBFN8mgnaUsX9io36x2I6ENcIFqhPWKLffo=; b=NwiS92kXsWCzIZazALLFFhcFtKUTOpQNqUQzuIPQ7aAQLTcEpJutaiAFWl9rmcXO7dckIjeKw8BxfSxjWcwkTQhHWRUldzvDLSWCkbEgF2eG109l/JVLhTrj1Ssst9jcHg1qmsfyddlIKWoE1eIVD+sCN1dCh9lQAudRqFQ7fLs= 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 1609941908953818.3959970821231; Wed, 6 Jan 2021 06:05:08 -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-555-J2PvbN05NrC3JFZtPj0SwA-1; Wed, 06 Jan 2021 09:04:18 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61949803646; Wed, 6 Jan 2021 14:04:10 +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 39D0210016FA; Wed, 6 Jan 2021 14:04:10 +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 01C3950032; Wed, 6 Jan 2021 14:04:10 +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 106E3s7A031374 for ; Wed, 6 Jan 2021 09:03:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id D7FC837A0; Wed, 6 Jan 2021 14:03:54 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21A6762467 for ; Wed, 6 Jan 2021 14:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609941908; 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=ndfLO9CnMBFN8mgnaUsX9io36x2I6ENcIFqhPWKLffo=; b=H38lfdec4Pz6vqUYtqV7tjnzbSOVBEAifrJMbEQ/XIc+p3VJYRhGJ7sacge0SIKmvpHR4Y Maz8m8VqsHkSHXnMt5Yu0arkjJlBFxocdwRREpWJS8KesW8avZvSrp0kdPfK5JBAL7ZOo1 5dj8mD4HCIOek70LS85knQ5jiNSaXEw= X-MC-Unique: J2PvbN05NrC3JFZtPj0SwA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/12] qemuMonitorJSONAddObject: Take double pointer for @props Date: Wed, 6 Jan 2021 15:03:36 +0100 Message-Id: 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.84 on 10.5.11.22 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" Prepare for a refactor of qemuMonitorJSONMakeCommandInternal. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 +-- src/qemu/qemu_monitor_json.c | 5 +++-- src/qemu/qemu_monitor_json.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8b1f90b363..a55c4e19dd 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3076,8 +3076,7 @@ qemuMonitorAddObject(qemuMonitorPtr mon, if (alias) tmp =3D g_strdup(id); - ret =3D qemuMonitorJSONAddObject(mon, *props); - *props =3D NULL; + ret =3D qemuMonitorJSONAddObject(mon, props); if (alias) *alias =3D g_steal_pointer(&tmp); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index cb31df3019..9116a8a8cb 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4593,12 +4593,13 @@ qemuMonitorJSONAddDevice(qemuMonitorPtr mon, int qemuMonitorJSONAddObject(qemuMonitorPtr mon, - virJSONValuePtr props) + virJSONValuePtr *props) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; + virJSONValuePtr pr =3D g_steal_pointer(props); - if (!(cmd =3D qemuMonitorJSONMakeCommandInternal("object-add", props))) + if (!(cmd =3D qemuMonitorJSONMakeCommandInternal("object-add", pr))) return -1; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4a5292a69c..ba1531fee8 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -244,7 +244,7 @@ int qemuMonitorJSONDelDevice(qemuMonitorPtr mon, const char *devalias); int qemuMonitorJSONAddObject(qemuMonitorPtr mon, - virJSONValuePtr props); + virJSONValuePtr *props); int qemuMonitorJSONDelObject(qemuMonitorPtr mon, const char *objalias, --=20 2.29.2