Re: [PATCH 1/7] qemu: QEMU_PCI constant consistency

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

 



On 04/03/2013 11:50 AM, Ján Tomko wrote:
> Change QEMU_PCI_ADDRESS_LAST_SLOT to the number of slots in the bus,
> not the maximum slot value, to match QEMU_PCI_ADDRESS_LAST_FUNCTION.
> ---

If you want to be *really* consistent, you should rename these to
VIR_QEMU_PCI_ADDRESS_SLOT_LAST and VIR_QEMU_PCI_ADDRESS_FUNCTION_LAST :-)

(i.e. start with "VIR_" and put "LAST" at the end)

>  src/qemu/qemu_command.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 693d30d..8321dcd 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1185,7 +1185,7 @@ cleanup:
>      return ret;
>  }
>  
> -#define QEMU_PCI_ADDRESS_LAST_SLOT 31
> +#define QEMU_PCI_ADDRESS_LAST_SLOT 32
>  #define QEMU_PCI_ADDRESS_LAST_FUNCTION 8
>  struct _qemuDomainPCIAddressSet {
>      virHashTablePtr used;
> @@ -1536,8 +1536,8 @@ qemuDomainPCIAddressGetNextSlot(qemuDomainPCIAddressSetPtr addrs,
>      char *addr;
>  
>      tmp_addr.slot++;
> -    for (i = 0; i <= QEMU_PCI_ADDRESS_LAST_SLOT; i++, tmp_addr.slot++) {
> -        if (QEMU_PCI_ADDRESS_LAST_SLOT < tmp_addr.slot) {
> +    for (i = 0; i < QEMU_PCI_ADDRESS_LAST_SLOT; i++, tmp_addr.slot++) {
> +        if (QEMU_PCI_ADDRESS_LAST_SLOT <= tmp_addr.slot) {
>              tmp_addr.slot = 0;
>          }
>  

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]