Re: [v3 02/14] Split virDomainControllerModel to virDomainControllerModelSCSI

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

 



On Fri, Sep 02, 2011 at 03:18:12AM +0200, Marc-André Lureau wrote:
> ---
>  src/conf/domain_conf.c   |   26 +++++++++++++++++++++++---
>  src/conf/domain_conf.h   |   18 ++++++++++--------
>  src/esx/esx_driver.c     |    8 ++++----
>  src/libvirt_private.syms |    4 ++--
>  src/vmx/vmx.c            |   32 ++++++++++++++++----------------
>  tests/xml2vmxtest.c      |    2 +-
>  6 files changed, 56 insertions(+), 34 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index ce1f3c5..5e91d54 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -195,7 +195,7 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
>                "virtio-serial",
>                "ccid")
>  
> -VIR_ENUM_IMPL(virDomainControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST,
> +VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST,
>                "auto",
>                "buslogic",
>                "lsilogic",
> @@ -2455,6 +2455,16 @@ no_memory:
>  }
>  
>  
> +static int
> +virDomainControllerModelTypeFromString(const virDomainControllerDefPtr def,
> +                                       const char *model)
> +{
> +    if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
> +        return virDomainControllerModelSCSITypeFromString(model);
> +
> +    return -1;
> +}
> +
>  /* Parse the XML definition for a controller
>   * @param node XML nodeset to parse for controller definition
>   */
> @@ -2492,7 +2502,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
>  
>      model = virXMLPropString(node, "model");
>      if (model) {
> -        if ((def->model = virDomainControllerModelTypeFromString(model)) < 0) {
> +        if ((def->model = virDomainControllerModelTypeFromString(def, model)) < 0) {
>              virDomainReportError(VIR_ERR_INTERNAL_ERROR,
>                                   _("Unknown model type '%s'"), model);
>              goto error;
> @@ -8733,6 +8743,16 @@ virDomainDiskDefFormat(virBufferPtr buf,
>      return 0;
>  }
>  
> +static const char *
> +virDomainControllerModelTypeToString(virDomainControllerDefPtr def,
> +                                     int model)
> +{
> +    if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
> +        return virDomainControllerModelSCSITypeToString(model);
> +
> +    return NULL;
> +}
> +
>  static int
>  virDomainControllerDefFormat(virBufferPtr buf,
>                               virDomainControllerDefPtr def,
> @@ -8748,7 +8768,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
>      }
>  
>      if (def->model != -1) {
> -        model = virDomainControllerModelTypeToString(def->model);
> +        model = virDomainControllerModelTypeToString(def, def->model);
>  
>          if (!model) {
>              virDomainReportError(VIR_ERR_INTERNAL_ERROR,
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 2cc9b06..8a4cd11 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -257,14 +257,16 @@ enum virDomainControllerType {
>  };
>  
>  
> -enum virDomainControllerModel {
> -    VIR_DOMAIN_CONTROLLER_MODEL_AUTO,
> -    VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC,
> -    VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC,
> -    VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068,
> -    VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI,
> +enum virDomainControllerModelSCSI {
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO,
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC,
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC,
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068,
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI,
> +
> +    VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST
> +};
>  
> -    VIR_DOMAIN_CONTROLLER_MODEL_LAST
>  };

  Hum, I had to remove that extra }; there :-)

>  typedef struct _virDomainVirtioSerialOpts virDomainVirtioSerialOpts;

  fine otherwise !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]