[libvirt] [RFC 02/12] Add USB controller models

Daniel P. Berrange berrange at redhat.com
Mon Aug 22 17:09:35 UTC 2011


On Sun, Aug 21, 2011 at 10:01:13PM +0300, Marc-André Lureau wrote:
> ---
>  docs/schemas/domain.rng |    8 ++++++++
>  src/conf/domain_conf.c  |   10 +++++++++-
>  src/conf/domain_conf.h  |    8 ++++++++
>  src/vmx/vmx.c           |   12 +++++++++++-
>  4 files changed, 36 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
> index dd8c41a..34208c5 100644
> --- a/docs/schemas/domain.rng
> +++ b/docs/schemas/domain.rng
> @@ -909,6 +909,14 @@
>              <value>lsilogic</value>
>              <value>lsisas1068</value>
>              <value>vmpvscsi</value>
> +            <value>piix3-uhci</value>
> +            <value>piix4-uhci</value>
> +            <value>ehci</value>
> +            <value>ich9-ehci1</value>
> +            <value>ich9-uhci1</value>
> +            <value>ich9-uhci2</value>
> +            <value>ich9-uhci3</value>
> +            <value>vt82c686b-uhci</value>
>            </choice>
>          </attribute>
>        </optional>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index ce1f3c5..6e83003 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -200,7 +200,15 @@ VIR_ENUM_IMPL(virDomainControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST,
>                "buslogic",
>                "lsilogic",
>                "lsisas1068",
> -              "vmpvscsi")
> +              "vmpvscsi",
> +              "piix3-uhci",
> +              "piix4-uhci",
> +              "ehci",
> +              "ich9-ehci1",
> +              "ich9-uhci1",
> +              "ich9-uhci2",
> +              "ich9-uhci3",
> +              "vt82c686b-uhci")
>  
>  VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
>                "mount",
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 2cc9b06..ca88254 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -263,6 +263,14 @@ enum virDomainControllerModel {
>      VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC,
>      VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068,
>      VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI,
> +    VIR_DOMAIN_CONTROLLER_MODEL_PIIX3_UHCI,
> +    VIR_DOMAIN_CONTROLLER_MODEL_PIIX4_UHCI,
> +    VIR_DOMAIN_CONTROLLER_MODEL_EHCI,
> +    VIR_DOMAIN_CONTROLLER_MODEL_ICH9_EHCI1,
> +    VIR_DOMAIN_CONTROLLER_MODEL_ICH9_UHCI1,
> +    VIR_DOMAIN_CONTROLLER_MODEL_ICH9_UHCI2,
> +    VIR_DOMAIN_CONTROLLER_MODEL_ICH9_UHCI3,
> +    VIR_DOMAIN_CONTROLLER_MODEL_VT82C686B_UHCI,
>  
>      VIR_DOMAIN_CONTROLLER_MODEL_LAST
>  };

The current model handling code here is a little dodgy.

Those existing models are only valid for type=scsi, so
we should only be parsing the 'model' attribute for that
type.

We should rename that existing enum to 

   virDomainControllerSCSIModel

and create a new enum 

   virDomainControllerUSBModel

and make sure to call the right one at the right place.


-- 
|: 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 libvir-list mailing list