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 | 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 caps,
used by testdriver */
bool active;
+ bool persistent;
};
struct _virNodeDeviceObjList {
@@ -1003,3 +1004,18 @@ virNodeDeviceObjSetActive(virNodeDeviceObjPtr obj,
{
obj->active = active;
}
+
+
+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 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;
# conf/virnwfilterbindingdef.h
--
2.26.2