From nobody Tue Feb 10 13:16:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1614724306; cv=none; d=zohomail.com; s=zohoarc; b=kiKD3W/WYYGV4XRoNfKsNz8PmQWoDoitIlG8qwX5LHh47hZDe2AMiE9iU1l/nE+0m+ldIrda+McRehXSATJQ0kum72dzo6cOSG9DFJnXMl5hc3iYQLBHFkgIXQ2QGl3C0BLaqovI69se0BlSNkb6Xx664txZIGWrO8GEkEanK8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614724306; h=Content-Type:Content-Transfer-Encoding:Cc: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=4jBx0DcASNgP4mODK41GdRM+YUwM96eV25Ghp+9fkfQ=; b=cEW2vNPoMYwPiLJ7BPTEifG4EgvaQXMa3GIFtV+BnCoCJHlfwB9JoDxzXnO8VN3MeEMn/F6KctSL6PRKRoJl/GxQRffg8TcARWEBtGAmrgxJj/lJQxEBrOlHyWvLjwPNp1QFuQQXCPnxpexTOV5tNUUkR1+vqiiNRCOdLC33K6c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614724306850682.0857179776516; Tue, 2 Mar 2021 14:31:46 -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-478-7BayLQirMEaGFUPgw3v__Q-1; Tue, 02 Mar 2021 17:31:43 -0500 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 290A0C2A5; Tue, 2 Mar 2021 22:31:37 +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 EAF1D100AE2E; Tue, 2 Mar 2021 22:31:36 +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 B2BA218089D1; Tue, 2 Mar 2021 22:31:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122MVCBA007756 for ; Tue, 2 Mar 2021 17:31:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id D98E660C6C; Tue, 2 Mar 2021 22:31:12 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-115-28.phx2.redhat.com [10.3.115.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92FD460BFA; Tue, 2 Mar 2021 22:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614724305; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=4jBx0DcASNgP4mODK41GdRM+YUwM96eV25Ghp+9fkfQ=; b=Wb3D4/1Bv+bF4UKuK50AJx2CVLJgbeJKv9z/ILVDX5A62lvUSD1E0CnKcvBbOAG3lsqcDN aC3YSISzZKQ8rFdnyE9GwEMU+92n4mQ6zSIsZyP6rSIpGwNcC2RWz/OvTRseQgVkWwHR77 rE1Wc42PHGk7wANxAF2Nf+1JyR/nUhM= X-MC-Unique: 7BayLQirMEaGFUPgw3v__Q-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v5 09/30] nodedev: add persistence to virNodeDeviceObj Date: Tue, 2 Mar 2021 16:30:44 -0600 Message-Id: <20210302223105.314580-10-jjongsma@redhat.com> In-Reply-To: <20210302223105.314580-1-jjongsma@redhat.com> References: <20210302223105.314580-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: eskultet@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" Consistent with other objects (e.g. virDomainObj), add a field to indicate whether the node device is persistent or transient. Signed-off-by: Jonathon Jongsma --- src/conf/virnodedeviceobj.c | 16 ++++++++++++++++ src/conf/virnodedeviceobj.h | 6 ++++++ src/libvirt_private.syms | 2 ++ 3 files changed, 24 insertions(+) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index afcd9a46fd..f67940a696 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -40,6 +40,7 @@ struct _virNodeDeviceObj { bool skipUpdateCaps; /* whether to skip checking host c= aps, used by testdriver */ bool active; + bool persistent; }; =20 struct _virNodeDeviceObjList { @@ -1003,3 +1004,18 @@ virNodeDeviceObjSetActive(virNodeDeviceObjPtr obj, { obj->active =3D active; } + + +bool +virNodeDeviceObjIsPersistent(virNodeDeviceObjPtr obj) +{ + return obj->persistent; +} + + +void +virNodeDeviceObjSetPersistent(virNodeDeviceObjPtr obj, + bool persistent) +{ + obj->persistent =3D persistent; +} diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index c119f4c51f..43af012103 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -128,3 +128,9 @@ virNodeDeviceObjIsActive(virNodeDeviceObjPtr obj); void virNodeDeviceObjSetActive(virNodeDeviceObjPtr obj, bool active); +bool +virNodeDeviceObjIsPersistent(virNodeDeviceObjPtr obj); + +void +virNodeDeviceObjSetPersistent(virNodeDeviceObjPtr obj, + bool persistent); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 17461bcea0..5c8a44a750 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1266,6 +1266,7 @@ virNetworkPortDefSaveStatus; virNodeDeviceObjEndAPI; virNodeDeviceObjGetDef; virNodeDeviceObjIsActive; +virNodeDeviceObjIsPersistent; virNodeDeviceObjListAssignDef; virNodeDeviceObjListExport; virNodeDeviceObjListFindByName; @@ -1279,6 +1280,7 @@ virNodeDeviceObjListNew; virNodeDeviceObjListNumOfDevices; virNodeDeviceObjListRemove; virNodeDeviceObjSetActive; +virNodeDeviceObjSetPersistent; =20 =20 # conf/virnwfilterbindingdef.h --=20 2.26.2