From nobody Mon Feb 9 09:15:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1633622651; cv=none; d=zohomail.com; s=zohoarc; b=PMrJ0xbyqUEzNVHQXzE4POPw8LdrBh3v9lLpDzeUSSAkAHc7NwdthQMtUi5Uv40aaHpbZ9DBoH+GZ9u6zKVUv7cn3FXJTWzK5DK11DMjS6LXSZlTpuhJQ+1ZsrCOt9dsnmkTMH/7M8lJof87sv5aEPd8AVljKB4hktCWSOAwuPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633622651; 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=jNsp7lf0BB3HgPhMgkx82CeKqlM+I2l5FwCqOLlDmtI=; b=IbkVb0wpR2A0jCX52LXRO8nKinDLERN+b1DLV72cNR67cFzh3oPO0AnSBu0kglbD0YUXLkusDvpyIZGcTUHnuF8VL/g1O7LaLEbE+0sKhriltHj22QpWeksWNvEsNP8hdbYukCn82i6f0t2e+Ra/xONrms15H9EJSnHHZc7HCYs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1633622651087113.3974084791347; Thu, 7 Oct 2021 09:04:11 -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-522-1tIJMqJDNeSS0i525wuZOw-1; Thu, 07 Oct 2021 12:04:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3CF38120025F; Thu, 7 Oct 2021 15:46:41 +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 1325B43E437; Thu, 7 Oct 2021 15:46:41 +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 8C94E1806D00; Thu, 7 Oct 2021 15:46:40 +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 197FIgk6023572 for ; Thu, 7 Oct 2021 11:18:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id EE6185D740; Thu, 7 Oct 2021 15:18:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E7F15D6BA for ; Thu, 7 Oct 2021 15:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633622650; 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=jNsp7lf0BB3HgPhMgkx82CeKqlM+I2l5FwCqOLlDmtI=; b=FRMfwGla2hxnALGwHp9buYm9xY62HRPRZGntmMhIahdNQLpCgSVQaXflUvILgfLN/CNz5y +5SB6pnCpl3mD3DSjpwLdI1UqdzSeq3K+4ff1G1AtnKVW+IJBLYV6MA4opPhJ9Xe1XbCXD RzfQTd+atXZXhGSF9L94XuPA5wVwlhs= X-MC-Unique: 1tIJMqJDNeSS0i525wuZOw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 009/103] qemuBuildObjectCommandlineFromJSON: Remove checks for 'type' and 'alias' Date: Thu, 7 Oct 2021 17:16:57 +0200 Message-Id: <7b2e8634e0c6510f4f16aa197bcab7370925e41d.1633619630.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.14 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) X-ZM-MESSAGEID: 1633622652429100003 Content-Type: text/plain; charset="utf-8" We validate the generated props agains the QMP schema which makes sure that the objects are generated properly. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1a946d895d..f82768d5b1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -161,20 +161,12 @@ qemuBuildObjectCommandlineFromJSON(virCommand *cmd, virQEMUCaps *qemuCaps) { g_autofree char *arg =3D NULL; - const char *type =3D virJSONValueObjectGetString(props, "qom-type"); - const char *alias =3D virJSONValueObjectGetString(props, "id"); - - if (!type || !alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("missing 'type'(%s) or 'alias'(%s) field of QOM '= object'"), - NULLSTR(type), NULLSTR(alias)); - return -1; - } if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_JSON)) { if (!(arg =3D virJSONValueToString(props, false))) return -1; } else { + const char *type =3D virJSONValueObjectGetString(props, "qom-type"= ); g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; virBufferAsprintf(&buf, "%s,", type); --=20 2.31.1