rpms/hal/devel hal-0.5.11-vio.patch,NONE,1.1 hal.spec,1.145,1.146
David Zeuthen (davidz)
fedora-extras-commits at redhat.com
Wed Mar 5 16:20:34 UTC 2008
Author: davidz
Update of /cvs/pkgs/rpms/hal/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18044
Modified Files:
hal.spec
Added Files:
hal-0.5.11-vio.patch
Log Message:
* Wed Mar 5 2008 David Zeuthen <davidz at redhat.com> - 0.5.11-0.git20080304.3%{?dist}
- vio support (#431045, thanks dwmw2)
hal-0.5.11-vio.patch:
--- NEW FILE hal-0.5.11-vio.patch ---
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 1fd72b6..afad7c6 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -2993,6 +2993,40 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
</tgroup>
</informaltable>
</sect2>
+
+ <sect2 id="device-properties-vio">
+ <title>
+ virtio namespace
+ </title>
+ <para>
+ Devices on the IBM pSeries/iSeries 'vio' bus are represented
+ by device objects where <literal>info.subsystem</literal>
+ equals <literal>vio</literal>. The following properties are
+ available for such device objects.
+ </para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Key (type)</entry>
+ <entry>Values</entry>
+ <entry>Mandatory</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <literal>vio.id</literal> (string)
+ </entry>
+ <entry>example: 30000003</entry>
+ <entry>Yes</entry>
+ <entry>Device identification</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </sect2>
</sect1>
<sect1 id="properties-functional">
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 1026b2a..e4aae0c 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3610,6 +3610,52 @@ virtio_compute_udi (HalDevice *d)
/*--------------------------------------------------------------------------------------------------------------*/
static HalDevice *
+vio_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_dev,
+ const gchar *sysfs_path_in_devices)
+{
+ HalDevice *d;
+ const gchar *dev_id;
+ gchar buf[64];
+
+ d = hal_device_new ();
+ hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "vio");
+ hal_device_property_set_string (d, "info.bus", "vio");
+ if (parent_dev != NULL) {
+ hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ } else {
+ hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
+ }
+
+ hal_util_set_driver (d, "info.linux.driver", sysfs_path);
+
+ dev_id = hal_util_get_last_element (sysfs_path);
+
+ hal_device_property_set_string (d, "vio.id", dev_id);
+
+ g_snprintf (buf, sizeof (buf), "Vio Device (%s)", hal_device_property_get_string (d, "vio.id"));
+ hal_device_property_set_string (d, "info.product", buf);
+
+ return d;
+}
+
+static gboolean
+vio_compute_udi (HalDevice *d)
+{
+ gchar udi[256];
+
+ hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+ "/org/freedesktop/Hal/devices/vio_%s",
+ hal_device_property_get_string (d, "vio.id"));
+ hal_device_set_udi (d, udi);
+ hal_device_property_set_string (d, "info.udi", udi);
+
+ return TRUE;
+}
+
+/*--------------------------------------------------------------------------------------------------------------*/
+
+static HalDevice *
pseudo_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_dev, const gchar *parent_path)
{
HalDevice *d;
@@ -3977,6 +4023,14 @@ static DevHandler dev_handler_virtio =
.remove = dev_remove
};
+static DevHandler dev_handler_vio =
+{
+ .subsystem = "vio",
+ .add = vio_add,
+ .compute_udi = vio_compute_udi,
+ .remove = dev_remove
+};
+
/* SCSI debug, to test thousends of fake devices */
static DevHandler dev_handler_pseudo = {
.subsystem = "pseudo",
@@ -4024,6 +4078,7 @@ static DevHandler *dev_handlers[] = {
&dev_handler_drm,
&dev_handler_ps3_system_bus,
&dev_handler_virtio,
+ &dev_handler_vio,
NULL
};
Index: hal.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal/devel/hal.spec,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- hal.spec 4 Mar 2008 20:12:02 -0000 1.145
+++ hal.spec 5 Mar 2008 16:19:57 -0000 1.146
@@ -26,9 +26,10 @@
Summary: Hardware Abstraction Layer
Name: hal
Version: 0.5.11
-Release: 0.git20080304.2%{?dist}
+Release: 0.git20080304.3%{?dist}
URL: http://www.freedesktop.org/Software/hal
Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.git20080304.2.tar.gz
+Patch0: hal-0.5.11-vio.patch
License: AFL/GPL
Group: System Environment/Libraries
@@ -121,6 +122,7 @@
%prep
%setup -q
+%patch0 -p1 -b .vio
%build
%configure --enable-docbook-docs --docdir=%{_datadir}/doc/%{name}-%{version} --with-os-type=redhat --enable-console-kit --enable-policy-kit --enable-acl-management --enable-umount-helper --enable-acpi-ibm --enable-acpi-toshiba --with-eject=/usr/sbin/eject
@@ -236,6 +238,9 @@
%{_datadir}/gtk-doc/html/libhal-storage/*
%changelog
+* Wed Mar 5 2008 David Zeuthen <davidz at redhat.com> - 0.5.11-0.git20080304.3%{?dist}
+- vio support (#431045, thanks dwmw2)
+
* Tue Mar 4 2008 David Zeuthen <davidz at redhat.com> - 0.5.11-0.git20080304.2%{?dist}
- Another git snapshot
More information about the fedora-extras-commits
mailing list