From nobody Mon Feb 9 23:57:59 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=1612373974; cv=none; d=zohomail.com; s=zohoarc; b=j1xkrUoYr/Jdxvg4ppbiEn2gUj0fIreLEc6osRXUqqScPz6KHZsPPFz68cRjWFNYpYJv7bPeEYgNj0TAsKlO8eJ7h/647sEVndq2q0KBkEJzvvNZBT+stWCfKEc+ahJZmJ4+Fs/FHWo8bUc3LEeB0j89t3Y/uI+eSlhinKwyR6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373974; 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=vSfmJnBGyOQlOzn+B8Fmyp8Ew6ADcZn75GTApPZdatk=; b=Jzr9NgdziRp7h8W5SeE33iWvbU7PsGCxcrrjA3ski3dprg8FBl7JpS2/+s2ZbDsmEFxWG9vMFbJAUBIDKhnREoLrgXyz18FO0mnXw22NDCgGt7SHZcK2A/HkThvZASA3Ib7FZA0mCn3CfqlWK7+7DfxhtrGc1sTqskyi6ppSEDw= 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 1612373974915565.3955277911824; Wed, 3 Feb 2021 09:39:34 -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-74-pKmpZTNKP2qGSN3iFzPoRg-1; Wed, 03 Feb 2021 12:39:31 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3948B85B668; Wed, 3 Feb 2021 17:39:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B6C3544F5; Wed, 3 Feb 2021 17:39:21 +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 B6B5357DFD; Wed, 3 Feb 2021 17:39:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 113HdGck024297 for ; Wed, 3 Feb 2021 12:39:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 84213722CA; Wed, 3 Feb 2021 17:39:16 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-113-7.phx2.redhat.com [10.3.113.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EEEE5B4AE; Wed, 3 Feb 2021 17:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373973; 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=vSfmJnBGyOQlOzn+B8Fmyp8Ew6ADcZn75GTApPZdatk=; b=Wj48C+VV6ODwPUBRh21Qs/sOU2fcsoT/t1+GXZAQGGMzGfT75bOKPf5fQdkk4qISU91KgS RKsTS1A+Y8i3qVKSb23O7bhWcwRfiD0tGzlBbJ/sjLp2vYhZp9xi/QmMaoe5zmnMD9ZNTY 9/7lFFSHSm+lVAgFCnNC8LgU1SGthP4= X-MC-Unique: pKmpZTNKP2qGSN3iFzPoRg-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v4 07/25] nodedev: add persistence to virNodeDeviceObj Date: Wed, 3 Feb 2021 11:38:51 -0600 Message-Id: <20210203173909.1273000-8-jjongsma@redhat.com> In-Reply-To: <20210203173909.1273000-1-jjongsma@redhat.com> References: <20210203173909.1273000-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.79 on 10.5.11.15 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 Reviewed-by: Erik Skultety --- src/conf/virnodedeviceobj.c | 14 ++++++++++++++ src/conf/virnodedeviceobj.h | 6 ++++++ src/libvirt_private.syms | 2 ++ 3 files changed, 22 insertions(+) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 6e9291264a..53cf3d1bcd 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 { @@ -1000,3 +1001,16 @@ 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 c8ef6fe983..d044a1111b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1262,6 +1262,7 @@ virNetworkPortDefSaveStatus; virNodeDeviceObjEndAPI; virNodeDeviceObjGetDef; virNodeDeviceObjIsActive; +virNodeDeviceObjIsPersistent; virNodeDeviceObjListAssignDef; virNodeDeviceObjListExport; virNodeDeviceObjListFindByName; @@ -1275,6 +1276,7 @@ virNodeDeviceObjListNew; virNodeDeviceObjListNumOfDevices; virNodeDeviceObjListRemove; virNodeDeviceObjSetActive; +virNodeDeviceObjSetPersistent; =20 =20 # conf/virnwfilterbindingdef.h --=20 2.26.2