Re: [PATCH v3 1/8] conf: use struct instead of int for each slot in virDomainPCIAddressBus

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

 



On Mon, 2016-12-19 at 10:23 -0500, Laine Stump wrote:
> When keeping track of which functions of which slots are allocated, we
> will need to have more information than just the current bitmap with a
> bit for each function that is currently stored for each slot in a
> virDomainPCIAddressBus. To prepare for adding more per-slot info, this
> patch changes "int slots" into "virDomainPCIAddressSlot slot", which

The original struct member was uint8_t rather than int.

I also don't agree with the name change: "slots" is already a
perfectly good name for an array of "virDomainPCIAddressSlot"s.

[...]
> @@ -653,7 +653,8 @@ int
>  virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
>                                 virPCIDeviceAddressPtr addr)
>  {
> -    addrs->buses[addr->bus].slots[addr->slot] &= ~(1 << addr->function);
> +    addrs->buses[addr->bus].slot[addr->slot].functions
> +       &= ~(1 << addr->function);

Keep this on a single line.

[...]
> @@ -71,6 +71,13 @@ virDomainPCIConnectFlags
>  virDomainPCIControllerModelToConnectType(virDomainControllerModelPCI model);
>  
>  typedef struct {
> +    /* each function is represented by one it, set if that function is

s/by one it/by one bit/

> +     * in use by a device, or clear if it isn't.
> +     */
> +    uint8_t functions;
> +    } virDomainPCIAddressSlot;

Weird indentation here.


ACK with the nits fixed.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
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]
  Powered by Linux