Re: [PATCH v2 RESEND 06/12] conf: Introduce address caching for PCI extensions

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

 



On Tue, 2018-07-10 at 16:02 +0800, Yi Min Zhao wrote:
> This patch provides a caching mechanism for the device address
> extensions uid and fid on S390. For efficient sparse address allocation,
> we introduce two hash tables for uid/fid which hold the address set
> information per domain. Also in order to improve performance of
> searching available value, we introduce our own callbacks for the two
> hashtables. In this way, uid/fid is saved in hash key and hash value
> could be any non-NULL pointer due to no operation on hash value. That is
> also the reason why we don't introduce hash value free callback.

Pretty much assuming your hash table implementation doesn't have
any issues, because I lack the expertise to review it properly :)

Some code style issues below.

[...]
> +static uint32_t virZPCIAddrCode(const void *name, uint32_t seed)

The return type and each of the function arguments should be on
separate lines, like

  static uint32_t
  virZPCIAddrCode(const void *name,
                  uint32_t seed)

[...]
> +static bool virZPCIAddrEqual(const void *namea, const void *nameb)

Same.

[...]
> +static void *virZPCIAddrCopy(const void *name)

Same.

[...]
> +static void virZPCIAddrKeyFree(void *name)

Same.

[...]
> +int
> +virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
> +                                     virDomainPCIAddressExtensionFlags extFlags)
> +{
> +    if (extFlags == VIR_PCI_ADDRESS_EXTENSION_ZPCI) {

This should probably be

  if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI)

since we're dealing with flags, but given the way you end up
calling the function it might be okay as it is.

-- 
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