virsh nodedev-detach fails if device has no driver (bz #1028629)
This commit is contained in:
parent
4051217c8b
commit
3db6039b2b
39
0001-virpci-Don-t-error-on-unbinded-devices.patch
Normal file
39
0001-virpci-Don-t-error-on-unbinded-devices.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
From df4283a55bf3516b333352e2052dbe3317936953 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <df4283a55bf3516b333352e2052dbe3317936953.1384267031.git.crobinso@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Thu, 31 Oct 2013 10:32:58 +0000
|
||||||
|
Subject: [PATCH] virpci: Don't error on unbinded devices
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=1018897
|
||||||
|
|
||||||
|
If a PCI deivce is not binded to any driver (e.g. there's yet no PCI
|
||||||
|
driver in the linux kernel) but still users want to passthru the device
|
||||||
|
we fail the whole operation as we fail to resolve the 'driver' link
|
||||||
|
under the PCI device sysfs tree. Obviously, this is not a fatal error
|
||||||
|
and it shouldn't be error at all.
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/util/virpci.c | 5 +----
|
||||||
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/util/virpci.c b/src/util/virpci.c
|
||||||
|
index 65d7168..148631f 100644
|
||||||
|
--- a/src/util/virpci.c
|
||||||
|
+++ b/src/util/virpci.c
|
||||||
|
@@ -1095,11 +1095,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
|
||||||
|
const char *newDriverName = NULL;
|
||||||
|
|
||||||
|
if (virPCIDriverDir(&stubDriverPath, stubDriverName) < 0 ||
|
||||||
|
- virPCIFile(&driverLink, dev->name, "driver") < 0 ||
|
||||||
|
- virPCIDeviceGetDriverPathAndName(dev, &oldDriverPath,
|
||||||
|
- &oldDriverName) < 0) {
|
||||||
|
+ virPCIFile(&driverLink, dev->name, "driver") < 0)
|
||||||
|
goto cleanup;
|
||||||
|
- }
|
||||||
|
|
||||||
|
if (virFileExists(driverLink)) {
|
||||||
|
if (virFileLinkPointsTo(driverLink, stubDriverPath)) {
|
||||||
|
--
|
||||||
|
1.8.4.2
|
||||||
|
|
11
libvirt.spec
11
libvirt.spec
@ -367,7 +367,7 @@
|
|||||||
Summary: Library providing a simple virtualization API
|
Summary: Library providing a simple virtualization API
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
Version: 1.1.4
|
Version: 1.1.4
|
||||||
Release: 1%{?dist}%{?extra_release}
|
Release: 2%{?dist}%{?extra_release}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
@ -378,6 +378,9 @@ URL: http://libvirt.org/
|
|||||||
%endif
|
%endif
|
||||||
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
|
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
|
||||||
|
|
||||||
|
# virsh nodedev-detach fails if device has no driver (bz #1028629)
|
||||||
|
Patch0001: 0001-virpci-Don-t-error-on-unbinded-devices.patch
|
||||||
|
|
||||||
%if %{with_libvirtd}
|
%if %{with_libvirtd}
|
||||||
Requires: libvirt-daemon = %{version}-%{release}
|
Requires: libvirt-daemon = %{version}-%{release}
|
||||||
%if %{with_network}
|
%if %{with_network}
|
||||||
@ -1161,6 +1164,9 @@ of recent versions of Linux (and other OSes).
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
|
# virsh nodedev-detach fails if device has no driver (bz #1028629)
|
||||||
|
%patch0001 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if ! %{with_xen}
|
%if ! %{with_xen}
|
||||||
%define _without_xen --without-xen
|
%define _without_xen --without-xen
|
||||||
@ -2118,6 +2124,9 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 12 2013 Cole Robinson <crobinso@redhat.com> - 1.1.4-2
|
||||||
|
- virsh nodedev-detach fails if device has no driver (bz #1028629)
|
||||||
|
|
||||||
* Mon Nov 4 2013 Daniel Veillard <veillard@redhat.com> - 1.1.4-1
|
* Mon Nov 4 2013 Daniel Veillard <veillard@redhat.com> - 1.1.4-1
|
||||||
- upstream release of 1.1.4
|
- upstream release of 1.1.4
|
||||||
- Add support for AArch64 architecture
|
- Add support for AArch64 architecture
|
||||||
|
Loading…
Reference in New Issue
Block a user