Commit d10cc97c authored by Bastien Nocera's avatar Bastien Nocera

Remove QoS interface

It was added for some workloads, but ill-suited and never really
got traction. Using cgroups to manage the resources of particular
services (using systemd), or something separate like rtkit is
a better bet.
parent c842f1a5
......@@ -2,7 +2,7 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = etc libupower-glib src doc tools policy po
SUBDIRS = etc libupower-glib src doc tools po
if BACKEND_TYPE_LINUX
SUBDIRS += rules
......
......@@ -250,7 +250,6 @@ doc/Makefile
doc/version.xml
doc/man/Makefile
doc/dbus/Makefile
policy/Makefile
rules/Makefile
libupower-glib/Makefile
libupower-glib/up-version.h
......
......@@ -60,7 +60,6 @@ content_files = \
man/UPower.xml \
dbus/org.freedesktop.UPower.ref.xml \
dbus/org.freedesktop.UPower.Device.ref.xml \
dbus/org.freedesktop.UPower.QoS.ref.xml \
dbus/org.freedesktop.UPower.KbdBacklight.ref.xml \
$(NULL)
......@@ -80,7 +79,6 @@ MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
org.freedesktop.UPower.Device.ref.xml \
org.freedesktop.UPower.KbdBacklight.ref.xml \
org.freedesktop.UPower.QoS.ref.xml \
org.freedesktop.UPower.ref.xml \
upowerd.xml \
upower.xml \
......
all : org.freedesktop.UPower.ref.xml org.freedesktop.UPower.Device.ref.xml org.freedesktop.UPower.QoS.ref.xml org.freedesktop.UPower.KbdBacklight.ref.xml org.freedesktop.UPower.Wakeups.ref.xml
all : org.freedesktop.UPower.ref.xml org.freedesktop.UPower.Device.ref.xml org.freedesktop.UPower.KbdBacklight.ref.xml org.freedesktop.UPower.Wakeups.ref.xml
org.freedesktop.UPower.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl
echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@
......@@ -9,10 +9,6 @@ org.freedesktop.UPower.Device.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower
echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@
$(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@
org.freedesktop.UPower.QoS.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.QoS.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl
echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@
$(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@
org.freedesktop.UPower.KbdBacklight.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.KbdBacklight.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl
echo "<?xml version=\"1.0\"?>""<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">" > $@
$(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@
......
......@@ -66,7 +66,6 @@
</partintro>
<xi:include href="dbus/org.freedesktop.UPower.ref.xml"/>
<xi:include href="dbus/org.freedesktop.UPower.Device.ref.xml"/>
<xi:include href="dbus/org.freedesktop.UPower.QoS.ref.xml"/>
<xi:include href="dbus/org.freedesktop.UPower.KbdBacklight.ref.xml"/>
</reference>
......@@ -80,7 +79,6 @@
<xi:include href="xml/up-client.xml"/>
<xi:include href="xml/up-device.xml"/>
<xi:include href="xml/up-history-item.xml"/>
<xi:include href="xml/up-qos-item.xml"/>
<xi:include href="xml/up-stats-item.xml"/>
<xi:include href="xml/up-wakeup-item.xml"/>
</reference>
......
......@@ -16,7 +16,6 @@ UPower is an abstraction for enumerating power devices,
listening to device events and querying history and statistics.
Any application or service on the system can access the
<code>org.freedesktop.UPower</code> service via the system message bus.
Some operations (such as setting the QoS for the system) are restricted using <a href="http://hal.freedesktop.org/docs/PolicyKit/">PolicyKit</a>.
</p>
<p>
UPower was <a href="http://lists.freedesktop.org/archives/devkit-devel/2009-December/000567.html">
......
......@@ -23,7 +23,6 @@ libupower_glib_include_HEADERS = \
up-version.h \
up-types.h \
up-device.h \
up-qos-item.h \
up-wakeup-item.h \
up-stats-item.h \
up-history-item.h \
......@@ -34,7 +33,6 @@ libupower_glib_la_SOURCES = \
up-types.c \
up-client.c \
up-wakeups.c \
up-qos-item.c \
up-wakeup-item.c \
up-stats-item.c \
up-history-item.c \
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2008-2010 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
#error "Only <upower.h> can be included directly."
#endif
#ifndef __UP_QOS_ITEM_H
#define __UP_QOS_ITEM_H
#include <glib-object.h>
#include <libupower-glib/up-types.h>
G_BEGIN_DECLS
#define UP_TYPE_QOS_ITEM (up_qos_item_get_type ())
#define UP_QOS_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_QOS_ITEM, UpQosItem))
#define UP_QOS_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_QOS_ITEM, UpQosItemClass))
#define UP_IS_QOS_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_QOS_ITEM))
#define UP_IS_QOS_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_QOS_ITEM))
#define UP_QOS_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_QOS_ITEM, UpQosItemClass))
typedef struct UpQosItemPrivate UpQosItemPrivate;
typedef struct
{
GObject parent;
UpQosItemPrivate *priv;
} UpQosItem;
typedef struct
{
GObjectClass parent_class;
} UpQosItemClass;
GType up_qos_item_get_type (void);
UpQosItem *up_qos_item_new (void);
/* accessors */
guint up_qos_item_get_uid (UpQosItem *qos_item);
void up_qos_item_set_uid (UpQosItem *qos_item,
guint uid);
guint up_qos_item_get_pid (UpQosItem *qos_item);
void up_qos_item_set_pid (UpQosItem *qos_item,
guint pid);
const gchar *up_qos_item_get_sender (UpQosItem *qos_item);
void up_qos_item_set_sender (UpQosItem *qos_item,
const gchar *sender);
const gchar *up_qos_item_get_cmdline (UpQosItem *qos_item);
void up_qos_item_set_cmdline (UpQosItem *qos_item,
const gchar *cmdline);
guint up_qos_item_get_cookie (UpQosItem *qos_item);
void up_qos_item_set_cookie (UpQosItem *qos_item,
guint cookie);
guint64 up_qos_item_get_timespec (UpQosItem *qos_item);
void up_qos_item_set_timespec (UpQosItem *qos_item,
guint64 timespec);
gboolean up_qos_item_get_persistent (UpQosItem *qos_item);
void up_qos_item_set_persistent (UpQosItem *qos_item,
gboolean persistent);
UpQosKind up_qos_item_get_kind (UpQosItem *qos_item);
void up_qos_item_set_kind (UpQosItem *qos_item,
UpQosKind type);
gint up_qos_item_get_value (UpQosItem *qos_item);
void up_qos_item_set_value (UpQosItem *qos_item,
gint value);
G_END_DECLS
#endif /* __UP_QOS_ITEM_H */
......@@ -232,41 +232,3 @@ up_device_technology_from_string (const gchar *technology)
return UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE;
return UP_DEVICE_TECHNOLOGY_UNKNOWN;
}
/**
* up_qos_kind_to_string:
*
* Converts a #UpQosKind to a string.
*
* Return value: identifier string
*
* Since: 0.9.0
**/
const gchar *
up_qos_kind_to_string (UpQosKind type)
{
if (type == UP_QOS_KIND_NETWORK)
return "network";
if (type == UP_QOS_KIND_CPU_DMA)
return "cpu_dma";
return NULL;
}
/**
* up_qos_kind_from_string:
*
* Converts a string to a #UpQosKind.
*
* Return value: enumerated value
*
* Since: 0.9.0
**/
UpQosKind
up_qos_kind_from_string (const gchar *type)
{
if (g_strcmp0 (type, "network") == 0)
return UP_QOS_KIND_NETWORK;
if (g_strcmp0 (type, "cpu_dma") == 0)
return UP_QOS_KIND_CPU_DMA;
return UP_QOS_KIND_UNKNOWN;
}
......@@ -83,26 +83,12 @@ typedef enum {
UP_DEVICE_TECHNOLOGY_LAST
} UpDeviceTechnology;
/**
* UpQosKind:
*
* The type of QOS request.
**/
typedef enum {
UP_QOS_KIND_UNKNOWN,
UP_QOS_KIND_NETWORK,
UP_QOS_KIND_CPU_DMA,
UP_QOS_KIND_LAST
} UpQosKind;
const gchar *up_device_kind_to_string (UpDeviceKind type_enum);
const gchar *up_device_state_to_string (UpDeviceState state_enum);
const gchar *up_device_technology_to_string (UpDeviceTechnology technology_enum);
UpDeviceKind up_device_kind_from_string (const gchar *type);
UpDeviceState up_device_state_from_string (const gchar *state);
UpDeviceTechnology up_device_technology_from_string (const gchar *technology);
const gchar *up_qos_kind_to_string (UpQosKind type);
UpQosKind up_qos_kind_from_string (const gchar *type);
G_END_DECLS
......
......@@ -38,7 +38,6 @@
#include <libupower-glib/up-types.h>
#include <libupower-glib/up-client.h>
#include <libupower-glib/up-device.h>
#include <libupower-glib/up-qos-item.h>
#include <libupower-glib/up-history-item.h>
#include <libupower-glib/up-stats-item.h>
#include <libupower-glib/up-wakeup-item.h>
......
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
[encoding: UTF-8]
policy/org.freedesktop.upower.qos.policy.in
src/up-main.c
tools/up-tool.c
polkit_policydir = $(datadir)/polkit-1/actions
polkit_policy_DATA = \
org.freedesktop.upower.qos.policy
# You will need a recent intltool or the patch from this bug
# http://bugzilla.gnome.org/show_bug.cgi?id=462312
@INTLTOOL_POLICY_RULE@
EXTRA_DIST = \
org.freedesktop.upower.qos.policy.in
DISTCLEANFILES = \
org.freedesktop.upower.qos.policy
clean-local :
rm -f *~
-include $(top_srcdir)/git.mk
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<!--
Policy definitions for UPower
Copyright (c) 2008 David Zeuthen <david@fubar.dk>
Copyright (c) 2008-2010 Richard Hughes <richard@hughsie.com>
NOTE: If you make changes to this file, make sure to validate the file
using the polkit-policy-file-validate(1) tool. Changes made to this
file are instantly applied.
-->
<policyconfig>
<vendor>The UPower Project</vendor>
<vendor_url>http://upower.freedesktop.org/</vendor_url>
<icon_name>system-suspend</icon_name>
<action id="org.freedesktop.upower.qos.request-latency">
<_description>Set the required latency of an application</_description>
<_message>Authentication is required to set the required latency of an application</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.upower.qos.request-latency-persistent">
<_description>Set a persistent latency setting</_description>
<_message>Authentication is required to set a persistent latency setting</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.upower.qos.set-minimum-latency">
<_description>Set administrator settings for latency control</_description>
<_message>Authentication is required to set administrator settings for latency control</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
</action>
<action id="org.freedesktop.upower.qos.cancel-request">
<_description>Cancel a latency request</_description>
<_message>Authentication is required to cancel a latency request</_message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
</action>
</policyconfig>
......@@ -29,7 +29,6 @@ UPOWER_LIBS = $(top_builddir)/libupower-glib/libupower-glib.la
BUILT_SOURCES = \
up-daemon-glue.h \
up-device-glue.h \
up-qos-glue.h \
up-kbd-backlight-glue.h \
up-wakeups-glue.h \
up-marshal.h \
......@@ -47,9 +46,6 @@ up-daemon-glue.h: org.freedesktop.UPower.xml Makefile.am
up-device-glue.h: org.freedesktop.UPower.Device.xml Makefile.am
dbus-binding-tool --prefix=up_device --mode=glib-server --output=up-device-glue.h $(srcdir)/org.freedesktop.UPower.Device.xml
up-qos-glue.h: org.freedesktop.UPower.QoS.xml Makefile.am
dbus-binding-tool --prefix=up_qos --mode=glib-server --output=up-qos-glue.h $(srcdir)/org.freedesktop.UPower.QoS.xml
up-kbd-backlight-glue.h: org.freedesktop.UPower.KbdBacklight.xml Makefile.am
dbus-binding-tool --prefix=up_kbd_backlight --mode=glib-server --output=up-kbd-backlight-glue.h $(srcdir)/org.freedesktop.UPower.KbdBacklight.xml
......@@ -62,7 +58,6 @@ dbusifdir = $(datadir)/dbus-1/interfaces
dbusif_DATA = \
org.freedesktop.UPower.xml \
org.freedesktop.UPower.Device.xml \
org.freedesktop.UPower.QoS.xml \
org.freedesktop.UPower.KbdBacklight.xml \
org.freedesktop.UPower.Wakeups.xml
......@@ -75,8 +70,6 @@ upowerd_SOURCES = \
up-device.c \
up-device-list.h \
up-device-list.c \
up-qos.h \
up-qos.c \
up-config.h \
up-config.c \
up-kbd-backlight.h \
......@@ -157,8 +150,6 @@ up_self_test_SOURCES = \
up-device.c \
up-device-list.h \
up-device-list.c \
up-qos.h \
up-qos.c \
up-kbd-backlight.h \
up-kbd-backlight.c \
up-wakeups.h \
......@@ -223,7 +214,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
org.freedesktop.UPower.xml \
org.freedesktop.UPower.Device.xml \
org.freedesktop.UPower.QoS.xml \
org.freedesktop.UPower.KbdBacklight.xml \
org.freedesktop.UPower.Wakeups.xml \
up-marshal.list \
......
This diff is collapsed.
......@@ -19,8 +19,6 @@
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.freedesktop.UPower.Device"
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.freedesktop.UPower.QoS"
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.freedesktop.UPower.KbdBacklight"
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.freedesktop.UPower.Wakeups"
......@@ -30,8 +28,6 @@
send_interface="org.freedesktop.UPower"/>
<allow send_destination="org.freedesktop.UPower"
send_interface="org.freedesktop.UPower.Device"/>
<allow send_destination="org.freedesktop.UPower"
send_interface="org.freedesktop.UPower.QoS"/>
<allow send_destination="org.freedesktop.UPower"
send_interface="org.freedesktop.UPower.KbdBacklight"/>
<allow send_destination="org.freedesktop.UPower"
......
......@@ -38,7 +38,6 @@
#include <dbus/dbus-glib-lowlevel.h>
#include "up-daemon.h"
#include "up-qos.h"
#include "up-kbd-backlight.h"
#include "up-wakeups.h"
......@@ -180,7 +179,6 @@ main (gint argc, gchar **argv)
{
GError *error = NULL;
UpDaemon *daemon = NULL;
UpQos *qos = NULL;
UpKbdBacklight *kbd_backlight = NULL;
UpWakeups *wakeups = NULL;
GOptionContext *context;
......@@ -284,7 +282,6 @@ main (gint argc, gchar **argv)
g_debug ("Starting upowerd version %s", PACKAGE_VERSION);
qos = up_qos_new ();
kbd_backlight = up_kbd_backlight_new ();
wakeups = up_wakeups_new ();
daemon = up_daemon_new ();
......@@ -311,8 +308,6 @@ main (gint argc, gchar **argv)
g_main_loop_run (loop);
retval = 0;
out:
if (qos != NULL)
g_object_unref (qos);
if (kbd_backlight != NULL)
g_object_unref (kbd_backlight);
if (wakeups != NULL)
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __UP_QOS_H
#define __UP_QOS_H
#include <glib-object.h>
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
#define UP_TYPE_QOS (up_qos_get_type ())
#define UP_QOS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_QOS, UpQos))
#define UP_QOS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_QOS, UpQosClass))
#define UP_IS_QOS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_QOS))
#define UP_IS_QOS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_QOS))
#define UP_QOS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_QOS, UpQosClass))
typedef struct UpQosPrivate UpQosPrivate;
typedef struct
{
GObject parent;
UpQosPrivate *priv;
} UpQos;
typedef struct
{
GObjectClass parent_class;
void (* latency_changed) (UpQos *qos,
const gchar *type,
gint value);
void (* requests_changed) (UpQos *qos);
} UpQosClass;
UpQos *up_qos_new (void);
GType up_qos_get_type (void);
void up_qos_test (gpointer user_data);
void up_qos_request_latency (UpQos *qos,
const gchar *type,
gint value,
gboolean persistent,
DBusGMethodInvocation *context);
void up_qos_cancel_request (UpQos *qos,
guint32 cookie,
DBusGMethodInvocation *context);
void up_qos_set_minimum_latency (UpQos *qos,
const gchar *type,
gint value,
DBusGMethodInvocation *context);
gboolean up_qos_get_latency (UpQos *qos,
const gchar *type,
gint *value,
GError **error);
gboolean up_qos_get_latency_requests (UpQos *qos,
GPtrArray **requests,
GError **error);
G_END_DECLS
#endif /* __UP_QOS_H */
......@@ -33,7 +33,6 @@
#include "up-history.h"
#include "up-native.h"
#include "up-polkit.h"
#include "up-qos.h"
#include "up-wakeups.h"
gchar *history_dir = NULL;
......@@ -300,24 +299,6 @@ up_test_polkit_func (void)
g_object_unref (polkit);
}
static void
up_test_qos_func (void)
{
UpQos *qos;
/* needs polkit, which only listens to the system bus */
if (!g_file_test (DBUS_SYSTEM_SOCKET, G_FILE_TEST_EXISTS)) {
puts("No system D-BUS running, skipping test");
return;
}
qos = up_qos_new ();
g_assert (qos != NULL);
/* unref */
g_object_unref (qos);
}
static void
up_test_wakeups_func (void)
{
......@@ -351,7 +332,6 @@ main (int argc, char **argv)
g_test_add_func ("/power/history", up_test_history_func);
g_test_add_func ("/power/native", up_test_native_func);
g_test_add_func ("/power/polkit", up_test_polkit_func);
g_test_add_func ("/power/qos", up_test_qos_func);
g_test_add_func ("/power/wakeups", up_test_wakeups_func);
g_test_add_func ("/power/daemon", up_test_daemon_func);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment