[libvirt] [PATCH 01/13] qemu: refactor qemuBuildControllerDevStr to eliminate future duplicate code

Ján Tomko jtomko at redhat.com
Wed Jun 24 08:52:39 UTC 2015


On Mon, Jun 22, 2015 at 02:44:06PM -0400, Laine Stump wrote:
> The PCI case of the switch statement in this function contains another
> switch statement with a case for each model. Currently every model
> except pci-root and pcie-root have a check for index > 0 (since only

every model has

> those two can have index==0), and the function should never be called
> for those two anyway. If we move the check for !pci[e]-root to the top
> of the pci case, then we can move the check for index > 0 out of the
> individual model cases. This will save repeating that check for the
> three new controller models about to be added.
> ---
>  src/qemu/qemu_command.c | 27 ++++++++++++---------------
>  1 file changed, 12 insertions(+), 15 deletions(-)
> 

ACK

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150624/1dd4c009/attachment-0001.sig>


More information about the libvir-list mailing list