[virt-tools-list] [[libosinfo][PATCH] 2/5] RNG: Allow devices to have new elements

Daniel P. Berrange berrange at redhat.com
Fri Sep 21 09:51:46 UTC 2012


On Mon, Sep 17, 2012 at 05:12:32PM +0200, Michal Privoznik wrote:
> product, subsystem and driver.
> ---
>  data/schemas/libosinfo.rng |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
> index e9fe643..5f61287 100644
> --- a/data/schemas/libosinfo.rng
> +++ b/data/schemas/libosinfo.rng
> @@ -75,6 +75,16 @@
>              <ref name='hexid'/>
>            </element>
>          </optional>
> +        <optional>
> +          <element name='product'>
> +            <text/>
> +          </element>
> +        </optional>
> +        <optional>
> +          <element name='subsystem'>
> +            <text/>
> +          </element>
> +        </optional>
>        </interleave>
>      </element>
>    </define>

I don't think this is right on its own. In the API we define the following
possible data elements for <device>

#define OSINFO_DEVICE_PROP_VENDOR     "vendor"
#define OSINFO_DEVICE_PROP_VENDOR_ID  "vendor-id"
#define OSINFO_DEVICE_PROP_PRODUCT    "product"
#define OSINFO_DEVICE_PROP_PRODUCT_ID "product-id"
#define OSINFO_DEVICE_PROP_NAME       "name"
#define OSINFO_DEVICE_PROP_CLASS      "class"
#define OSINFO_DEVICE_PROP_BUS_TYPE   "bus-type"

The problem is that the schema and XML files, have mistakenly using
<device> and <device-id> instead of <product> and <product-id> as
the child elements.

Meanwhile <subsystem> is shown in our example XML, but never used in
the code.

So I think you need to:

 - Change example XML to use <product> and <product-id>
 - Add property in osinfo_device.{c,h} for subsystem
 - Extend loader.c to deal with <subsystem>
 - Add subsystem to the RNG

> @@ -169,6 +179,11 @@
>            <attribute name='id'>
>              <ref name='url'/>
>            </attribute>
> +          <optional>
> +            <element name='driver'>
> +              <text/>
> +            </element>
> +          </optional>
>          </element>
>        </zeroOrMore>
>      </element>

ACK to this part, since it matches what osinfo_loader.c parses.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list