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

Re: [libvirt] [PATCH 1/3] qemuBuildDeviceAddressStr() checks for QEMUD_CMD_FLAG_PCI_MULTIBUS



On 02/01/2011 09:22 AM, Niels de Vos wrote:
> -        virBufferVSprintf(buf, ",bus=pci.0,addr=0x%x", info->addr.pci.slot);
> +        if (qemuCmdFlags & QEMUD_CMD_FLAG_PCI_MULTIBUS)
> +            virBufferVSprintf(buf, ",bus=pci.0,addr=0x%x", info->addr.pci.slot);
> +        else
> +            virBufferVSprintf(buf, ",bus=pci,addr=0x%x", info->addr.pci.slot);

I probably would have done:

virBufferVSprintf(buf, ",bus=pci%s,addr=0x%x",
                  qemuCmdFlags & QEMU_CMD_FLAG_PCI_MULTIBUS ? ".0", "",
                  info->addr.pci.slot);

to avoid the if/else, but that's not worth changing.

Agree with danpb's ack.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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