[libvirt] [PATCH 17/18] qemu: Support virtio-serial controller model=virtio-{non-}transitional

Andrea Bolognani abologna at redhat.com
Wed Jan 23 11:34:59 UTC 2019


On Tue, 2019-01-22 at 12:46 -0500, Cole Robinson wrote:
> On 01/21/2019 11:59 AM, Andrea Bolognani wrote:
> > On Thu, 2019-01-17 at 12:52 -0500, Cole Robinson wrote:
> > [...]
> > > +typedef enum {
> > > +    VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_DEFAULT = -1,
> > > +    VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO,
> > > +    VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_TRANSITIONAL,
> > > +    VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_NON_TRANSITIONAL,
> > > +
> > > +    VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_LAST
> > > +} virDomainControllerModelVirtioSerial;
> > 
> > Do we even need MODEL_VIRTIO_SERIAL_DEFAULT here? Honest question :)
> 
> The DEFAULT = -1 is the pattern used by other controller models, and I
> believe it's kinda enforced by ControllerDefNew which sets cont->model =
> -1. It might not serve any purpose in this particular case besides
> consistency.

I see.

> Working in this area made me explore enum DEFAULT/NONE naming a bit and
> there's definitely a lot of room for making things consistent.
> controller models are the oddball here with the -1 value but I think
> that's to do with some old XML migration compat that can be unwound in a
> different way. Another task for another day

Definitely :)

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list