From nobody Tue Feb 10 15:29:48 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=1622043689; cv=none; d=zohomail.com; s=zohoarc; b=OjtW7DVXRvfZn08ontilQHLwbAiErPKQECU0hS5fppMSk2V0b2Hp9ZsU67GA9CLJkZaWQxA6qsAWPpKwqKULrdM02cFTovgRwxiCqdDTHOPqt9a5kzfLoCG4Tw6yZjyvbDw9x7+Tq0qTQDCXOYSfhaDiUxZB85RG39hAB0pWuzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622043689; 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=WZitDH2XpHP99ODzkC0ipitBRGA8VJzktOcAyoEgvu0=; b=Q7JO4oyGDfu8Typm6FRDM9AmS2CBbNBlKEVt4jKafmJ5y6WhaQQ5a1IXWf6qjJ7bQkBvCJQbFwXxP6FzS2gn/XrkMrZIsHmRbs9jyZ3tJT5yOx0DUcs63keX+8wV84EmvxQFbVOtkOCNeCjeJUYMp4G1wTUhRrhF69tWxkhAT7k= 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 162204368932253.517642923509015; Wed, 26 May 2021 08:41:29 -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-107-tUWm2bXmPjep4MPBxFsCBA-1; Wed, 26 May 2021 11:41:23 -0400 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 ABA59501F6; Wed, 26 May 2021 15:41:17 +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 7B13C100AE43; Wed, 26 May 2021 15:41:17 +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 3F050180B464; Wed, 26 May 2021 15:41:17 +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 14QFeWEm005252 for ; Wed, 26 May 2021 11:40:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3C1B101E5AF; Wed, 26 May 2021 15:40:31 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-112-47.phx2.redhat.com [10.3.112.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC7B3100AE43 for ; Wed, 26 May 2021 15:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622043686; 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=WZitDH2XpHP99ODzkC0ipitBRGA8VJzktOcAyoEgvu0=; b=aTEyS49KzTI0C5vprYXzc4ua4tqZpqeu0j2gxtlP4Jhz/6/Dy9z7Pjy7HDBXOxsmGWy6HP Pr3ZUoajosWTZQDJIUgpvXOu/AGn9RIIVMHXRGoDq2Eq7o5CwTY/M5REJC1E2oTKGp8kav bT5RNrOTz142cM4ePI+yyUL1rclMpvE= X-MC-Unique: tUWm2bXmPjep4MPBxFsCBA-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] nodedev: Revert auto-start property for mdevs Date: Wed, 26 May 2021 10:40:26 -0500 Message-Id: <20210526154026.280665-3-jjongsma@redhat.com> In-Reply-To: <20210526154026.280665-1-jjongsma@redhat.com> References: <20210526154026.280665-1-jjongsma@redhat.com> 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.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" We supported autostart of node devices via an xml element, but this is not consistent with other libvirt objects which use an explicit API for setting autostart status. So revert this and implement it as an official API in a future commit. The initial support was refactored after merging, so this commit reverts both of those previous commits. Revert "virNodeDevCapMdevParseXML: Use virXMLPropEnum() for ./start/@type" This reverts commit 9d4cd1d1cda84aa15b77a506f2ad6362a74edf1a. Revert "nodedev: support auto-start property for mdevs" This reverts commit 42a558549935336cbdb7cbfe8b239ffb0e3442e3. Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/formatnode.html.in | 10 --------- docs/schemas/nodedev.rng | 11 ---------- src/conf/node_device_conf.c | 21 +------------------ src/conf/node_device_conf.h | 12 ----------- src/libvirt_private.syms | 2 -- src/node_device/node_device_driver.c | 7 +------ .../mdevctl-list-multiple.out.xml | 4 ---- ...v_3627463d_b7f0_4fea_b468_f1da537d301b.xml | 10 +-------- ...v_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml | 11 +--------- 9 files changed, 4 insertions(+), 84 deletions(-) mode change 100644 =3D> 120000 tests/nodedevxml2xmlout/mdev_3627463d_b7f0_= 4fea_b468_f1da537d301b.xml mode change 100644 =3D> 120000 tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_= 4dc1_809d_b2a01e8e48ad.xml diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in index 9a505f0fe9..3b3c3105d4 100644 --- a/docs/formatnode.html.in +++ b/docs/formatnode.html.in @@ -388,16 +388,6 @@
This element represents the UUID of the mediated device.
-
start
-
- This element represents the start policy for the device. = It - has a required attribute type, which can have= a - value of auto or manual. Mediated - devices with an auto start type will be start= ed - automatically by the host when the parent device becomes - available (either on boot, or when the parent device is - attached). Otherwise the device must be started manually. -
ccw
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index 660cbda3be..777227c38a 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -622,17 +622,6 @@ - - - - - manual - auto - - - - - diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index af72e160a5..332b12f997 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -85,12 +85,6 @@ VIR_ENUM_IMPL(virNodeDevDRM, "render", ); =20 -VIR_ENUM_IMPL(virNodeDevMdevStart, - VIR_NODE_DEV_MDEV_START_LAST, - "manual", - "auto", -); - static int virNodeDevCapsDefParseString(const char *xpath, xmlXPathContextPtr ctxt, @@ -534,8 +528,6 @@ virNodeDeviceCapMdevDefFormat(virBuffer *buf, =20 virBufferEscapeString(buf, "\n", data->mdev.type); virBufferEscapeString(buf, "%s\n", data->mdev.uuid); - virBufferEscapeString(buf, "\n", - virNodeDevMdevStartTypeToString(data->mdev.start= )); virBufferAsprintf(buf, "\n", data->mdev.iommuGroupNumber); =20 @@ -1157,6 +1149,7 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, return -1; } storage->removable_media_size =3D val; + ctxt->node =3D orignode2; } else { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1919,7 +1912,6 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *attrs =3D NULL; size_t i; g_autofree char *uuidstr =3D NULL; - xmlNodePtr startNode =3D NULL; =20 ctxt->node =3D node; =20 @@ -1941,17 +1933,6 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, virUUIDFormat(uuidbuf, mdev->uuid); } =20 - mdev->start =3D VIR_NODE_DEV_MDEV_START_MANUAL; - - startNode =3D virXPathNode("./start[1]", ctxt); - if (startNode && - virXMLPropEnumDefault(startNode, "type", - virNodeDevMdevStartTypeFromString, - VIR_XML_PROP_NONE, &mdev->start, - VIR_NODE_DEV_MDEV_START_MANUAL) < 0) { - return -1; - } - /* 'iommuGroup' is optional, only report an error if the supplied valu= e is * invalid (-2), not if it's missing (-1) */ if (virXPathUInt("number(./iommuGroup[1]/@number)", diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 1a31133c4c..a60562e4fe 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -124,17 +124,6 @@ typedef enum { =20 VIR_ENUM_DECL(virNodeDevDRM); =20 -typedef enum { - /* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */ - VIR_NODE_DEV_MDEV_START_MANUAL, - VIR_NODE_DEV_MDEV_START_AUTO, - - VIR_NODE_DEV_MDEV_START_LAST -} virNodeDevMdevStartType; - -VIR_ENUM_DECL(virNodeDevMdevStart); - - typedef struct _virNodeDevCapSystemHardware virNodeDevCapSystemHardware; struct _virNodeDevCapSystemHardware { char *vendor_name; @@ -162,7 +151,6 @@ struct _virNodeDevCapMdev { char *type; unsigned int iommuGroupNumber; char *uuid; - virNodeDevMdevStartType start; virMediatedDeviceAttr **attributes; size_t nattributes; }; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 333cca0b41..0ced2a7990 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -848,8 +848,6 @@ virNodeDeviceGetSCSIHostCaps; virNodeDeviceGetSCSITargetCaps; virNodeDeviceGetWWNs; virNodeDeviceUpdateCaps; -virNodeDevMdevStartTypeFromString; -virNodeDevMdevStartTypeToString; =20 =20 # conf/node_device_event.h diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index a9f605715b..8a0a2c3847 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -615,8 +615,7 @@ nodeDeviceDefToMdevctlConfig(virNodeDeviceDef *def, cha= r **buf) if (virJSONValueObjectAppendString(json, "mdev_type", mdev->type) < 0) return -1; =20 - if (virJSONValueObjectAppendString(json, "start", - virNodeDevMdevStartTypeToString(mde= v->start)) < 0) + if (virJSONValueObjectAppendString(json, "start", "manual") < 0) return -1; =20 if (mdev->attributes) { @@ -1015,8 +1014,6 @@ nodeDeviceParseMdevctlChildDevice(const char *parent, mdev->uuid =3D g_strdup(uuid); mdev->type =3D g_strdup(virJSONValueObjectGetString(props, "mdev_type")); - mdev->start =3D - virNodeDevMdevStartTypeFromString(virJSONValueObjectGetString(prop= s, "start")); =20 attrs =3D virJSONValueObjectGet(props, "attrs"); =20 @@ -1686,8 +1683,6 @@ nodeDeviceDefCopyFromMdevctl(virNodeDeviceDef *dst, dstmdev->uuid =3D g_strdup(srcmdev->uuid); } =20 - dstmdev->start =3D srcmdev->start; - if (virMediatedDeviceAttrsCopy(dstmdev, srcmdev)) ret =3D true; =20 diff --git a/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml b/tests= /nodedevmdevctldata/mdevctl-list-multiple.out.xml index 83a3010455..cf7e966256 100644 --- a/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml +++ b/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml @@ -4,7 +4,6 @@ 200f228a-c80a-4d50-bfb7-f5a0e4e34045 - @@ -14,7 +13,6 @@ de807ffc-1923-4d5f-b6c9-b20ecebc6d4b - @@ -24,7 +22,6 @@ 435722ea-5f43-468a-874f-da34f1217f13 - @@ -35,7 +32,6 @@ 783e6dbb-ea0e-411f-94e2-717eaad438bf - diff --git a/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d3= 01b.xml b/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d301b= .xml deleted file mode 100644 index 30dda60e87..0000000000 --- a/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml +++ /dev/null @@ -1,9 +0,0 @@ - - mdev_3627463d_b7f0_4fea_b468_f1da537d301b - computer - - - - - - diff --git a/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d3= 01b.xml b/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d301b= .xml new file mode 120000 index 0000000000..cbc883e48c --- /dev/null +++ b/tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml @@ -0,0 +1 @@ +../nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml \ No newline at end of file diff --git a/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e4= 8ad.xml b/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad= .xml deleted file mode 100644 index 1988ffa679..0000000000 --- a/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml +++ /dev/null @@ -1,10 +0,0 @@ - - mdev_ee0b88c4-f554-4dc1-809d-b2a01e8e48ad - /sys/devices/vfio_ap/matrix/mdev_ee0b88c4-f554-4dc1-809d-b2a01e8e4= 8ad - ap_matrix - - - - - - diff --git a/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e4= 8ad.xml b/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad= .xml new file mode 120000 index 0000000000..238bfb4dfd --- /dev/null +++ b/tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml @@ -0,0 +1 @@ +../nodedevschemadata/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml \ No newline at end of file --=20 2.31.1