[libvirt PATCH v6 09/30] nodedev: add persistence to virNodeDeviceObj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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 ab663fd5a0..ce84e4d8c1 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(virNodeDeviceObj *obj,
 {
     obj->active = active;
 }
+
+
+bool
+virNodeDeviceObjIsPersistent(virNodeDeviceObj *obj)
+{
+    return obj->persistent;
+}
+
+
+void
+virNodeDeviceObjSetPersistent(virNodeDeviceObj *obj,
+                              bool persistent)
+{
+    obj->persistent = persistent;
+}
diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h
index e786a70f51..7f682b9dca 100644
--- a/src/conf/virnodedeviceobj.h
+++ b/src/conf/virnodedeviceobj.h
@@ -128,3 +128,9 @@ virNodeDeviceObjIsActive(virNodeDeviceObj *obj);
 void
 virNodeDeviceObjSetActive(virNodeDeviceObj *obj,
                           bool active);
+bool
+virNodeDeviceObjIsPersistent(virNodeDeviceObj *obj);
+
+void
+virNodeDeviceObjSetPersistent(virNodeDeviceObj *obj,
+                              bool persistent);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 09957c943b..047314ec19 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1273,6 +1273,7 @@ virNetworkPortDefSaveStatus;
 virNodeDeviceObjEndAPI;
 virNodeDeviceObjGetDef;
 virNodeDeviceObjIsActive;
+virNodeDeviceObjIsPersistent;
 virNodeDeviceObjListAssignDef;
 virNodeDeviceObjListExport;
 virNodeDeviceObjListFindByName;
@@ -1286,6 +1287,7 @@ virNodeDeviceObjListNew;
 virNodeDeviceObjListNumOfDevices;
 virNodeDeviceObjListRemove;
 virNodeDeviceObjSetActive;
+virNodeDeviceObjSetPersistent;
 
 
 # conf/virnwfilterbindingdef.h
-- 
2.26.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux