summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-07-20 14:08:45 -0400
committerDavid Zeuthen <davidz@redhat.com>2011-07-20 14:08:45 -0400
commit9de6dd6e751b754693a8704182ba7b1d403acbbb (patch)
tree64268aecf831823b84914a015d1184b6bd15e88c
parent23212d0d01604ceffe8973734118ca8f8220d7f7 (diff)
Add Manager D-Bus interface and a Linux implementation
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--data/org.freedesktop.UDisks2.xml12
-rw-r--r--doc/udisks2-docs.xml16
-rw-r--r--doc/udisks2-sections.txt64
-rw-r--r--doc/udisks2.types4
-rw-r--r--src/Makefile.am1
-rw-r--r--src/udisksdaemontypes.h3
-rw-r--r--src/udiskslinuxmanager.c201
-rw-r--r--src/udiskslinuxmanager.h38
-rw-r--r--src/udiskslinuxprovider.c18
-rw-r--r--udisks/udisksclient.c54
-rw-r--r--udisks/udisksclient.h1
11 files changed, 406 insertions, 6 deletions
diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml
index ceb33be..5638e7a 100644
--- a/data/org.freedesktop.UDisks2.xml
+++ b/data/org.freedesktop.UDisks2.xml
@@ -25,6 +25,18 @@
<!-- ********************************************************************** -->
<!--
+ org.freedesktop.UDisks2.Manager:
+ @short_description: Manager singleton
+
+ Interface for top-level manager singleton object located at the
+ object path <literal>/org/freedesktop/UDisks2/Manager</literal>.
+ -->
+ <interface name="org.freedesktop.UDisks2.Manager">
+ <!-- Version: The version of the daemon currently running -->
+ <property name="Version" type="s" access="read"/>
+ </interface>
+
+ <!--
org.freedesktop.UDisks2.Drive:
@short_description: Disk Drive
diff --git a/doc/udisks2-docs.xml b/doc/udisks2-docs.xml
index 8ea2998..00ef08e 100644
--- a/doc/udisks2-docs.xml
+++ b/doc/udisks2-docs.xml
@@ -75,7 +75,7 @@
the name.
</para>
</sect1>
- <sect1 id="ref-dbus-well-known-object">
+ <sect1 id="ref-dbus-udisks2-well-known-object">
<title>The /org/freedesktop/UDisks2 object</title>
<para>
The process that owns the well-known D-Bus name <link
@@ -89,6 +89,17 @@
objects.
</para>
</sect1>
+ <sect1 id="ref-dbus-manager-well-known-object">
+ <title>The /org/freedesktop/UDisks2/Manager object</title>
+ <para>
+ The object at the path
+ <literal>/org/freedesktop/UDisks2/Manager</literal>
+ implements the <link
+ linkend="gdbus-interface-org-freedesktop-UDisks2-Manager.top_of_page">org.freedesktop.UDisks2.Manager</link>
+ D-Bus interface. This object can be used to inspect and
+ manipulate global state.
+ </para>
+ </sect1>
<sect1 id="udisks-std-options">
<title>The <parameter>options</parameter> parameter</title>
<para>
@@ -125,6 +136,7 @@
<chapter>
<title>D-Bus Interfaces</title>
+ <xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Manager.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Drive.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.BlockDevice.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Filesystem.xml"/>
@@ -143,6 +155,7 @@
<title>Generated Code</title>
<xi:include href="xml/UDisksObject.xml"/>
<xi:include href="xml/UDisksObjectManagerClient.xml"/>
+ <xi:include href="xml/UDisksManager.xml"/>
<xi:include href="xml/UDisksDrive.xml"/>
<xi:include href="xml/UDisksJob.xml"/>
<xi:include href="xml/UDisksBlockDevice.xml"/>
@@ -157,6 +170,7 @@
<xi:include href="xml/udisksdaemon.xml"/>
<xi:include href="xml/udisksdaemonutil.xml"/>
<xi:include href="xml/udiskslogging.xml"/>
+ <xi:include href="xml/udiskslinuxmanager.xml"/>
<xi:include href="xml/udiskslinuxblock.xml"/>
<xi:include href="xml/udiskslinuxdrive.xml"/>
<xi:include href="xml/udiskslinuxfilesystem.xml"/>
diff --git a/doc/udisks2-sections.txt b/doc/udisks2-sections.txt
index e6e2c8f..6537de0 100644
--- a/doc/udisks2-sections.txt
+++ b/doc/udisks2-sections.txt
@@ -40,6 +40,7 @@ udisks_client_new
udisks_client_new_finish
udisks_client_new_sync
udisks_client_get_object_manager
+udisks_client_get_manager
<SUBSECTION Standard>
UDISKS_TYPE_CLIENT
UDISKS_CLIENT
@@ -48,8 +49,6 @@ UDISKS_IS_CLIENT
udisks_client_get_type
</SECTION>
-
-
<SECTION>
<FILE>udisksdaemon</FILE>
<TITLE>UDisksDaemon</TITLE>
@@ -192,7 +191,6 @@ udisks_provider_get_type
UDisksProviderPrivate
</SECTION>
-
<SECTION>
<FILE>udiskslinuxprovider</FILE>
<TITLE>UDisksLinuxProvider</TITLE>
@@ -332,12 +330,14 @@ udisks_object_get_filesystem
udisks_object_get_job
udisks_object_get_swapspace
udisks_object_get_encrypted
+udisks_object_get_manager
udisks_object_peek_block_device
udisks_object_peek_drive
udisks_object_peek_filesystem
udisks_object_peek_job
udisks_object_peek_swapspace
udisks_object_peek_encrypted
+udisks_object_peek_manager
UDisksObjectProxy
UDisksObjectProxyClass
udisks_object_proxy_new
@@ -350,6 +350,7 @@ udisks_object_skeleton_set_filesystem
udisks_object_skeleton_set_job
udisks_object_skeleton_set_swapspace
udisks_object_skeleton_set_encrypted
+udisks_object_skeleton_set_manager
<SUBSECTION Standard>
udisks_object_get_type
udisks_object_proxy_get_type
@@ -767,3 +768,60 @@ udisks_block_device_get_type
udisks_block_device_proxy_get_type
udisks_block_device_skeleton_get_type
</SECTION>
+
+<SECTION>
+<FILE>UDisksManager</FILE>
+UDisksManager
+UDisksManagerIface
+udisks_manager_interface_info
+udisks_manager_override_properties
+udisks_manager_get_version
+udisks_manager_set_version
+UDisksManagerProxy
+UDisksManagerProxyClass
+udisks_manager_proxy_new
+udisks_manager_proxy_new_finish
+udisks_manager_proxy_new_sync
+udisks_manager_proxy_new_for_bus
+udisks_manager_proxy_new_for_bus_finish
+udisks_manager_proxy_new_for_bus_sync
+UDisksManagerSkeleton
+UDisksManagerSkeletonClass
+udisks_manager_skeleton_new
+<SUBSECTION Standard>
+UDISKS_TYPE_MANAGER
+UDISKS_IS_MANAGER
+UDISKS_MANAGER
+UDISKS_MANAGER_GET_IFACE
+UDISKS_TYPE_MANAGER_PROXY
+UDISKS_IS_MANAGER_PROXY
+UDISKS_IS_MANAGER_PROXY_CLASS
+UDISKS_MANAGER_PROXY
+UDISKS_MANAGER_PROXY_CLASS
+UDISKS_MANAGER_PROXY_GET_CLASS
+UDISKS_TYPE_MANAGER_SKELETON
+UDISKS_IS_MANAGER_SKELETON
+UDISKS_IS_MANAGER_SKELETON_CLASS
+UDISKS_MANAGER_SKELETON
+UDISKS_MANAGER_SKELETON_CLASS
+UDISKS_MANAGER_SKELETON_GET_CLASS
+UDisksManagerProxyPrivate
+UDisksManagerSkeletonPrivate
+udisks_manager_get_type
+udisks_manager_proxy_get_type
+udisks_manager_skeleton_get_type
+</SECTION>
+
+<SECTION>
+<FILE>udiskslinuxmanager</FILE>
+<TITLE>UDisksLinuxManager</TITLE>
+UDisksLinuxManager
+udisks_linux_manager_new
+udisks_linux_manager_get_daemon
+<SUBSECTION Standard>
+UDISKS_TYPE_LINUX_MANAGER
+UDISKS_LINUX_MANAGER
+UDISKS_IS_LINUX_MANAGER
+<SUBSECTION Private>
+udisks_linux_manager_get_type
+</SECTION>
diff --git a/doc/udisks2.types b/doc/udisks2.types
index c4b43d8..14c18e0 100644
--- a/doc/udisks2.types
+++ b/doc/udisks2.types
@@ -14,6 +14,7 @@ udisks_linux_provider_get_type
udisks_persistent_store_get_type
udisks_linux_filesystem_get_type
udisks_linux_encrypted_get_type
+udisks_linux_manager_get_type
udisks_cleanup_get_type
udisks_drive_get_type
@@ -31,6 +32,9 @@ udisks_swapspace_skeleton_get_type
udisks_encrypted_get_type
udisks_encrypted_proxy_get_type
udisks_encrypted_skeleton_get_type
+udisks_manager_get_type
+udisks_manager_proxy_get_type
+udisks_manager_skeleton_get_type
udisks_job_get_type
udisks_job_proxy_get_type
udisks_job_skeleton_get_type
diff --git a/src/Makefile.am b/src/Makefile.am
index 71dcdc0..822d6b2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,6 +51,7 @@ libudisks_daemon_la_SOURCES = \
udiskslinuxfilesystem.h udiskslinuxfilesystem.c \
udiskslinuxencrypted.h udiskslinuxencrypted.c \
udiskslinuxdrive.h udiskslinuxdrive.c \
+ udiskslinuxmanager.h udiskslinuxmanager.c \
udisksbasejob.h udisksbasejob.c \
udisksspawnedjob.h udisksspawnedjob.c \
udisksthreadedjob.h udisksthreadedjob.c \
diff --git a/src/udisksdaemontypes.h b/src/udisksdaemontypes.h
index e316351..77bd75b 100644
--- a/src/udisksdaemontypes.h
+++ b/src/udisksdaemontypes.h
@@ -67,6 +67,9 @@ typedef struct _UDisksLinuxFilesystem UDisksLinuxFilesystem;
struct _UDisksLinuxEncrypted;
typedef struct _UDisksLinuxEncrypted UDisksLinuxEncrypted;
+struct _UDisksLinuxManager;
+typedef struct _UDisksLinuxManager UDisksLinuxManager;
+
/**
* UDisksThreadedJobFunc:
* @job: A #UDisksThreadedJob.
diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c
new file mode 100644
index 0000000..ba3798a
--- /dev/null
+++ b/src/udiskslinuxmanager.c
@@ -0,0 +1,201 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2007-2010 David Zeuthen <zeuthen@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+
+#include <sys/types.h>
+#include <pwd.h>
+#include <grp.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib/gstdio.h>
+
+#include "udiskslogging.h"
+#include "udiskslinuxmanager.h"
+#include "udisksdaemon.h"
+#include "udisksdaemonutil.h"
+
+/**
+ * SECTION:udiskslinuxmanager
+ * @title: UDisksLinuxManager
+ * @short_description: Manager implementation on Linux
+ *
+ * This type provides an implementation of the #UDisksManager
+ * interface on Linux.
+ */
+
+typedef struct _UDisksLinuxManagerClass UDisksLinuxManagerClass;
+
+/**
+ * UDisksLinuxManager:
+ *
+ * The #UDisksLinuxManager structure contains only private data and should
+ * only be accessed using the provided API.
+ */
+struct _UDisksLinuxManager
+{
+ UDisksManagerSkeleton parent_instance;
+
+ UDisksDaemon *daemon;
+};
+
+struct _UDisksLinuxManagerClass
+{
+ UDisksManagerSkeletonClass parent_class;
+};
+
+enum
+{
+ PROP_0,
+ PROP_DAEMON
+};
+
+static void manager_iface_init (UDisksManagerIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (UDisksLinuxManager, udisks_linux_manager, UDISKS_TYPE_MANAGER_SKELETON,
+ G_IMPLEMENT_INTERFACE (UDISKS_TYPE_MANAGER, manager_iface_init));
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+udisks_linux_manager_finalize (GObject *object)
+{
+ /* UDisksLinuxManager *manager = UDISKS_LINUX_MANAGER (object); */
+
+ G_OBJECT_CLASS (udisks_linux_manager_parent_class)->finalize (object);
+}
+
+static void
+udisks_linux_manager_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ UDisksLinuxManager *manager = UDISKS_LINUX_MANAGER (object);
+
+ switch (prop_id)
+ {
+ case PROP_DAEMON:
+ g_value_set_object (value, udisks_linux_manager_get_daemon (manager));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+udisks_linux_manager_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ UDisksLinuxManager *manager = UDISKS_LINUX_MANAGER (object);
+
+ switch (prop_id)
+ {
+ case PROP_DAEMON:
+ g_assert (manager->daemon == NULL);
+ /* we don't take a reference to the daemon */
+ manager->daemon = g_value_get_object (value);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+udisks_linux_manager_init (UDisksLinuxManager *manager)
+{
+ g_dbus_interface_skeleton_set_flags (G_DBUS_INTERFACE_SKELETON (manager),
+ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
+}
+
+static void
+udisks_linux_manager_class_init (UDisksLinuxManagerClass *klass)
+{
+ GObjectClass *gobject_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = udisks_linux_manager_finalize;
+ gobject_class->set_property = udisks_linux_manager_set_property;
+ gobject_class->get_property = udisks_linux_manager_get_property;
+
+ /**
+ * UDisksLinuxManager:daemon:
+ *
+ * The #UDisksDaemon for the object.
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_DAEMON,
+ g_param_spec_object ("daemon",
+ "Daemon",
+ "The daemon for the object",
+ UDISKS_TYPE_DAEMON,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * udisks_linux_manager_new:
+ * @daemon: A #UDisksDaemon.
+ *
+ * Creates a new #UDisksLinuxManager instance.
+ *
+ * Returns: A new #UDisksLinuxManager. Free with g_object_unref().
+ */
+UDisksManager *
+udisks_linux_manager_new (UDisksDaemon *daemon)
+{
+ g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
+ return UDISKS_MANAGER (g_object_new (UDISKS_TYPE_LINUX_MANAGER,
+ "daemon", daemon,
+ "version", PACKAGE_VERSION,
+ NULL));
+}
+
+/**
+ * udisks_linux_manager_get_daemon:
+ * @manager: A #UDisksLinuxManager.
+ *
+ * Gets the daemon used by @manager.
+ *
+ * Returns: A #UDisksDaemon. Do not free, the object is owned by @manager.
+ */
+UDisksDaemon *
+udisks_linux_manager_get_daemon (UDisksLinuxManager *manager)
+{
+ g_return_val_if_fail (UDISKS_IS_LINUX_MANAGER (manager), NULL);
+ return manager->daemon;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+manager_iface_init (UDisksManagerIface *iface)
+{
+}
diff --git a/src/udiskslinuxmanager.h b/src/udiskslinuxmanager.h
new file mode 100644
index 0000000..2e8cbed
--- /dev/null
+++ b/src/udiskslinuxmanager.h
@@ -0,0 +1,38 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2007-2010 David Zeuthen <zeuthen@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef __UDISKS_LINUX_MANAGER_H__
+#define __UDISKS_LINUX_MANAGER_H__
+
+#include "udisksdaemontypes.h"
+
+G_BEGIN_DECLS
+
+#define UDISKS_TYPE_LINUX_MANAGER (udisks_linux_manager_get_type ())
+#define UDISKS_LINUX_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UDISKS_TYPE_LINUX_MANAGER, UDisksLinuxManager))
+#define UDISKS_IS_LINUX_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_LINUX_MANAGER))
+
+GType udisks_linux_manager_get_type (void) G_GNUC_CONST;
+UDisksManager *udisks_linux_manager_new (UDisksDaemon *daemon);
+UDisksDaemon *udisks_linux_manager_get_daemon (UDisksLinuxManager *manager);
+
+G_END_DECLS
+
+#endif /* __UDISKS_LINUX_MANAGER_H__ */
diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c
index e71e057..3923dec 100644
--- a/src/udiskslinuxprovider.c
+++ b/src/udiskslinuxprovider.c
@@ -29,6 +29,7 @@
#include "udiskslinuxprovider.h"
#include "udiskslinuxblock.h"
#include "udiskslinuxdrive.h"
+#include "udiskslinuxmanager.h"
#include "udiskscleanup.h"
/**
@@ -54,6 +55,8 @@ struct _UDisksLinuxProvider
GUdevClient *gudev_client;
+ UDisksObjectSkeleton *manager_object;
+
/* maps from sysfs path to UDisksLinuxBlock objects */
GHashTable *sysfs_to_block;
@@ -88,6 +91,9 @@ udisks_linux_provider_finalize (GObject *object)
g_hash_table_unref (provider->sysfs_to_controller);
g_object_unref (provider->gudev_client);
+ udisks_object_skeleton_set_manager (provider->manager_object, NULL);
+ g_object_unref (provider->manager_object);
+
if (G_OBJECT_CLASS (udisks_linux_provider_parent_class)->finalize != NULL)
G_OBJECT_CLASS (udisks_linux_provider_parent_class)->finalize (object);
}
@@ -120,12 +126,24 @@ static void
udisks_linux_provider_start (UDisksProvider *_provider)
{
UDisksLinuxProvider *provider = UDISKS_LINUX_PROVIDER (_provider);
+ UDisksDaemon *daemon;
+ UDisksManager *manager;
GList *devices;
GList *l;
if (UDISKS_PROVIDER_CLASS (udisks_linux_provider_parent_class)->start != NULL)
UDISKS_PROVIDER_CLASS (udisks_linux_provider_parent_class)->start (_provider);
+ daemon = udisks_provider_get_daemon (UDISKS_PROVIDER (provider));
+
+ provider->manager_object = udisks_object_skeleton_new ("/org/freedesktop/UDisks2/Manager");
+ manager = udisks_linux_manager_new (daemon);
+ udisks_object_skeleton_set_manager (provider->manager_object, manager);
+ g_object_unref (manager);
+
+ g_dbus_object_manager_server_export (udisks_daemon_get_object_manager (daemon),
+ G_DBUS_OBJECT_SKELETON (provider->manager_object));
+
provider->sysfs_to_block = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c
index 5bed79e..1729a7e 100644
--- a/udisks/udisksclient.c
+++ b/udisks/udisksclient.c
@@ -60,7 +60,8 @@ typedef struct
enum
{
PROP_0,
- PROP_OBJECT_MANAGER
+ PROP_OBJECT_MANAGER,
+ PROP_MANAGER
};
static void initable_iface_init (GInitableIface *initable_iface);
@@ -109,6 +110,10 @@ udisks_client_get_property (GObject *object,
g_value_set_object (value, udisks_client_get_object_manager (client));
break;
+ case PROP_MANAGER:
+ g_value_set_object (value, udisks_client_get_manager (client));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -132,11 +137,26 @@ udisks_client_class_init (UDisksClientClass *klass)
g_object_class_install_property (gobject_class,
PROP_OBJECT_MANAGER,
g_param_spec_object ("object-manager",
- "object manager",
+ "Object Manager",
"The GDBusObjectManager used by the UDisksClient",
G_TYPE_DBUS_OBJECT_MANAGER,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
+
+ /**
+ * UDisksClient:manager:
+ *
+ * The #UDisksManager interface on the well-known
+ * <literal>/org/freedesktop/UDisks2/Manager</literal> object
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_MANAGER,
+ g_param_spec_object ("manager",
+ "Manager",
+ "The UDisksManager",
+ UDISKS_TYPE_MANAGER,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
}
/**
@@ -289,3 +309,33 @@ udisks_client_get_object_manager (UDisksClient *client)
g_return_val_if_fail (UDISKS_IS_CLIENT (client), NULL);
return client->object_manager;
}
+
+/**
+ * udisks_client_get_manager:
+ * @client: A #UDisksClient.
+ *
+ * Gets the #UDisksManager interface on the well-known
+ * <literal>/org/freedesktop/UDisks2/Manager</literal> object.
+ *
+ * Returns: (transfer none): A #UDisksManager or %NULL if the udisksd
+ * daemon is not currently running. Do not free, the instance is owned
+ * by @client.
+ */
+UDisksManager *
+udisks_client_get_manager (UDisksClient *client)
+{
+ UDisksManager *ret;
+ GDBusObject *obj;
+
+ g_return_val_if_fail (UDISKS_IS_CLIENT (client), NULL);
+
+ obj = g_dbus_object_manager_get_object (client->object_manager, "/org/freedesktop/UDisks2/Manager");
+ if (obj == NULL)
+ goto out;
+
+ ret = udisks_object_peek_manager (UDISKS_OBJECT (obj));
+ g_object_unref (obj);
+
+ out:
+ return ret;
+}
diff --git a/udisks/udisksclient.h b/udisks/udisksclient.h
index cbb06f0..adc73bd 100644
--- a/udisks/udisksclient.h
+++ b/udisks/udisksclient.h
@@ -43,6 +43,7 @@ UDisksClient *udisks_client_new_finish (GAsyncResult *res,
UDisksClient *udisks_client_new_sync (GCancellable *cancellable,
GError **error);
GDBusObjectManager *udisks_client_get_object_manager (UDisksClient *client);
+UDisksManager *udisks_client_get_manager (UDisksClient *client);
G_END_DECLS