From 3ae376535a1c234aa41c74c642b942731c06777b Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 4 Oct 2022 16:47:38 +0200 Subject: [PATCH] virNodeDeviceCapPCIDefFormat: Use %u for unsigned values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'bus', 'slot' and 'function' are unsigned int variables parsed as unsigned int, but were formated as signed. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/conf/node_device_conf.c | 6 +++--- tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 712d768e4a..b882fcfbe8 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -323,10 +323,10 @@ virNodeDeviceCapPCIDefFormat(virBuffer *buf, virBufferAsprintf(buf, "0x%.6x\n", data->pci_dev.klass); virBufferAsprintf(buf, "%d\n", data->pci_dev.domain); - virBufferAsprintf(buf, "%d\n", data->pci_dev.bus); - virBufferAsprintf(buf, "%d\n", + virBufferAsprintf(buf, "%u\n", data->pci_dev.bus); + virBufferAsprintf(buf, "%u\n", data->pci_dev.slot); - virBufferAsprintf(buf, "%d\n", + virBufferAsprintf(buf, "%u\n", data->pci_dev.function); virBufferAsprintf(buf, "pci_dev.product); diff --git a/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml b/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml index 387fce7051..df620dc64f 100644 --- a/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml +++ b/tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml @@ -4,7 +4,7 @@ 0xffffff 0 - 0 + 4294967295 2 0 4th Gen Core Processor Integrated Graphics Controller