On Wed, Feb 03, 2021 at 11:38:51AM -0600, Jonathon Jongsma wrote:
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 <jjongsma(a)redhat.com>
---
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 caps,
used by testdriver */
bool active;
+ bool persistent;
};
struct _virNodeDeviceObjList {
@@ -1000,3 +1001,16 @@ virNodeDeviceObjSetActive(virNodeDeviceObjPtr obj,
{
obj->active = active;
}
2 blank lines in between function definitions please.
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>
+
+bool
+virNodeDeviceObjIsPersistent(virNodeDeviceObjPtr obj)
+{
+ return obj->persistent;
+}
+
+void
+virNodeDeviceObjSetPersistent(virNodeDeviceObjPtr obj,
+ bool persistent)
+{
+ obj->persistent = 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;
# conf/virnwfilterbindingdef.h
--
2.26.2