Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 296524 Details for
Bug 435640
hal doesn't see virtio devices
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Support for virtio devices
hal-virtio.patch (text/plain), 3.86 KB, created by
Jeremy Katz
on 2008-03-02 21:44:01 UTC
(
hide
)
Description:
Support for virtio devices
Filename:
MIME Type:
Creator:
Jeremy Katz
Created:
2008-03-02 21:44:01 UTC
Size:
3.86 KB
patch
obsolete
>diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml >index 34e700d..131335f 100644 >--- a/doc/spec/hal-spec-properties.xml >+++ b/doc/spec/hal-spec-properties.xml >@@ -2870,6 +2870,40 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'} > </tgroup> > </informaltable> > </sect2> >+ >+ <sect2 id="device-properties-virtio"> >+ <title> >+ virtio namespace >+ </title> >+ <para> >+ Devices on the VirtIO bus are represented by device >+ objects where <literal>info.subsystem</literal> equals >+ <literal>virtio</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>virtio.id</literal> (string) >+ </entry> >+ <entry>example: serial</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 6c28d83..7e621b8 100644 >--- a/hald/linux/device.c >+++ b/hald/linux/device.c >@@ -3509,6 +3509,52 @@ ps3_system_bus_compute_udi (HalDevice *d) > /*--------------------------------------------------------------------------------------------------------------*/ > > static HalDevice * >+virtio_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", "virtio"); >+ hal_device_property_set_string (d, "info.bus", "virtio"); >+ 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, "virtio.id", dev_id); >+ >+ g_snprintf (buf, sizeof (buf), "VirtIO Device (%s)", hal_device_property_get_string (d, "virtio.id")); >+ hal_device_property_set_string (d, "info.product", buf); >+ >+ return d; >+} >+ >+static gboolean >+virtio_compute_udi (HalDevice *d) >+{ >+ gchar udi[256]; >+ >+ hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi), >+ "/org/freedesktop/Hal/devices/virtio_%s", >+ hal_device_property_get_string (d, "virtio.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; >@@ -3862,6 +3908,14 @@ static DevHandler dev_handler_ps3_system_bus = > .remove = dev_remove > }; > >+static DevHandler dev_handler_virtio = >+{ >+ .subsystem = "virtio", >+ .add = virtio_add, >+ .compute_udi = virtio_compute_udi, >+ .remove = dev_remove >+}; >+ > /* SCSI debug, to test thousends of fake devices */ > static DevHandler dev_handler_pseudo = { > .subsystem = "pseudo", >@@ -3907,6 +3961,7 @@ static DevHandler *dev_handlers[] = { > &dev_handler_power_supply, > &dev_handler_drm, > &dev_handler_ps3_system_bus, >+ &dev_handler_virtio, > NULL > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435640
: 296524