From nobody Mon Feb 9 06:48:56 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=1614182337; cv=none; d=zohomail.com; s=zohoarc; b=GMrLhGacrP2I1J7z2+DfyZBwp0j7MyDUcz5NiU5aFAokv4aUbjK2ZHTvecNHU22NH7GtT5x/S4NrO+2Ga2zzLFCqOvbpbkiP1pP6tIZo+X9CVGHq+Pqd7T03nxYrKnRmykIjZMweMBbHGWnBEvMZiHLnCL3Ak6bzIixhKW+krKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614182337; 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=SUjn/cLsERXqOrfp8yzRbkD4YISopPPGPWAN0B8hc3E=; b=lER5Q6/onkL2/EhyctbDlCzp63msOIA9Et2y+DDL0fTmWPUMyVfjoBwZgOUXpOKsKEWpVh9F79321XZjm9wtEUjKED3909UBbaJlNxK2iYyE6D/+aNAmG+h5C60IqcEUQGFT7pZGQo2mtWx6qy1QDn/oeloxvHMYpBpOJiJ95ls= 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 1614182337824305.22016997204537; Wed, 24 Feb 2021 07:58:57 -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-515-C79MEo1oOliWY1ao9XY2tQ-1; Wed, 24 Feb 2021 10:58:51 -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 D098B801977; Wed, 24 Feb 2021 15:58:42 +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 AC7C760BF3; Wed, 24 Feb 2021 15:58:42 +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 731741809C8F; Wed, 24 Feb 2021 15:58:42 +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 11OFwD50010714 for ; Wed, 24 Feb 2021 10:58:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id F08EB1001E73; Wed, 24 Feb 2021 15:58:13 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B76D10016F9 for ; Wed, 24 Feb 2021 15:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614182336; 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=SUjn/cLsERXqOrfp8yzRbkD4YISopPPGPWAN0B8hc3E=; b=Nv1D+/iyZC+TI/av3B+kRIb/LxOJogLxQWxxwe1WHXf0XU8N18Xq3RJZu3axbaYUPbgTxP zELdXzzjhXmFWZghkVNvxyuyqFuBtMYJ7AJtLukPpt6iFG0FYKASZuc3Uot7+DXMxZETm9 wd+C2CT12jseB9bkZMHe2unRpQfiH0Q= X-MC-Unique: C79MEo1oOliWY1ao9XY2tQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 03/12] qemu: command: Generate commandline of iothread objects JSON Date: Wed, 24 Feb 2021 16:57:57 +0100 Message-Id: <81a77bdf7b5472a199f3df25b353d1a8bbea89f3.1614182040.git.pkrempa@redhat.com> 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" The commandline generator for 'iothread' objects has a private implementation of the properties. Convert it to JSON so that it can be later validated. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 579b00c029..7bdcdab95a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7228,15 +7228,19 @@ qemuBuildIOThreadCommandLine(virCommandPtr cmd, if (def->niothreadids =3D=3D 0) return 0; - /* Create iothread objects using the defined iothreadids list - * and the defined id and name from the list. These may be used - * by a disk definition which will associate to an iothread by - * supplying a value of an id from the list - */ for (i =3D 0; i < def->niothreadids; i++) { + g_autoptr(virJSONValue) props =3D NULL; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *alias =3D g_strdup_printf("iothread%u", def->ioth= readids[i]->iothread_id); + + if (qemuMonitorCreateObjectProps(&props, "iothread", alias, NULL) = < 0) + return -1; + + if (virQEMUBuildObjectCommandlineFromJSON(&buf, props) < 0) + return -1; + virCommandAddArg(cmd, "-object"); - virCommandAddArgFormat(cmd, "iothread,id=3Diothread%u", - def->iothreadids[i]->iothread_id); + virCommandAddArgBuffer(cmd, &buf); } return 0; --=20 2.29.2