[libvirt] [PATCH] conf: Fix initialization value of 'multi' in PCI address

Martin Kletzander mkletzan at redhat.com
Tue Aug 9 09:19:00 UTC 2016


On Tue, Aug 09, 2016 at 10:49:04AM +0200, Xian Han Yu wrote:
>Signed-off-by: Xian Han Yu <xhyubj at linux.vnet.ibm.com>
>---

You could've been more descriptive in the commit message.  Like
describing what's the reason for this change?  Just to initialize bool
to 'false' instead 0?  Is there something more to it?

> src/conf/node_device_conf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
>index a23d8ef..96fdb6f 100644
>--- a/src/conf/node_device_conf.c
>+++ b/src/conf/node_device_conf.c
>@@ -1163,7 +1163,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
>         goto cleanup;
>
>     for (i = 0; i < nAddrNodes; i++) {
>-        virPCIDeviceAddress addr = { 0, 0, 0, 0, 0 };
>+        virPCIDeviceAddress addr = { 0, 0, 0, 0, false };

Honestly, I have no idea what preferences we have for such
initializations, but I for one prefer initialization to '{0}' which
guarantees everything to be zeroed anyway.  And will be readable the
same way even when we change the structure.  Would that work for you as
well?

>         if (virPCIDeviceAddressParseXML(addrNodes[i], &addr) < 0)
>             goto cleanup;
>         if (VIR_ALLOC(pciAddr) < 0)
>--
>2.5.5
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20160809/e3ed96a1/attachment-0001.sig>


More information about the libvir-list mailing list