From nobody Sun Feb 8 19:35:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1647876294; cv=none; d=zohomail.com; s=zohoarc; b=Cg8LXG4LBqdOYTxXJheNfoh3bivjxvX6igvfneXwL0B/xFA3S90iu6YUOhzHLKR5M7MQ6WLfLlynrr1dQt1UaoK0T2FM+LfedR3h6sXH4OZvVGyMSli9AAbBW7IMAveFCRPs18jU5I39hdk0ioUDbyHkkhN878GqlNUz6GGtF90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647876294; 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=5y/oa0+L8TSbfTiQ4kLqsmP7kCJ56ZXejRbDEtPbyao=; b=Z6qRIZIEuLeim1s74TuWekkd1RVZIzwgv26oOmqFK3Ds37srxFByJgqVW7EpEjE46m2iXBfQ8jWKvHqv1lDXdKog4voG2B5JKOrgy+Yw9/u8PEmtjATgqQDP0yKJByI1EG/LkwexHV++47b8SANcaom1cVEnQvs79Kt7cTAoeuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1647876294293790.4597064978343; Mon, 21 Mar 2022 08:24:54 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-65-X-NJoXchMSyYM5Bt2CoOcw-1; Mon, 21 Mar 2022 11:24:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F7498087BA; Mon, 21 Mar 2022 15:24:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 769B1C23DD4; Mon, 21 Mar 2022 15:24:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2D66D1940347; Mon, 21 Mar 2022 15:24:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 669051940359 for ; Mon, 21 Mar 2022 15:24:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4BAC341D3FF; Mon, 21 Mar 2022 15:24:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91B1841D3ED for ; Mon, 21 Mar 2022 15:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647876293; 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=5y/oa0+L8TSbfTiQ4kLqsmP7kCJ56ZXejRbDEtPbyao=; b=eAJZpz6F3uHNYR3fqFpvUVv3A0Fca4/e3pMe8HIbmVYomxuNWQ+2GIem/HRAs0AuYrmHJj kPh4BjmWtJM3QEFJCXO8ymlOXCNvVbwg749Cpj7bnGwJ+wYPFnTzztHXnPD38d4SnZWNfh K141BaJnwVhjAadFXrSN3Hotl6z7xig= X-MC-Unique: X-NJoXchMSyYM5Bt2CoOcw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] qemuBuildDeviceCommandlineFromJSON: Pass 'virDomainDef' into the function Date: Mon, 21 Mar 2022 16:24:38 +0100 Message-Id: <2840dec189c39ee63235a22904533f50c564992b.1647876193.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: 1647876295003100001 Content-Type: text/plain; charset="utf-8" The definition object will be later used to access the qemu namespace definition used to override device properties. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 101 +++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c836799888..8af6179b5c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -235,6 +235,7 @@ qemuBuildNetdevCommandlineFromJSON(virCommand *cmd, static int qemuBuildDeviceCommandlineFromJSON(virCommand *cmd, virJSONValue *props, + const virDomainDef *def G_GNUC_UNUSED, virQEMUCaps *qemuCaps) { g_autofree char *arg =3D NULL; @@ -2327,6 +2328,7 @@ qemuBuildZPCIDevProps(virDomainDeviceInfo *dev) static int qemuCommandAddExtDevice(virCommand *cmd, virDomainDeviceInfo *dev, + const virDomainDef *def, virQEMUCaps *qemuCaps) { if (dev->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || @@ -2340,7 +2342,7 @@ qemuCommandAddExtDevice(virCommand *cmd, if (!(devprops =3D qemuBuildZPCIDevProps(dev))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < = 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCap= s) < 0) return -1; } @@ -2383,6 +2385,7 @@ qemuBuildFloppyCommandLineControllerOptionsExplicit(v= irCommand *cmd, unsigned int bootindex= B, const char *backendA, const char *backendB, + const virDomainDef *de= f, virQEMUCaps *qemuCaps) { g_autoptr(virJSONValue) props =3D NULL; @@ -2396,7 +2399,7 @@ qemuBuildFloppyCommandLineControllerOptionsExplicit(v= irCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -2447,6 +2450,7 @@ qemuBuildFloppyCommandLineControllerOptions(virComman= d *cmd, bootindexB, backendA, backendB, + def, qemuCaps) = < 0) return -1; } else { @@ -2596,13 +2600,13 @@ qemuBuildDiskCommandLine(virCommand *cmd, !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) return 0; - if (qemuCommandAddExtDevice(cmd, &disk->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &disk->info, def, qemuCaps) < 0) return -1; if (!(devprops =3D qemuBuildDiskDeviceProps(def, disk, qemuCaps))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) <= 0) return -1; return 0; @@ -2690,13 +2694,13 @@ qemuBuildVHostUserFsCommandLine(virCommand *cmd, if (qemuBuildChardevCommand(cmd, chrsrc, chardev_alias, priv->qemuCaps= ) < 0) return -1; - if (qemuCommandAddExtDevice(cmd, &fs->info, priv->qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &fs->info, def, priv->qemuCaps) < 0) return -1; if (!(devprops =3D qemuBuildVHostUserFsDevProps(fs, def, chardev_alias= , priv))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, priv->qemuCaps) = < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, priv->qemuC= aps) < 0) return -1; return 0; @@ -2773,7 +2777,7 @@ qemuBuildFSDevCmd(virCommand *cmd, if (qemuBuildDeviceAddressProps(devprops, def, &fs->info) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) <= 0) return -1; return 0; @@ -2793,7 +2797,7 @@ qemuBuildFSDevCommandLine(virCommand *cmd, return -1; virCommandAddArg(cmd, fsdevstr); - if (qemuCommandAddExtDevice(cmd, &fs->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &fs->info, def, qemuCaps) < 0) return -1; if (qemuBuildFSDevCmd(cmd, def, fs, qemuCaps) < 0) @@ -3421,10 +3425,10 @@ qemuBuildControllersByTypeCommandLine(virCommand *c= md, if (!props) continue; - if (qemuCommandAddExtDevice(cmd, &cont->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &cont->info, def, qemuCaps) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) = < 0) return -1; } @@ -4382,13 +4386,13 @@ qemuBuildWatchdogCommandLine(virCommand *cmd, if (!def->watchdog) return 0; - if (qemuCommandAddExtDevice(cmd, &def->watchdog->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &def->watchdog->info, def, qemuCaps) = < 0) return -1; if (!(props =3D qemuBuildWatchdogDevProps(def, watchdog))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps)) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps)) return -1; /* qemu doesn't have a 'dump' action; we tell qemu to 'pause', then @@ -4434,10 +4438,10 @@ qemuBuildMemballoonCommandLine(virCommand *cmd, if (qemuBuildDeviceAddressProps(props, def, &def->memballoon->info) < = 0) return -1; - if (qemuCommandAddExtDevice(cmd, &def->memballoon->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &def->memballoon->info, def, qemuCaps= ) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -4583,7 +4587,7 @@ qemuBuildInputCommandLine(virCommand *cmd, for (i =3D 0; i < def->ninputs; i++) { virDomainInputDef *input =3D def->inputs[i]; - if (qemuCommandAddExtDevice(cmd, &input->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &input->info, def, qemuCaps) < 0) return -1; if (input->type =3D=3D VIR_DOMAIN_INPUT_TYPE_EVDEV) { @@ -4616,7 +4620,7 @@ qemuBuildInputCommandLine(virCommand *cmd, } if (props && - qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) <= 0) + qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCa= ps) < 0) return -1; } } @@ -4687,7 +4691,7 @@ qemuBuildSoundDevCmd(virCommand *cmd, if (qemuBuildDeviceAddressProps(props, def, &sound->info) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -4720,7 +4724,7 @@ qemuBuildSoundCodecCmd(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -4743,7 +4747,7 @@ qemuBuildSoundCommandLine(virCommand *cmd, if (sound->model =3D=3D VIR_DOMAIN_SOUND_MODEL_PCSPK) { virCommandAddArgList(cmd, "-soundhw", "pcspk", NULL); } else { - if (qemuCommandAddExtDevice(cmd, &sound->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &sound->info, def, qemuCaps) = < 0) return -1; if (qemuBuildSoundDevCmd(cmd, def, sound, qemuCaps) < 0) @@ -4867,7 +4871,7 @@ qemuBuildDeviceVideoCmd(virCommand *cmd, if (qemuBuildDeviceAddressProps(props, def, &video->info) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -4905,7 +4909,7 @@ qemuBuildVideoCommandLine(virCommand *cmd, return -1; } - if (qemuCommandAddExtDevice(cmd, &def->videos[i]->info, priv->qemu= Caps) < 0) + if (qemuCommandAddExtDevice(cmd, &def->videos[i]->info, def, priv-= >qemuCaps) < 0) return -1; if (qemuBuildDeviceVideoCmd(cmd, def, video, priv->qemuCaps) < 0) @@ -5035,7 +5039,7 @@ qemuBuildHubDevCmd(virCommand *cmd, if (qemuBuildDeviceAddressProps(props, def, &dev->info) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -5360,7 +5364,7 @@ qemuBuildHostdevSCSICommandLine(virCommand *cmd, if (!(devprops =3D qemuBuildSCSIHostdevDevProps(def, hostdev, backendA= lias))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) <= 0) return -1; return 0; @@ -5391,7 +5395,7 @@ qemuBuildHostdevCommandLine(virCommand *cmd, if (!(devprops =3D qemuBuildUSBHostdevDevProps(def, hostdev, q= emuCaps))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps= ) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qem= uCaps) < 0) return -1; break; @@ -5401,13 +5405,13 @@ qemuBuildHostdevCommandLine(virCommand *cmd, if (hostdev->info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_U= NASSIGNED) continue; - if (qemuCommandAddExtDevice(cmd, hostdev->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, hostdev->info, def, qemuCaps)= < 0) return -1; if (!(devprops =3D qemuBuildPCIHostdevDevProps(def, hostdev))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps= ) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qem= uCaps) < 0) return -1; break; @@ -5436,7 +5440,7 @@ qemuBuildHostdevCommandLine(virCommand *cmd, vhostfd= Name))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemu= Caps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def,= qemuCaps) < 0) return -1; } @@ -5459,7 +5463,7 @@ qemuBuildHostdevCommandLine(virCommand *cmd, if (!(devprops =3D qemuBuildHostdevMediatedDevProps(def, hostd= ev))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps= ) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qem= uCaps) < 0) return -1; break; @@ -5732,13 +5736,13 @@ qemuBuildRNGCommandLine(virCommand *cmd, return -1; /* add the device */ - if (qemuCommandAddExtDevice(cmd, &rng->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &rng->info, def, qemuCaps) < 0) return -1; if (!(devprops =3D qemuBuildRNGDevProps(def, rng, qemuCaps))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < = 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCap= s) < 0) return -1; } @@ -6078,7 +6082,7 @@ qemuBuildVMGenIDCommandLine(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -6404,7 +6408,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) = < 0) return -1; return 0; @@ -7730,7 +7734,7 @@ qemuBuildMemoryDeviceCommandLine(virCommand *cmd, if (!(props =3D qemuBuildMemoryDeviceProps(cfg, priv, def, def->me= ms[i]))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, priv->qemuCaps)= < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, priv->qemu= Caps) < 0) return -1; } @@ -8884,15 +8888,15 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver, * New way: -netdev type=3Dtap,id=3Dnetdev1 -device e1000,id=3Dnetde= v1 */ if (qemuDomainSupportsNicdev(def, net)) { - if (qemuCommandAddExtDevice(cmd, &net->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &net->info, def, qemuCaps) < 0) goto cleanup; if (!(nicprops =3D qemuBuildNicDevProps(def, net, net->driver.virt= io.queues, qemuCaps))) goto cleanup; - if (qemuBuildDeviceCommandlineFromJSON(cmd, nicprops, qemuCaps) < = 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, nicprops, def, qemuCap= s) < 0) goto cleanup; } else if (!requireNicdev) { - if (qemuCommandAddExtDevice(cmd, &net->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &net->info, def, qemuCaps) < 0) goto cleanup; if (!(nic =3D qemuBuildLegacyNicStr(net))) @@ -9055,7 +9059,7 @@ qemuBuildSmartcardCommandLine(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -9225,10 +9229,10 @@ qemuBuildShmemCommandLine(virCommand *cmd, if (!devProps) return -1; - if (qemuCommandAddExtDevice(cmd, &shmem->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &shmem->info, def, qemuCaps) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devProps, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devProps, def, qemuCaps) <= 0) return -1; if (shmem->server.enabled) { @@ -9285,7 +9289,7 @@ qemuBuildChrDeviceCommandLine(virCommand *cmd, if (!(props =3D qemuBuildChrDeviceProps(def, chr, qemuCaps))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -9569,7 +9573,7 @@ qemuBuildRedirdevCommandLine(virCommand *cmd, if (!(devprops =3D qemuBuildRedirdevDevProps(def, redirdev))) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < = 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCap= s) < 0) return -1; } @@ -9671,7 +9675,7 @@ qemuBuildTPMDevCmd(virCommand *cmd, if (qemuBuildDeviceAddressProps(props, def, &tpm->info) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -9792,6 +9796,7 @@ qemuBuildTPMCommandLine(virCommand *cmd, static int qemuBuildTPMProxyCommandLine(virCommand *cmd, virDomainTPMDef *tpm, + const virDomainDef *def, virQEMUCaps *qemuCaps) { g_autoptr(virJSONValue) props =3D NULL; @@ -9803,7 +9808,7 @@ qemuBuildTPMProxyCommandLine(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -9819,7 +9824,7 @@ qemuBuildTPMsCommandLine(virCommand *cmd, for (i =3D 0; i < def->ntpms; i++) { if (def->tpms[i]->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY) { - if (qemuBuildTPMProxyCommandLine(cmd, def->tpms[i], priv->qemu= Caps) < 0) + if (qemuBuildTPMProxyCommandLine(cmd, def->tpms[i], def, priv-= >qemuCaps) < 0) return -1; } else if (qemuBuildTPMCommandLine(cmd, def, def->tpms[i], priv) <= 0) { return -1; @@ -9921,7 +9926,7 @@ qemuBuildVMCoreInfoCommandLine(virCommand *cmd, NULL) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0) return -1; return 0; @@ -9954,7 +9959,7 @@ qemuBuildPanicCommandLine(virCommand *cmd, return -1; } - if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) <= 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCa= ps) < 0) return -1; break; @@ -10283,10 +10288,10 @@ qemuBuildVsockCommandLine(virCommand *cmd, virCommandPassFD(cmd, priv->vhostfd, VIR_COMMAND_PASS_FD_CLOSE_PARENT); priv->vhostfd =3D -1; - if (qemuCommandAddExtDevice(cmd, &vsock->info, qemuCaps) < 0) + if (qemuCommandAddExtDevice(cmd, &vsock->info, def, qemuCaps) < 0) return -1; - if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, qemuCaps) < 0) + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) <= 0) return -1; return 0; --=20 2.35.1