qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 04/23] qdev: Allow device addressing via 'dri


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v4 04/23] qdev: Allow device addressing via 'driver.instance'
Date: Wed, 23 Jun 2010 11:10:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

[cc: kraxel]

Jan Kiszka <address@hidden> writes:

> From: Jan Kiszka <address@hidden>
>
> Extend qbus_find_dev to allow addressing of devices without an unique id
> via an optional per-bus instance number. The new formats are
> 'driver.instance' and 'alias.instance'. Attach this name extension
> whenever an instantiated device is printed.
>
> Signed-off-by: Jan Kiszka <address@hidden>

The instance number repairs the specific problem created by the previous
patch.  My objection to it on general principles stands.

That said, I'm neutral on the instance number feature.  Instance numbers
are not suitable where address stability is needed (see debate on
canonical addresses), but they might be convenient for interactive use.

There is some functional overlap to the address@hidden syntax
proposed elsewhere.  Especially visible for buses where the bus-address
is a small integer.  Could be confusing.

There is some conceptual overlap with the .NUMBER in default bus names
(see qbus_create_inplace()).  Instance numbers count for each name
independently.  Numbers in default bus names count for all names.  But I
think we agree the latter sucks.  Paul wants us to get rid of it.

> ---
>  docs/qdev-device-use.txt |   13 +++++++++++-
>  hw/qdev.c                |   48 +++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 51 insertions(+), 10 deletions(-)
>
> diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
> index f252c8e..58f2630 100644
> --- a/docs/qdev-device-use.txt
> +++ b/docs/qdev-device-use.txt
> @@ -1,6 +1,6 @@
>  = How to convert to -device & friends =
>  
> -=== Specifying Bus and Address on Bus ===
> +=== Specifying Bus, Address on Bus, and Devices ===
>  
>  In qdev, each device has a parent bus.  Some devices provide one or
>  more buses for children.  You can specify a device's parent bus with
> @@ -20,6 +20,17 @@ bus named pci.0.  To put a FOO device into its slot 4, use 
> -device
>  FOO,bus=/i440FX-pcihost/pci.0,addr=4.  The abbreviated form bus=pci.0
>  also works as long as the bus name is unique.
>  
> +Existing devices can be addressed either via a unique ID if it was
> +assigned during creation or via the device tree path:
> +
> +/full_bus_address/driver_name[.instance_number]
> +
> +The instance number counts devices managed by the same driver on a
> +specifc bus. It is zero-based.
   ~~~~~~~ typo

> +
> +Example: /i440FX-pcihost/pci.0/e1000.1 addresses the second e1000
> +adapter on the bus 'pci.0'.
> +
>  Note: the USB device address can't be controlled at this time.
>  
>  === Block Devices ===
[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]