[libvirt] [PATCH 4/4] Add string labels to all VIR_ENUM_IMPL calls
Daniel P. Berrangé
berrange at redhat.com
Thu Apr 11 10:58:50 UTC 2019
On Mon, Apr 08, 2019 at 11:48:19AM -0400, Cole Robinson wrote:
> Add string labels to all VIR_ENUM_IMPL calls, which will be used
> to eventually raise errors from virEnum*String functions.
>
> I roughly tried to follow these rules:
>
> 1) If it's an internal only enum, try to uniquely describe it
> 2) If it's for user XML values, make the label match the XML value
> names, defaulting to '$elementname $attrname'. For example,
> virDomainVirtType gets 'domain type' because it maps to the
> <domain type=X> attribute.
> 3) If #2 is too ambiguous like for similar XML but for different
> devices, insert the device name too.
>
> Not everything fits cleanly though
>
> Note: this patch will be combined with the previous patch when pushing
>
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> diff --git a/src/access/viraccessperm.c b/src/access/viraccessperm.c
> index 67f751ef9c..1772eea287 100644
> --- a/src/access/viraccessperm.c
> +++ b/src/access/viraccessperm.c
> @@ -23,7 +23,7 @@
> #include "viraccessperm.h"
>
>
> -VIR_ENUM_IMPL(virAccessPermConnect,
> +VIR_ENUM_IMPL(virAccessPermConnect, "access connect",
So it has saved translater time by not translating any of the
strings here.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list