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

Re: [libvirt] [libvirt-glib 2/3] gconfig: Add GVirConfigDomainSnapshotDisk getters/setters



On Thu, May 2, 2013 at 6:36 PM, Christophe Fergeau <cfergeau redhat com> wrote:
> On Thu, May 02, 2013 at 06:22:14PM +0300, Zeeshan Ali (Khattak) wrote:
>> On Wed, May 1, 2013 at 10:59 PM, Christophe Fergeau <cfergeau redhat com> wrote:
>> > +
>> > +
>> > +const char *gvir_config_domain_snapshot_disk_get_driver_type(GVirConfigDomainSnapshotDisk *disk)
>>
>> Shouldn't 'driver_type' be an enum?
>
> libvirt is storing it internally as a string, see
> http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/conf/snapshot_conf.c;h=5b54a28a596aef0bb883dfe12ca5c2f300a48999;hb=HEAD#l130
> libvirt-gconfig generally follows what libvirt does when it comes to
> choosing between strings and enums.

I don't think that is true cause I see examples of enum setter/getters
that translate to strings in libvirt xml. e.g GVirConfigDomainOsType,
GVirConfigDomainOsSmBiosMode and GVirConfigDomainOsBootDevice.

If we go with string option, I suggest we provide #defines for known
values and document here that these can be used. Which in the end is
not very diff from using enums from app POV.

--
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


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