[gnome-session] Add an automount-inhibit flag
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] Add an automount-inhibit flag
- Date: Fri, 6 Jul 2012 07:14:06 +0000 (UTC)
commit 70725a0c337e2be114631f6f77821c0aba3f0e74
Author: Hans de Goede <hdegoede redhat com>
Date: Fri Jun 22 08:40:59 2012 +0200
Add an automount-inhibit flag
When connecting to virtual machines with usb-device redirection, such as
Spice enabled vms, automount may get in the way. Specifically if auto-usbredir
is enabled in the vm-viewer, then the usbredir code and the automount code
race for who gets to the device first.
If the automount code wins the race this is a problem, since usbredir causes
a device-disconnect (iow the usb mass storage driver sees an unplug), so in
the end usbredir always wins, and we end up with a non clean potentially
corrupt filesystem. Also see:
https://bugzilla.redhat.com/show_bug.cgi?id=812972
There for the need exists to be able to inhibit gnome-shell's automounting,
since all other inhibits run through gnome-session, it seems consistent to
store the inhibit flag for automounting in gnome-session too. This has the
added advantage that gnome-session already has all the necessary logic to
automatically uninhibit if a client goes away.
Another reason to do this through gnome-session is that all other inhibit
flags are accessible through GtkApplication which relies on gnome-session,
so storing this in gnome-session allows to add it to GtkApplication too.
Note that gnome-session does not do anything with the flag, other then
tracking it. The reason to still modify gnome-session is to reserve and
document the flag.
Signed-off-by: Hans de Goede <hdegoede redhat com>
https://bugzilla.gnome.org/show_bug.cgi?id=678595
gnome-session/gsm-inhibitor.h | 3 ++-
gnome-session/org.gnome.SessionManager.xml | 4 ++++
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gnome-session/gsm-inhibitor.h b/gnome-session/gsm-inhibitor.h
index 2ef158d..f160046 100644
--- a/gnome-session/gsm-inhibitor.h
+++ b/gnome-session/gsm-inhibitor.h
@@ -53,7 +53,8 @@ typedef enum {
GSM_INHIBITOR_FLAG_LOGOUT = 1 << 0,
GSM_INHIBITOR_FLAG_SWITCH_USER = 1 << 1,
GSM_INHIBITOR_FLAG_SUSPEND = 1 << 2,
- GSM_INHIBITOR_FLAG_IDLE = 1 << 3
+ GSM_INHIBITOR_FLAG_IDLE = 1 << 3,
+ GSM_INHIBITOR_FLAG_AUTOMOUNT = 1 << 4
} GsmInhibitorFlag;
typedef enum
diff --git a/gnome-session/org.gnome.SessionManager.xml b/gnome-session/org.gnome.SessionManager.xml
index eaf1ef5..8311ce3 100644
--- a/gnome-session/org.gnome.SessionManager.xml
+++ b/gnome-session/org.gnome.SessionManager.xml
@@ -146,6 +146,10 @@
<doc:term>8</doc:term>
<doc:definition>Inhibit the session being marked as idle</doc:definition>
</doc:item>
+ <doc:item>
+ <doc:term>16</doc:term>
+ <doc:definition>Inhibit auto-mounting removable media for the session</doc:definition>
+ </doc:item>
</doc:list>
Values for flags may be bitwise or'ed together.
</doc:para>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]