Alona reports that when libvirt starts qrap (KubeVirt integration)
and the domain description leads to more than 10 devices, indices of
PCI device descriptors are formatted as hexadecimal, so we end up
with things like "pci.a" instead of "pci.10".
Reported-by: Alona Paz
Fixes: 5307faa05997 ("qrap: Strip network devices from command line, set them up according to machine")
Signed-off-by: Stefano Brivio
---
qrap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qrap.c b/qrap.c
index 287198e..ff99c89 100644
--- a/qrap.c
+++ b/qrap.c
@@ -281,11 +281,11 @@ int main(int argc, char **argv)
qemu_argv[qemu_argc++] = "-device";
if (!has_json) {
snprintf(dev_str, ARG_MAX,
- "%s,%s%x%s,netdev=hostnet0,x-txburst=4096",
+ "%s,%s%i%s,netdev=hostnet0,x-txburst=4096",
dev->name, dev->template, i, dev->template_post);
} else {
snprintf(dev_str, ARG_MAX,
- "{\"driver\":\"%s\",%s%x\"%s,\"netdev\":\"hostnet0\",\"x-txburst\":4096}",
+ "{\"driver\":\"%s\",%s%i\"%s,\"netdev\":\"hostnet0\",\"x-txburst\":4096}",
dev->name, dev->template_json, i, dev->template_json_post);
}
qemu_argv[qemu_argc++] = dev_str;
--
2.39.1