summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2018-09-21 05:07:30 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2018-09-21 05:07:30 +0100
commitb75c20f03f9badd957f450938582f128e35050d9 (patch)
tree5a744b82d059ec2e77c8289cde8ce494f9eb8112
parent12527a9fdf539a1185449ea52e3b2a71344ededf (diff)
Add ThunderX patches from Radosław Biernackilinaro/stretch
-rw-r--r--debian/changelog13
-rw-r--r--debian/patches/0001-Fix-for-ThunderX-no-netdev-on-PF.patch87
-rw-r--r--debian/patches/0002-Code-simplification.patch101
-rw-r--r--debian/patches/series2
4 files changed, 203 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 2a7b9e062..1d5818bf0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+libvirt (4.3.0-1~bpo9.4) stretch-backports; urgency=medium
+
+ * Switch to git-buildpackage like Debian does.
+
+ -- Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Fri, 21 Sep 2018 05:04:55 +0100
+
+libvirt (4.3.0-0~bpo9.3) stretch; urgency=medium
+
+ * Disable wireshark - #880428
+ * Apply ThunderX patches from Radosław Biernacki.
+
+ -- Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Tue, 17 Jul 2018 20:27:40 +0100
+
libvirt (4.3.0-1) unstable; urgency=medium
* [8730a15] New upstream version 4.3.0
diff --git a/debian/patches/0001-Fix-for-ThunderX-no-netdev-on-PF.patch b/debian/patches/0001-Fix-for-ThunderX-no-netdev-on-PF.patch
new file mode 100644
index 000000000..a4c47f231
--- /dev/null
+++ b/debian/patches/0001-Fix-for-ThunderX-no-netdev-on-PF.patch
@@ -0,0 +1,87 @@
+From c14dabcb08217d777290860f66e0270aff0e7686 Mon Sep 17 00:00:00 2001
+From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
+Date: Thu, 21 Jun 2018 16:26:34 +0000
+Subject: [PATCH 1/2] Fix for ThunderX, no netdev on PF
+
+---
+ src/util/virnetdev.c | 33 ++++++++++++++++++++++++++-------
+ 1 file changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
+index b250af9e2c..07ce0fba5c 100644
+--- a/src/util/virnetdev.c
++++ b/src/util/virnetdev.c
+@@ -1520,8 +1520,12 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
+
+ *pfname = NULL;
+
+- if (virNetDevGetPhysicalFunction(vfname, pfname) < 0)
+- return ret;
++ if (virNetDevGetPhysicalFunction(vfname, pfname) < 0 || !*pfname) {
++ virReportError(VIR_ERR_INTERNAL_ERROR,
++ _("The PF device for VF %s has no network device name"),
++ vfname);
++ goto cleanup;
++ }
+
+ if (virNetDevSysfsFile(&pf_sysfs_path, *pfname, "device") < 0)
+ goto cleanup;
+@@ -1933,8 +1937,12 @@ virNetDevSaveNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0)
++ if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
++ virReportError(VIR_ERR_INTERNAL_ERROR,
++ _("The PF device for VF %s has no network device name"),
++ linkdev);
+ goto cleanup;
++ }
+
+ pfDevName = pfDevOrig;
+
+@@ -2091,8 +2099,12 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0)
++ if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
++ virReportError(VIR_ERR_INTERNAL_ERROR,
++ _("The PF device for VF %s has no network device name"),
++ linkdev);
+ goto cleanup;
++ }
+
+ pfDevName = pfDevOrig;
+
+@@ -2296,8 +2308,12 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0)
++ if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
++ virReportError(VIR_ERR_INTERNAL_ERROR,
++ _("The PF device for VF %s has no network device name"),
++ linkdev);
+ goto cleanup;
++ }
+
+ pfDevName = pfDevOrig;
+
+@@ -3276,8 +3292,11 @@ virNetDevSwitchdevFeature(const char *ifname,
+ if ((is_vf = virNetDevIsVirtualFunction(ifname)) < 0)
+ return ret;
+
+- if (is_vf == 1 && virNetDevGetPhysicalFunction(ifname, &pfname) < 0)
+- goto cleanup;
++ if (is_vf == 1) {
++ /* ignore error if PF does noto have netdev assigned
++ * in case of error pfname == NULL */
++ ignore_value(virNetDevGetPhysicalFunction(ifname, &pfname));
++ }
+
+ pci_device_ptr = pfname ? virNetDevGetPCIDevice(pfname) :
+ virNetDevGetPCIDevice(ifname);
+--
+2.14.1
+
diff --git a/debian/patches/0002-Code-simplification.patch b/debian/patches/0002-Code-simplification.patch
new file mode 100644
index 000000000..bf9142816
--- /dev/null
+++ b/debian/patches/0002-Code-simplification.patch
@@ -0,0 +1,101 @@
+From 6bfed84a3696c22512f73d15ac0e6ce61ccd7003 Mon Sep 17 00:00:00 2001
+From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
+Date: Thu, 21 Jun 2018 16:49:15 +0000
+Subject: [PATCH 2/2] Code simplification
+
+---
+ src/util/virnetdev.c | 49 +++++--------------------------------------------
+ 1 file changed, 5 insertions(+), 44 deletions(-)
+
+diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
+index 07ce0fba5c..ef80ff9740 100644
+--- a/src/util/virnetdev.c
++++ b/src/util/virnetdev.c
+@@ -1524,25 +1524,10 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("The PF device for VF %s has no network device name"),
+ vfname);
+- goto cleanup;
++ return ret;
+ }
+
+- if (virNetDevSysfsFile(&pf_sysfs_path, *pfname, "device") < 0)
+- goto cleanup;
+-
+- if (virNetDevSysfsFile(&vf_sysfs_path, vfname, "device") < 0)
+- goto cleanup;
+-
+- ret = virPCIGetVirtualFunctionIndex(pf_sysfs_path, vf_sysfs_path, vf);
+-
+- cleanup:
+- if (ret < 0)
+- VIR_FREE(*pfname);
+-
+- VIR_FREE(vf_sysfs_path);
+- VIR_FREE(pf_sysfs_path);
+-
+- return ret;
++ return virNetDevGetVirtualFunctionIndex(*pfname, vfname, vf);
+ }
+
+ #else /* !__linux__ */
+@@ -1937,17 +1922,9 @@ virNetDevSaveNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
+- virReportError(VIR_ERR_INTERNAL_ERROR,
+- _("The PF device for VF %s has no network device name"),
+- linkdev);
++ if (virNetDevGetVirtualFunctionInfo(linkdev, &pfDevOrig, &vf))
+ goto cleanup;
+- }
+-
+ pfDevName = pfDevOrig;
+-
+- if (virNetDevGetVirtualFunctionIndex(pfDevName, linkdev, &vf) < 0)
+- goto cleanup;
+ }
+
+ if (pfDevName) {
+@@ -2099,17 +2076,9 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
+- virReportError(VIR_ERR_INTERNAL_ERROR,
+- _("The PF device for VF %s has no network device name"),
+- linkdev);
++ if (virNetDevGetVirtualFunctionInfo(linkdev, &pfDevOrig, &vf))
+ goto cleanup;
+- }
+-
+ pfDevName = pfDevOrig;
+-
+- if (virNetDevGetVirtualFunctionIndex(pfDevName, linkdev, &vf) < 0)
+- goto cleanup;
+ }
+
+ /* if there is a PF, it's now in pfDevName, and linkdev is either
+@@ -2308,17 +2277,9 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
+ * it to PF + VFname
+ */
+
+- if (virNetDevGetPhysicalFunction(linkdev, &pfDevOrig) < 0 || !pfDevOrig) {
+- virReportError(VIR_ERR_INTERNAL_ERROR,
+- _("The PF device for VF %s has no network device name"),
+- linkdev);
++ if (virNetDevGetVirtualFunctionInfo(linkdev, &pfDevOrig, &vf))
+ goto cleanup;
+- }
+-
+ pfDevName = pfDevOrig;
+-
+- if (virNetDevGetVirtualFunctionIndex(pfDevName, linkdev, &vf) < 0)
+- goto cleanup;
+ }
+
+
+--
+2.14.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 4a7de797c..7a2dbc178 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,5 @@ Set-defaults-for-zfs-tools.patch
Pass-GPG_TTY-env-var-to-the-ssh-binary.patch
apparmor-Allow-virt-aa-helper-to-access-the-name-service-.patch
debian/Prefer-sbin-over-usr-sbin.patch
+0001-Fix-for-ThunderX-no-netdev-on-PF.patch
+0002-Code-simplification.patch