On Thu, 19 Feb 2015 11:29:27 +0100
"Michael S. Tsirkin" <address@hidden> wrote:
On Thu, Feb 19, 2015 at 01:23:03PM +0300, Denis V. Lunev wrote:
The problem is code duplication: all transports need to know
about these balloon-specific property.
Why isn't it handled by virtio_instance_init_common?
why it should?
virtio_instance_init_common is common for all virtio devices
including VirtIO net, VirtIO block, VirtIO SCSI. Thus the patch
move initialization of all common stuff into the common
code.
The problem seems common enough, virtio_instance_init_common
already works for all properties, why not for these ones?
It only works for the properties that are common amongst transports and
all devices.
Adding a virtio_balloon_init_common() that adds the guest_stats (or a
virtio_rng_init_common() that adds rng) is probably not a bad idea, but
I'd prefer it as patches on top of these.