Re: [PATCH 1/4] Fix error messages codes when TypeFromString fails

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

 



On 05/18/2011 11:46 AM, Michal Privoznik wrote:
> ---
>  src/conf/cpu_conf.c                |    4 +-
>  src/conf/domain_conf.c             |  100 ++++++++++++++++++-----------------
>  src/conf/interface_conf.c          |    2 +-
>  src/conf/network_conf.c            |    2 +-
>  src/conf/node_device_conf.c        |    4 +-
>  src/conf/nwfilter_conf.c           |    6 +-
>  src/conf/secret_conf.c             |    2 +-
>  src/conf/storage_conf.c            |    2 +-
>  src/conf/storage_encryption_conf.c |    4 +-
>  9 files changed, 64 insertions(+), 62 deletions(-)
> 

Maybe we should make ToString raise the error for us? The VIR_ENUM_DECL
in domain_conf.h could pass in an error message like _("unknown CPU
match value"), and virEnumToString could do the failure checking for us,
append   " '%s'", type

Besides reducing code it would also make the error messages actually
consistent.

Thanks,
Cole

--
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]