[libvirt] [PATCH] domain: Fix PCI address decimal parsing regression

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

 



<hostdev> address parsing previously attempted to detect the number
base: currently it is hardcoded to base 16, which can break PCI assignment
via virt-manager. Revert to the previous behavior.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/conf/domain_conf.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1607e8b..546ddf2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1079,28 +1079,28 @@ virDomainDevicePCIAddressParseXML(xmlNodePtr node,
     function = virXMLPropString(node, "function");
 
     if (domain &&
-        virStrToLong_ui(domain, NULL, 16, &addr->domain) < 0) {
+        virStrToLong_ui(domain, NULL, 0, &addr->domain) < 0) {
         virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                              _("Cannot parse <address> 'domain' attribute"));
         goto cleanup;
     }
 
     if (bus &&
-        virStrToLong_ui(bus, NULL, 16, &addr->bus) < 0) {
+        virStrToLong_ui(bus, NULL, 0, &addr->bus) < 0) {
         virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                              _("Cannot parse <address> 'bus' attribute"));
         goto cleanup;
     }
 
     if (slot &&
-        virStrToLong_ui(slot, NULL, 16, &addr->slot) < 0) {
+        virStrToLong_ui(slot, NULL, 0, &addr->slot) < 0) {
         virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                              _("Cannot parse <address> 'slot' attribute"));
         goto cleanup;
     }
 
     if (function &&
-        virStrToLong_ui(function, NULL, 16, &addr->function) < 0) {
+        virStrToLong_ui(function, NULL, 0, &addr->function) < 0) {
         virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                              _("Cannot parse <address> 'function' attribute"));
         goto cleanup;
-- 
1.7.0.1

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