qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 0/10] qdev patches.


From: Avi Kivity
Subject: Re: [Qemu-devel] Re: [PATCH 0/10] qdev patches.
Date: Mon, 22 Jun 2009 12:36:58 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 06/22/2009 12:15 PM, Gerd Hoffmann wrote:
On 06/19/09 19:51, Paul Brook wrote:
* qdev: update pci device registration

I dislike passing an {array,length} pair. Especially when it requires every
user to manually get the right length.

qemu has a ARRAY_SIZE macro which can be used like this:
(from uhci patch):

    pci_qdev_register(uhci_info, ARRAY_SIZE(uhci_info));

to get the right length, so I don't see this as a problem.

I can create pci_qdev_register_{single,array} macros to hide the length parameter. I can also just drop the length argument and just use multiple calls in the (few) places where multiple drivers are registered at once. What do you prefer?

There's a third alternative, zero terminating the array.

If most calls register one qdev, I'd prefer pci_qdev_register() and pci_qdev_register_many().

--
error compiling committee.c: too many arguments to function





reply via email to

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