qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 0/9] Virtio cleanups


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH 0/9] Virtio cleanups
Date: Thu, 18 Mar 2010 15:07:24 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 03/18/2010 11:36 AM, Gerd Hoffmann wrote:
  Hi,

But I still think that this is independent that VirtIO being 1st (or
not) memer of VirtIOBlock.

There is no strong reason for this other than memory allocation. As long as virtio_common_init() does the allocation there is no way around VirtIODevice being the first member. If this changes (and we must change it if we want embed VirtIODevice and superclasses into other structs) no reason is left.

Just changing it for the snake of change isn't a good reason either. But if it helps cleaning the code we can change it without running into trouble. You can't cast VirtIODevice to VirtIOBlock any more, but you don't really want to anyway for type checking reasons.

It's almost certainly not worth the effort, but the proper way to model is it probably to have a VirtioIOPCIBus that is a PCIDevice. The VirtIOPCIBus then creates a single VirtIODevice. The VirtIODevice would then take a VirtioTransport which would be implemented as part of the VirtIOPCIBus.

Regards,

Anthony Liguori

cheers,
  Gerd







reply via email to

[Prev in Thread] Current Thread [Next in Thread]