]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- extended debug output 935/head
authorArvin Schnell <aschnell@suse.de>
Thu, 26 Sep 2024 16:30:24 +0000 (18:30 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 26 Sep 2024 16:30:24 +0000 (18:30 +0200)
server/Client.cc
server/MetaSnapper.cc
server/MetaSnapper.h

index 3ecda0e1231feffda7932acd12ca75205b70dbba..c1987350a84235352f7947eab186d34887d1a1c3 100644 (file)
@@ -1828,6 +1828,8 @@ Client::debug(DBus::Connection& conn, DBus::Message& msg)
        if (it->is_loaded())
        {
            s << ", loaded";
+           if (it->is_locked(clients))
+               s << ", locked";
            if (it->use_count() == 0)
                s << ", unused for " << duration_cast<milliseconds>(it->unused_for()).count() << "ms";
            else
index e0f090bc3c181d96909d19a6c0e2ccb862c579df..2c50ae53c542c023b915e3e250c38db0127c667a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2012-2015] Novell, Inc.
- * Copyright (c) [2018-2023] SUSE LLC
+ * Copyright (c) [2018-2024] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -30,6 +30,7 @@
 #include <snapper/SnapperDefines.h>
 
 #include "MetaSnapper.h"
+#include "Client.h"
 
 
 MetaSnappers meta_snappers;
@@ -129,6 +130,17 @@ MetaSnapper::unload()
 }
 
 
+bool
+MetaSnapper::is_locked(const Clients& clients) const
+{
+    for (const Client& client : clients)
+       if (client.has_lock(configName()))
+           return true;
+
+    return false;
+}
+
+
 MetaSnappers::MetaSnappers()
 {
 }
index a630295e9ee89d0dbe7169c5c7b4ace0ddea1390..1111aad539ce24914cf8513cc2b56fbb715340c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2012-2015] Novell, Inc.
- * Copyright (c) [2018-2023] SUSE LLC
+ * Copyright (c) [2018-2024] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -36,6 +36,9 @@ using namespace std;
 using namespace snapper;
 
 
+class Clients;
+
+
 struct UnknownConfig : public Exception
 {
     explicit UnknownConfig() : Exception("unknown config") {}
@@ -65,6 +68,8 @@ public:
     bool is_loaded() const { return snapper; }
     void unload();
 
+    bool is_locked(const Clients& clients) const;
+
 private:
 
     void set_permissions();