From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id C48F85A026E; Tue, 21 Feb 2023 20:24:25 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] qrap: Pass PCI device numbers to qemu in base 10, not in base 16 Date: Tue, 21 Feb 2023 20:24:25 +0100 Message-Id: <20230221192425.3745394-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: PISSB3H7K4S3H2LTV64Z2CYYNGKEMWJN X-Message-ID-Hash: PISSB3H7K4S3H2LTV64Z2CYYNGKEMWJN X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alona Paz , Andrea Bolognani X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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