[PATCH v1 18/23] lock_driver: Introduce VIR_LOCK_MANAGER_OBJECT_TYPE_SECLABEL

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

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/locking/lock_driver.h       |  2 ++
 src/locking/lock_driver_lockd.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h
index e7a8371..71feea3 100644
--- a/src/locking/lock_driver.h
+++ b/src/locking/lock_driver.h
@@ -42,6 +42,8 @@ typedef enum {
 typedef enum {
     /* The managed object is a virtual guest domain */
     VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN = 0,
+    /* The managed object is a seclabel */
+    VIR_LOCK_MANAGER_OBJECT_TYPE_SECLABEL,
 } virLockManagerObjectType;
 
 typedef enum {
diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c
index a4a9a62..f9867a1 100644
--- a/src/locking/lock_driver_lockd.c
+++ b/src/locking/lock_driver_lockd.c
@@ -54,6 +54,8 @@ struct _virLockManagerLockDaemonResource {
 };
 
 struct _virLockManagerLockDaemonPrivate {
+    virLockManagerObjectType type;
+
     unsigned char uuid[VIR_UUID_BUFLEN];
     char *name;
     int id;
@@ -290,11 +292,13 @@ virLockManagerLockDaemonConnect(virLockManagerPtr lock,
                                 int *counter)
 {
     virNetClientPtr client;
+    virLockManagerLockDaemonPrivatePtr priv = lock->privateData;
 
     if (!(client = virLockManagerLockDaemonConnectionNew(geteuid() == 0, program)))
         return NULL;
 
-    if (virLockManagerLockDaemonConnectionRegister(lock,
+    if (priv->type == VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN &&
+        virLockManagerLockDaemonConnectionRegister(lock,
                                                    client,
                                                    *program,
                                                    counter) < 0)
@@ -441,6 +445,8 @@ static int virLockManagerLockDaemonNew(virLockManagerPtr lock,
         return -1;
     lock->privateData = priv;
 
+    priv->type = type;
+
     switch (type) {
     case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
         for (i = 0; i < nparams; i++) {
@@ -480,6 +486,10 @@ static int virLockManagerLockDaemonNew(virLockManagerPtr lock,
         }
         break;
 
+    case VIR_LOCK_MANAGER_OBJECT_TYPE_SECLABEL:
+        /* nada */
+        break;
+
     default:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unknown lock manager object type %d"),
-- 
2.4.9

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]