From nobody Tue May 14 10:17:14 2024 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=1647948460; cv=none; d=zohomail.com; s=zohoarc; b=BqV9Npgf7jOUUZ7eiLQtTnr9dv+G4PVbs6N11BMV1MV8LG71x+jnATI1hR1VzyX0YdS5GG7I2CUK6sjp8JIwrfUGquTZyJ8YiBgwo0bgTfJh3vnYAra5DHAXMGsUCMREDYWX8NkZgxEllLRi48rPRwW2pIqi5PRRsFd06VBp+kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647948460; 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=NqouPaONSrYYurlUZne5KNJIzF38Bbd+DQTTjPGeIvU=; b=FfvD2jS1ECrpWirqIOAQaCkmrqoP3u/h3r/pJ4IvClStodPLd+KSd15LWOQr7d8apXcwP0I7GX4pTDkOyLIIVqXcG2kqTu4TylJZsf+VlUgU0BJ+8g1SpRjTJjgbSTKX9ztTsj4r+mMpWgJGK6ny5UrpbvrgWN51lBLgV9wkxIE= 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 1647948460939146.36037917894544; Tue, 22 Mar 2022 04:27:40 -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-153-FrToqBPGOFOgLjIW3qtPhA-1; Tue, 22 Mar 2022 07:27:36 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 36D0B85A5A8; Tue, 22 Mar 2022 11:27:34 +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 21F2D46516D; Tue, 22 Mar 2022 11:27:34 +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 E03991940351; Tue, 22 Mar 2022 11:27:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5465F1947BBC for ; Tue, 22 Mar 2022 11:27:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 492871121324; Tue, 22 Mar 2022 11:27:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id C855E1121314 for ; Tue, 22 Mar 2022 11:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647948459; 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=NqouPaONSrYYurlUZne5KNJIzF38Bbd+DQTTjPGeIvU=; b=CI39q1Gg0pA8Wcd2jFIrcZgnk1de7G3CT36YJmj0bQ27ycUcRMsd6BxFFBzlKXJY25jgYe xpU/5yIK54Ove2CD9+l8O0bJlMkobTTl+zLlAL43gLGMHrL91m4JkiAPC8xKsJHEEO3mX3 mIb3UPw/hO/XZyYbupiQSJE3P5AR5ng= X-MC-Unique: FrToqBPGOFOgLjIW3qtPhA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 1/6] docs: drvqemu: Document overriding of device properties Date: Tue, 22 Mar 2022 12:27:20 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.9 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: 1647948461707100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Upcoming patches will add possibility to override configuration of a device with custom properties as a more versatile replacement to using QEMU's '-set' parameter, which doesn't work when we use JSON to instantiate devices. Describe the XML used for the override as well as expectations of upstream support in case something breaks. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- docs/drvqemu.rst | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/docs/drvqemu.rst b/docs/drvqemu.rst index 9d7dd2656b..afc499ad50 100644 --- a/docs/drvqemu.rst +++ b/docs/drvqemu.rst @@ -580,6 +580,63 @@ reconfigure libvirtd. *DO NOT* use in production. +Overriding properties of QEMU devices +------------------------------------- + +For development or testing the ```` tag allows to override +specific properties of devices instantiated by libvirt. + +The ```` sub-element groups overrides for a device identified= via +the ``alias`` attribute. The alias corresponds to the ```` +property of a device. It's strongly recommended to use user-specified alia= ses +for devices with overriden properties. + +Sub element ```` encapsulates all overrides of properties f= or the +device frontend and overrides what libvirt formats via ``-device``. +:since:`Since 8.2.0`. + +The individual properties are overriden by a ```` element. = The +``name`` specifies the name of the property to override. In case when libv= irt +doesn't configure the property a property with the name is added to the +commandline. The ``type`` attribute specifies a type of the argument used.= The +type must correspond with the type that is expected by QEMU. Supported val= ues +for the type attribute are: ``string``, ``number``, ``bool`` (allowed valu= es for +``bool`` are ``true`` and ``false``) and ``remove``. The ``remove`` type is +special and instructs libvirt to remove the property without replacement. + +The overrides are applied only to initial device configuration passed to Q= EMU +via the commandline. Later hotplug operations will not apply any modificat= ions. + +Configuring override for a device alias which is not used or attempting to +remove a device property which is not formatted by libvirt will cause fail= ure +to startup the VM. + +*Note:* The libvirt project doesn't guarantee any form of compatibility and +stability of devices with overriden properties. The domain is tainted when +such configuration is used. + +Example: + +:: + + + testvm + + [...] + + + + + + + + + + + + + + Example domain XML config ------------------------- --=20 2.35.1 From nobody Tue May 14 10:17:14 2024 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=1647948483; cv=none; d=zohomail.com; s=zohoarc; b=OQzqo8UmsDiLnxdZBd6dRbPXMq0AD9sqPgtMKzsXl4HSGZjXkctSw2M281s0Qno+alvVfdYsryTP9lnB8QfDPqmgwFzGpFnrlk+YHlYocsw8I9zerP4swhtzeHc78udA65WSei99NKTkGccBrSj9HV7LnlVtM31U5dEkK7MviNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647948483; 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=F0otabheccHhVTnrqkjSG21IO/sby1Xw5PGWK5xfFPk=; b=Hj/Ys2mHWtC4+GY+xLMLBP8DGy3c6tgWxjMbCHjxCTRiYY//4Gaf3BHgvy+t2oek9t/GR9ch+okfek4lJY6U8gyCBAKcgXe6mZxMPDk0Ggkkoj14x9HIorYXIV2Pv9b410pDYZ0U7hScCATOH3NgiSW1ospx+idKphG1LjdYkHU= 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 1647948483002645.8331548828136; Tue, 22 Mar 2022 04:28:03 -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-153-_WmsCaO9MPGVCNWkriG9Kg-1; Tue, 22 Mar 2022 07:27:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3B87F85A5BC; Tue, 22 Mar 2022 11:27:34 +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 2307040CF900; Tue, 22 Mar 2022 11:27:34 +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 C173B1949762; Tue, 22 Mar 2022 11:27:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 828401947BBC for ; Tue, 22 Mar 2022 11:27:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 672181121324; Tue, 22 Mar 2022 11:27:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id A83341121314 for ; Tue, 22 Mar 2022 11:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647948482; 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=F0otabheccHhVTnrqkjSG21IO/sby1Xw5PGWK5xfFPk=; b=eti8Y/M3oDmuy1fEgMyYtBCOR6FfaxpHka28V+jhKXcUZKzEL97H9pkVMns9RYV5469oC4 GyGvMWeq1zis1SyBJW70834gJvN44QAxfREqS34n0TvxrJlpi2rgn97tdu4UzI6giTtwoE f9ALGmUFhhgIIxVesWN+iLmfZv2tbFw= X-MC-Unique: _WmsCaO9MPGVCNWkriG9Kg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 2/6] qemu: domain: Add XML namespace code for overriding device config Date: Tue, 22 Mar 2022 12:27:21 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.84 on 10.11.54.1 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: 1647948483877100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Implement the XML parser and formatter for overriding of device properties such as: Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/conf/schemas/domaincommon.rng | 42 ++++ src/qemu/qemu_domain.c | 218 ++++++++++++++++++ src/qemu/qemu_domain.h | 33 +++ .../qemu-ns.x86_64-4.0.0.args | 2 +- .../qemu-ns.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/qemu-ns.xml | 14 ++ .../qemu-ns.x86_64-latest.xml | 14 ++ 7 files changed, 323 insertions(+), 2 deletions(-) diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 9c1b64a644..8ca6bee81f 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -80,6 +80,9 @@ + + + @@ -7553,6 +7556,45 @@ + + + + + + string + signed + unsigned + bool + remove + + + + + + + + + + + + + + + + + + + + + + + + + + + + +