On Wed, Jan 16, 2019 at 12:01:00PM +0100, Andrea Bolognani wrote: > On Tue, 2019-01-15 at 17:06 +0000, Daniel P. Berrangé wrote: > > virDomainNetDef is a mess because it *still* doesn't use a enum > > for the device model :-( We really must fix that rather than > > blindly allowing arbitrary passthrough of hypervisor specific > > names. > > > > I recall Laine had patches for this some 4/5 years ago, but > > can't remember why we never merged them. > > Based on what I can recall from my own, more recent, attempt at > fixing the mess, the main blocker was that in order to keep > accepting all existing configurations you'd basically have to > still store the model as a string and only at a later time > convert it to an enum. The enum should cover all existing reasonably expected configs. Sure I imagine we might miss a few, especially for obscure architectures or hypervisors, but that would just be bugs to be fixed > So you'd end up making the code more complicated rather than > simpler which, needless to say, makes the idea way less > attractive :( The key point of using an enum is to ensure that our esx/qemu/parallels drivers all guaranteed to use the same model names, which a core benefit that libvirt is supposed to be adding for applications. 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 :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list