Re: [PATCH v2 2/3] util: enum: Add NULL 'label' arg VIR_ENUM_IMPL calls

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

 



On 4/16/19 8:32 AM, Peter Krempa wrote:
On Mon, Apr 15, 2019 at 17:26:41 -0400, Cole Robinson wrote:
Allow passing in a 'label' string for raising errors from
ToString/FromString calls. Adjust all VIR_ENUM_IMPL calls to
pass in NULL to disable error reporting. We will add strings at
a later time.

I think that rather than changing every single VIR_ENUM_IMPL you should
rather add VIR_ENUM_IMPL_TYPE or VIR_ENUM_IMPL_MSG or something like
that which will allow to use the type string.

That way it will also be far simpler to identify the places which need
fixing.

Yes, that sounds like a better idea. For instance:

VIR_ENUM_IMPL_TYPE(virDomainVirt,
                   _("invalid domain type %s"),
                   VIR_DOMAIN_VIRT_LAST,
                   "none",
                   "qemu",
                   ...
);


Moreover, after all enums are converted then we can drop the _TYPE or _MSG suffix.

Michal

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

  Powered by Linux