- 07 6月, 2016 7 次提交
-
-
由 Ján Tomko 提交于
-
由 Ján Tomko 提交于
This speeds up node_device_udev driver startup 11x.
-
由 Ján Tomko 提交于
Simplify the logic
-
由 Ján Tomko 提交于
Move out the code depending on HAVE_DECL_ETHTOOL_GFEATURES.
-
由 Ján Tomko 提交于
Split out the features that we probe via various ethtool commands and ETHTOOL_GFLAGS.
-
由 Ján Tomko 提交于
Rename struct elem to virNetDevEthtoolFeatureCmd and move it out of the function to allow reusing it.
-
由 Ján Tomko 提交于
-
- 11 5月, 2016 1 次提交
-
-
由 Laine Stump 提交于
SRIOV VFs used in macvtap passthrough mode can take advantage of the SRIOV card's transparent vlan tagging. All the code was there to set the vlan tag, and it has been used for SRIOV VFs used for hostdev interfaces for several years, but for some reason, the vlan tag for macvtap passthrough devices was stubbed out with a -1. This patch moves a bit of common validation down to a lower level (virNetDevReplaceNetConfig()) so it is shared by hostdev and macvtap modes, and updates the macvtap caller to actually send the vlan config instead of -1.
-
- 13 4月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
This is just a wrapper for virCommand that takes two strings and runs them. Move it to virnetdev.c for easier mocking.
-
- 08 4月, 2016 3 次提交
-
-
由 Peter Krempa 提交于
VIR_SOCKET_ADDR_VALID dereferences the pointer, thus if we pass NULL into virNetDevSetIPAddress it crashes. Regression introduced by b3d06987. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325120
-
由 Andrea Bolognani 提交于
virSocketAddrFormat() wants a single pointer, not a double pointer. Fixes the following compilation error on FreeBSD: util/virnetdev.c:1448:72: error: incompatible pointer types passing 'virSocketAddr **' to parameter of type 'const virSocketAddr *'; remove & [-Werror,-Wincompatible-pointer-types] if (VIR_SOCKET_ADDR_VALID(peer) && !(peerstr = virSocketAddrFormat(&peer))) ^~~~~ ./util/virsocketaddr.h:92:48: note: passing argument to parameter 'addr' here char *virSocketAddrFormat(const virSocketAddr *addr); ^
-
由 Vasiliy Tolstov 提交于
Signed-off-by: NVasiliy Tolstov <v.tolstov@selfip.ru>
-
- 26 2月, 2016 1 次提交
-
-
由 Andrea Bolognani 提交于
virNetDevIsVirtualFunction() returns 1 if the interface is a virtual function, 0 if it isn't and -1 on error. This means that, despite the name suggesting otherwise, using it as a predicate is not correct. Fix two callers that were doing so adding an explicit check on the return value.
-
- 25 2月, 2016 1 次提交
-
-
由 Jiri Denemark 提交于
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 05 1月, 2016 1 次提交
-
-
由 Laine Stump 提交于
I noticed in a log file that we had failed to set a MAC address. The log said which interface we were trying to set, but didn't give the offending MAC address, which could have been useful in determining the source of the problem. This patch modifies all three places in the code that set MAC addresses to report the failed MAC as well as interface.
-
- 02 12月, 2015 1 次提交
-
-
由 Ian Campbell 提交于
Commit 0f7436ca "network: wait for DAD to finish for bridge IPv6 addresses" results in: CC util/libvirt_util_la-virnetdevmacvlan.lo util/virnetdev.c: In function 'virNetDevParseDadStatus': util/virnetdev.c:1319:188: error: cast increases required alignment of target type [-Werror=cast-align] util/virnetdev.c:1332:41: error: cast increases required alignment of target type [-Werror=cast-align] util/virnetdev.c:1334:92: error: cast increases required alignment of target type [-Werror=cast-align] cc1: all warnings being treated as errors on at least ARM platforms. The three macros involved (NLMSG_NEXT, IFA_RTA and RTA_NEXT) all appear to correctly take care of alignment, therefore suppress Wcast-align around their uses. Signed-off-by: NIan Campbell <ian.campbell@citrix.com> Cc: Maxim Perevedentsev <mperevedentsev@virtuozzo.com> Cc: Laine Stump <laine@laine.org> Cc: Dario Faggioli <dario.faggioli@citrix.com> Cc: Jim Fehlig <jfehlig@suse.com>
-
- 25 11月, 2015 1 次提交
-
-
由 Laine Stump 提交于
A PCI device may have the capability to setup virtual functions (VFs) but have them currently all disabled. Prior to this patch, if that was the case the the node device XML for the device wouldn't report any virtual_functions capability. With this patch, if a file called "sriov_totalvfs" is found in the device's sysfs directory, its contents will be interpreted as a decimal number, and that value will be reported as "maxCount" in a capability element of the device's XML, e.g.: <capability type='virtual_functions' maxCount='7'/> This will be reported regardless of whether or not any VFs are currently enabled for the device. NB: sriov_numvfs (the number of VFs currently active) is also available in sysfs, but that value is implied by the number of items in the list that is inside the capability element, so there is no reason to explicitly provide it as an attribute. sriov_totalvfs and sriov_numvfs are available in kernels at least as far back as the 2.6.32 that is in RHEL6.7, but in the case that they simply aren't there, libvirt will behave as it did prior to this patch - no maxCount will be displayed, and the virtual_functions capability will be absent from the device's XML when 0 VFs are enabled.
-
- 07 11月, 2015 2 次提交
-
-
由 John Ferlan 提交于
Use virNetDevSetupControl instead of open coding using socket(AF_LOCAL...) and clearing virIfreq. By using virNetDevSetupControl, the socket is then opened using AF_PACKET which requires being privileged (effectively root) in order to complete successfully. Since that's now a requirement, then the ioctl(SIOCETHTOOL) should not fail with EPERM, thus it is removed from the filtered listed of failure codes. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Since the SIOCETHTOOL ioctl only works for privileged daemons, if called when not root, then virNetDevGetFeatures will VIR_DEBUG a message and return 0 as if the functions were not available for the architecture. This effectively returns an empty bitmap indicating no features available. Introduced by commit id 'c9027d8f' Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 06 11月, 2015 3 次提交
-
-
由 John Ferlan 提交于
In commit id 'c9027d8f' when updating the posted patch to generate a bitmap instead of an array of named feature bits, adjustment of the args was missed
-
由 John Ferlan 提交于
Recently reverted commit id '6f2a0198' showed a need to add extra comments when dealing with filtering of potential "non-issues". Scanning through upstream patch postings indicates early on the reasons for the filtering of specific ioctl failures were provided; however, when converted from causing an error to VIR_DEBUG's the reasons were missing. A future read/change of the code incorrectly assumed they could or should be removed.
-
由 Daniel P. Berrange 提交于
This reverts commit 6f2a0198. This commit removed error reporting from virNetDevSendEthtoolIoctl pushing responsibility onto the callers. This is wrong, however, since virNetDevSendEthtoolIoctl calls virNetDevSetupControl which can still report errors. So as a result virNetDevSendEthtoolIoctl may or may not report errors depending on which bit of it fails, and as a result callers now overwrite some errors. It also introduced a regression causing unprivileged libvirtd to spew error messages to the console due to inability to query the NIC features, an error which was previously ignored. virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted Looking back at the original posting I see no explanation of why thsi refactoring was needed, so reverting the clearly broken error reporting logic looks like the best option. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 05 11月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Rather than "if (virNetDevFeatureAvailable(ifname, &cmd))" change the success criteria to "if (virNetDevFeatureAvailable(ifname, &cmd) == 1)". The called helper returns -1 on failure, 0 on not found, and 1 on found. Thus a failure was setting bits. Introduced by commit ac3ed208 which changed the helper's return values without adjusting its callers Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 30 10月, 2015 2 次提交
-
-
由 Laine Stump 提交于
This was originally set to 5 seconds, but times of 5.5 to 7 seconds were experienced. Since it's an arbitrary number intended to prevent an infinite hang, having it a bit too high won't hurt anything, and 20 seconds looks to be adequate (i.e. I think/hope we don't need to make it tunable in libvirtd.conf)
-
由 Luyao Huang 提交于
If DAD not finished in 5 seconds, user will get an unknown error like this: # virsh net-start ipv6 error: Failed to start network ipv6 error: An error occurred, but the cause is unknown Call virReportError to set an error. Signed-off-by: NLuyao Huang <lhuang@redhat.com>
-
- 29 10月, 2015 2 次提交
-
-
由 Roman Bogorodskiy 提交于
Build on non-Linux fails because the virNetDevWaitDadFinish() stub has unused parameters. Fix by adding appropriate ATTRIBUTE_UNUSED for these parameters. Pushing under build-breaker rule.
-
由 Maxim Perevedentsev 提交于
commit db488c79 assumed that dnsmasq would complete IPv6 DAD before daemonizing, but in reality it doesn't wait, which creates problems when libvirt's bridge driver sets the matching "dummy tap device" to IFF_DOWN prior to DAD completing. This patch waits for DAD completion by periodically polling the kernel using netlink to check whether there are any IPv6 addresses assigned to bridge which have a 'tentative' state (if there are any in this state, then DAD hasn't yet finished). After DAD is finished, execution continues. To avoid an endless hang in case something was wrong with the kernel's DAD, we wait a maximum of 5 seconds.
-
- 03 9月, 2015 1 次提交
-
-
由 Laine Stump 提交于
These functions were made static as a part of commit cbfe38c since they were no longer called from outside virnetdev.c. We once again need to call them from another file, so this patch makes them once again public.
-
- 27 8月, 2015 1 次提交
-
-
由 Moshe Levi 提交于
This patch remove the logging of errors of ioctl api and instead let the caller to choose what errors to log
-
- 12 8月, 2015 1 次提交
-
-
由 Laine Stump 提交于
This fixes the crash described here: https://www.redhat.com/archives/libvir-list/2015-August/msg00162.html In short, we were calling ioctl(SIOCETHTOOL) pointing to a too-short object that was a local on the stack, resulting in the memory past the end of the object being overwritten. This was because the struct used by the ETHTOOL_GFEATURES command of SIOCETHTOOL ends with a 0-length array, but we were telling ethtool that it could use 2 elements on the array. The fix is to allocate the necessary memory with VIR_ALLOC_VAR(), including the extra length needed for a 2 element array at the end.
-
- 11 8月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
There is no guarantee that an enum start it mapped onto a value of zero. However, we are guaranteed that enum items are consecutive integers. Moreover, it's a pity to define an enum to avoid using magical constants but then using them anyway. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 7月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Commit id 'ac3ed208' causes 'virsh nodedev-list --cap net' to fail on any system without SYSFS_INFINIBAND_DIR (/sys/class/infiniband). Rather than assume it's there and fail on the attempt to open the non-existent directory, check if it's there - if not, return success and move on. Also fix caller to check < 0 upon return. As reported by Suren Hajyan <shajyan@redhat.com> from run of unit tests
-
- 22 7月, 2015 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Commit ac3ed208 breaks build on FreeBSD with: CC util/libvirt_util_la-virnetdev.lo util/virnetdev.c:2967:1: error: unused function 'virNetDevRDMAFeature' [-Werror,-Wunused-function] virNetDevRDMAFeature(const char *ifname, ^ So hide virNetDevRDMAFeature function under the #ifdef 'SIOCETHTOOL' and 'HAVE_STRUCT_IFREQ' section. Pushed under the build breaker rule.
-
- 21 7月, 2015 1 次提交
-
-
由 Moshe Levi 提交于
Adding functionality to libvirt that will allow it query the interface for the availability of RDMA and tx-udp_tnl-segmentation Offloading NIC capabilities Here is an example of the feature XML definition: <device> <name>net_eth4_90_e2_ba_5e_a5_45</name> <path>/sys/devices/pci0000:00/0000:00:03.0/0000:08:00.1/net/eth4</path> <parent>pci_0000_08_00_1</parent> <capability type='net'> <interface>eth4</interface> <address>90:e2:ba:5e:a5:45</address> <link speed='10000' state='up'/> <feature name='rx'/> <feature name='tx'/> <feature name='sg'/> <feature name='tso'/> <feature name='gso'/> <feature name='gro'/> <feature name='rxvlan'/> <feature name='txvlan'/> <feature name='rxhash'/> <feature name='rdma'/> <feature name='txudptnl'/> <capability type='80203'/> </capability> </device>
-
- 04 6月, 2015 1 次提交
-
-
由 Lubomir Rintel 提交于
There was a couple of problems with the style fixes applied to the original patch: 1.) virFileReadAllQuiet comparison was incorrectly parenthesized when moved into a condition, causing the len to be set to the result of comparison. This, together with the removed underflow check would underflow the phy buffer. 2.) The logic was broken. Failure to call "ip" would abort the function, thus the "iw" branch would never be reached. This aims to fix the issues and work around possible style complains :) Signed-off-by: NLubomir Rintel <lkundrak@v3.sk>
-
- 22 5月, 2015 1 次提交
-
-
由 Laine Stump 提交于
If an SRIOV PF is offline, the kernel won't complain if you set the mac address and vlan tag for a VF via this PF, and it will even let you assign the VF to a guest using PCI device assignment or macvtap passthrough. But in this case (the PF isn't online), the device won't be usable in the guest. Silently setting the PF online would solve the connectivity problem, but as pointed out by Dan Berrange, when an interface is set online with no associated config, the kernel will by default turn on IPv6 autoconf, which could create unexpected security problems for the host. For this reason, this patch instead logs an error and fails the operation. This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=893738 Originally filed against RHEL6, but present in every version of libvirt until today.
-
- 22 4月, 2015 2 次提交
-
-
由 Roman Bogorodskiy 提交于
Build fails on non-Linux systems with this error: CC util/libvirt_util_la-virnetdev.lo util/virnetdev.c:364:1: error: unused function 'virNetDevReplaceMacAddress' [-Werror,-Wunused-function] virNetDevReplaceMacAddress(const char *linkdev, ^ util/virnetdev.c:406:1: error: unused function 'virNetDevRestoreMacAddress' [-Werror,-Wunused-function] virNetDevRestoreMacAddress(const char *linkdev, ^ 2 errors generated. The virNetDev{Restore,Replace}MacAddress() functions are only used by VF-related routines that are available on Linux only. So move these functions under the same #ifdef.
-
由 Laine Stump 提交于
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1113474 When we set the MAC address of a network device as a part of setting up macvtap "passthrough" mode (where the domain has an emulated netdev connected to a host macvtap device that has exclusive use of the physical device, and sets the device MAC address to match its own, i.e. "<interface type='direct'> <source mode='passthrough' .../>"), we use ioctl(SIOCSIFHWADDR) giving it the name of that device. This is true even if it is an SRIOV Virtual Function (VF). But, when we are setting the MAC address / vlan ID of a VF in preparation for "hostdev network" passthrough (this is where we set the MAC address and vlan id of the VF after detaching the host net driver and before assigning the device to the domain with PCI passthrough, i.e. "<interface type='hostdev'>", we do the setting via a netlink RTM_SETLINK message for that VF's Physical Function (PF), telling it the VF# we want to change. This sets an "administratively changed MAC" flag for that VF in the PF's driver, and from that point on (until the PF driver is reloaded, *not* merely the VF driver) that VF's MAC address can't be changed using ioctl(SIOCSIFHWADDR) - the only way to change it is via the PF with RTM_SETLINK. This means that if a VF is used for hostdev passthrough, it will have the admin flag set, and future attempts to use that VF for macvtap passthrough will fail. The solution to this problem is to check if the device being used for macvtap passthrough is actually a VF; if so, we use the netlink RTM_SETLINK message to the PF to set the VF's mac address instead of ioctl(SIOCSIFHWADDR) directly to the VF; if not, behavior does not change from previously. There are three pieces to making this work: 1) virNetDevMacVLan(Create|Delete)WithVPortProfile() now call virNetDev(Replace|Restore)NetConfig() rather than virNetDev(Replace|Restore)MacAddress() (simply passing -1 for VF# and vlanid). 2) virNetDev(Replace|Restore)NetConfig() check to see if the device is a VF. If so, they find the PF's name and VF#, allowing them to call virNetDev(Replace|Restore)VfConfig(). 3) To prevent mixups when detaching a macvtap passthrough device that had been attached while running an older version of libvirt, virNetDevRestoreVfConfig() is potentially given the preserved name of the VF, and if the proper statefile for a VF can't be found in the stateDir (${stateDir}/${pfname}_vf${vfid}), virNetDevRestoreMacAddress() is called instead (which will look in the file named ${stateDir}/${vfname}). This problem has existed in every version of libvirt that has both macvtap passthrough and interface type='hostdev'. Fortunately people seem to use one or the other though, so it hasn't caused any real world problem reports.
-
- 17 4月, 2015 1 次提交
-
-
由 Lubomir Rintel 提交于
The 802.11 interfaces can not be moved by themselves, their Phy has to move too. If there are other interfaces, they have to move too -- hopefully it's not too confusing. This is a less-invasive alternative to defining a new hostdev type for PHYs. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 4月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
Throughout the code, we have several places need to construct a path somewhere in /sys/class/net/... They are not consistent and nearly each code piece invents its own way how to do it. So unify this by: 1) use virNetDevSysfsFile() wherever possible 2) At least use common macro SYSFS_NET_DIR declared in virnetdev.h at the rest of places which can't go with 1) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-