- 17 8月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Move networkMacMgrFileName into src/util/virmacmap.c and rename to virMacMapFileName. We're about to move some more MacMgr processing files into virnetworkobj and it doesn't make sense to have this helper in the driver or in virnetworkobj. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Use @obj for a virNetworkObjPtr Use @net for a virNetworkPtr Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 15 7月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Modify code to have two spaces between functions, follow function more recent function formatting w/r/t args per line and function return type and name on separate lines. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 25 6月, 2017 1 次提交
-
-
由 John Ferlan 提交于
If a remote call fails during event registration (more than likely from a network failure or remote libvirtd restart timed just right), then when calling the virObjectEventStateDeregisterID we don't want to call the registered @freecb function because that breaks our contract that we would only call it after succesfully returning. If the @freecb routine were called, it could result in a double free from properly coded applications that free their opaque data on failure to register, as seen in the following details: Program terminated with signal 6, Aborted. #0 0x00007fc45cba15d7 in raise #1 0x00007fc45cba2cc8 in abort #2 0x00007fc45cbe12f7 in __libc_message #3 0x00007fc45cbe86d3 in _int_free #4 0x00007fc45d8d292c in PyDict_Fini #5 0x00007fc45d94f46a in Py_Finalize #6 0x00007fc45d960735 in Py_Main #7 0x00007fc45cb8daf5 in __libc_start_main #8 0x0000000000400721 in _start The double dereference of 'pyobj_cbData' is triggered in the following way: (1) libvirt_virConnectDomainEventRegisterAny is invoked. (2) the event is successfully added to the event callback list (virDomainEventStateRegisterClient in remoteConnectDomainEventRegisterAny returns 1 which means ok). (3) when function remoteConnectDomainEventRegisterAny is hit, network connection disconnected coincidently (or libvirtd is restarted) in the context of function 'call' then the connection is lost and the function 'call' failed, the branch virObjectEventStateDeregisterID is therefore taken. (4) 'pyobj_conn' is dereferenced the 1st time in libvirt_virConnectDomainEventFreeFunc. (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the 2nd time in libvirt_virConnectDomainEventRegisterAny. (6) the double free error is triggered. Resolve this by adding a @doFreeCb boolean in order to avoid calling the freeCb in virObjectEventStateDeregisterID for any remote call failure in a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls, the passed value would be true indicating they should run the freecb if it exists; whereas, it's false for the remote call failure path. Patch based on the investigation and initial patch posted by fangying <fangying1@huawei.com>.
-
- 28 4月, 2017 2 次提交
-
-
由 Laine Stump 提交于
If the network isn't active during networkNotifyActualDevice(), we would log an error message stating that the bridge device didn't exist. This patch adds a check to see if the network is active, making the logs more useful in the case that it isn't. Partially resolves: https://bugzilla.redhat.com/1442700
-
由 Laine Stump 提交于
Nothing that could happen during networkNotifyActualDevice() could justify unceremoniously killing the qemu process, but that's what we were doing. In particular, new code added in commit 85bcc022 (first appearred in libvirt-3.2.0) attempts to reattach tap devices to their assigned bridge devices when libvirtd restarts (to make it easier to recover from a restart of a libvirt network). But if the network has been stopped and *not* restarted, the bridge device won't exist and networkNotifyActualDevice() will fail. This patch changes networkNotifyActualDevice() and qemuProcessNotifyNets() to return void, so that qemuProcessReconnect() will soldier on regardless of what happens (any errors will still be logged though). Partially resolves: https://bugzilla.redhat.com/1442700
-
- 21 4月, 2017 1 次提交
-
-
由 Martin Kletzander 提交于
This patch makes use of the virNetDevSetCoalesce() function to make appropriate settings effective for devices that support them. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 19 4月, 2017 3 次提交
-
-
由 John Ferlan 提交于
Use "virNetworkObj" as a prefix for any external API in virnetworkobj. Also a couple of functions were local to virnetworkobj.c, so remove their external defs in virnetworkobj.h.
-
由 John Ferlan 提交于
Rename the API to be a better description of what it does. Besides, a subsequent patch will rename virNetworkAssignDef to virNetworkObjAssignDef so rather than make that patch confusing we'll take the intermittent step in this patch.
-
由 John Ferlan 提交于
Move all the virNetworkObj related API/data structures into their own modules virnetworkobj.{c,h} from the network_conf.{c,h} Purely code motion at this point plus adjustments to cleanly build
-
- 03 4月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
The virMacMap module is there for dumping [domain, <list of is MACs>] pairs into a file so that libvirt_guest NSS module can use it. Whenever a interface is allocated from network (e.g. on domain<F2> startup or NIC hotplug), network is notified and so is virMacMap module subsequently. The module update functions networkMacMgrAdd() and networkMacMgrDel() gracefully handle the case when there's no module. The problem is, the module is created if and only if network is freshly started, or if the daemon restarts and network previously had the module. This is not very user friendly - if users want to use the NSS module they need to destroy their network and bring it up again (and subsequently all the domains using it). One disadvantage of this approach implemented here is that one may get just partial results: any already running network does not record mac maps, thus only newly plugged domains will be stored in the module. The network restart scenario is not touched by this of course. But one can argue that older libvirts had never recorded the mac maps anyway. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 29 3月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1434882 Imagine the following scenario: 1) virsh net-start default 2) virsh start myFavouriteDomain 3) virsh net-destroy default 4) virsh destroy myFavouriteDomain (assuming myFavouriteDomain has an interface from default network) Regardless of how unlikely this scenario looks like, we should not crash. The problem is, on net-destroy in networkShutdownNetworkVirtual() the virMacMap module is unrefed, but the stale pointer is kept around. Thus when the domain destroy procedure comes in, networkReleaseActualDevice() and subsequently networkMacMgrDel() is called. This function sees the stale pointer and starts calling the virMacMap module APIs which work over freed memory. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 3月, 2017 1 次提交
-
-
由 Laine Stump 提交于
This adds a few validations to the devices listed for a hostdev network: * devices must be listed by PCI address, not by netdev name * listing a device by PCI address is valid only for hostdev networks, not for other types of network (e.g. macvtap passthrough). * each device in a hostdev pool must be an SR-IOV VF Resolves: https://bugzilla.redhat.com/1004676
-
- 24 3月, 2017 1 次提交
-
-
由 Laine Stump 提交于
commit 00d28a78 added a check to see if there were any IPv6 routes added by RA (Router Advertisement) via an interface that had accept_ra set to something other than "2". The check was being done unconditionally, but it's only relevant if IPv6 forwarding is going to be turned on, and that will only happen if the network has an IPv6 address.
-
- 23 3月, 2017 2 次提交
-
-
由 John Ferlan 提交于
The prototype requires a NONNULL argument and the only caller passes in a non-null parameter. Besides the "else if" condition would deref it anyway. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Laine Stump 提交于
If a network is destroyed and restarted, or its bridge is changed, any tap devices that had previously been connected to the bridge will no longer be connected. As a first step in automating a reconnection of all tap devices when this happens, this patch modifies networkNotifyActualDevice() (which is called once for every <interface> of every active domain whenever libvirtd is restarted) to reconnect any tap devices that it finds disconnected. With this patch in place, you will need to restart libvirtd to reconnect all the taps to their proper bridges. A future patch will add a callback that hypervisor drivers can register with the network driver to that the network driver can trigger this behavior automatically whenever a network is started.
-
- 22 3月, 2017 2 次提交
-
-
由 Cédric Bosdonnat 提交于
When enabling IPv6 on all interfaces, we may get the host Router Advertisement routes discarded. To avoid this, the user needs to set accept_ra to 2 for the interfaces with such routes. See https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt on this topic. To avoid user mistakenly losing routes on their hosts, check accept_ra values before enabling IPv6 forwarding. If a RA route is detected, but neither the corresponding device nor global accept_ra is set to 2, the network will fail to start.
-
由 Cédric Bosdonnat 提交于
Replace a few occurences of /proc/sys by the corresponding macro defined a few lines after: SYSCTL_PATH
-
- 21 3月, 2017 1 次提交
-
-
由 Laine Stump 提交于
It was pointed out here: https://bugzilla.redhat.com/show_bug.cgi?id=1331796#c4 that we shouldn't be adding a "no-resolv" to the dnsmasq.conf file for a network if there isn't any <forwarder> element that specifies an IP address but no qualifying domain. If there is such an element, it will handle all DNS requests that weren't otherwise handled by one of the forwarder entries with a matching domain attribute. If not, then DNS requests that don't match the domain of any <forwarder> would not be resolved if we added no-resolv. So, only add "no-resolv" when there is at least one <forwarder> element that specifies an IP address but no qualifying domain.
-
- 23 2月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
In GCC 7 there is a new warning triggered when a switch case has a conditional statement (eg if ... else...) and some of the code paths fallthrough to the next switch statement. e.g. conf/domain_conf.c: In function 'virDomainChrEquals': conf/domain_conf.c:14926:12: error: this statement may fall through [-Werror=implicit-fallthrough=] if (src->targetTypeAttr != tgt->targetTypeAttr) ^ conf/domain_conf.c:14928:5: note: here case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: ^~~~ conf/domain_conf.c: In function 'virDomainChrDefFormat': conf/domain_conf.c:22143:12: error: this statement may fall through [-Werror=implicit-fallthrough=] if (def->targetTypeAttr) { ^ conf/domain_conf.c:22151:5: note: here default: ^~~~~~~ GCC introduced a __attribute__((fallthrough)) to let you indicate that this is intentionale behaviour rather than a bug. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 2月, 2017 2 次提交
-
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/1224348
-
由 Laine Stump 提交于
virNetDevTapCreateInBridgePort() has always set the new tap device to the current MTU of the bridge it's being attached to. There is one case where we will want to set the new tap device to a different (usually larger) MTU - if that's done with the very first device added to the bridge, the bridge's MTU will be set to the device's MTU. This patch allows for that possibility by adding "int mtu" to the arg list for virNetDevTapCreateInBridgePort(), but all callers are sending -1, so it doesn't yet have any effect. Since the requested MTU isn't necessarily what is used in the end (for example, if there is no MTU requested, the tap device will be set to the current MTU of the bridge), and the hypervisor may want to know the actual MTU used, we also return the actual MTU to the caller (if actualMTU is non-NULL).
-
- 02 1月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
After 478ddedc a bug is fixed where we wrongly presumed loopack device name on non-Linux systems. It's lo0. However, the fix is not reflected in the tests which are failing now. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 19 12月, 2016 1 次提交
-
-
由 Jiri Denemark 提交于
Similarly to localOnly DNS domain, localPtr attribute can be used to tell the DNS server not to forward reverse lookups for unknown IPs which belong to the virtual network. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 06 12月, 2016 2 次提交
-
-
由 Michal Privoznik 提交于
Now that we have a module that's able to track <domain, mac addres list> pairs, hook it up into our network driver. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
In dd7bfb2c I've removed locking of the network driver upon it's allocation. However, I forgot to remove one location of the driver unlock. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 11月, 2016 1 次提交
-
-
由 Pavel Timofeev 提交于
On BSD family OSes (Free/Net/Open/DragonFlyBSD, Mac OS) and Solaris loopback interface is called 'lo0' instead of just 'lo'.
-
- 29 10月, 2016 1 次提交
-
-
由 Laine Stump 提交于
commit 9065cfaa added the ability to disable DNS services for a libvirt virtual network. If neither DNS nor DHCP is needed for a network, then we don't need to start dnsmasq, so code was added to check for this. Unfortunately, it was written with a great lack of attention to detail (I can say that, because I was the author), and the loop that checked if DHCP is needed for the network would never end if the network had multiple IP addresses and the first <ip> had no <dhcp> subelement (which would have contained a <range> or <host> subelement, thus requiring DHCP services). This patch rewrites the check to be more compact and (more importantly) finite. This bug was present in release 2.2.0 and 2.3.0, so will need to be backported to any relevant maintainence branches. Reported here: https://www.redhat.com/archives/libvirt-users/2016-October/msg00032.html https://www.redhat.com/archives/libvirt-users/2016-October/msg00045.html
-
- 20 10月, 2016 1 次提交
-
-
由 Sławek Kapłoński 提交于
New line character in name of network is now forbidden because it mess virsh output and can be confusing for users. Validation of name is done in network driver, after parsing XML to avoid problems with disappeared network which was already created with new-line char in name. Closes-Bug: https://bugzilla.redhat.com/show_bug.cgi?id=818064Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 10月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
This way we get reference counting and we can get rid of locking function. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 11 10月, 2016 1 次提交
-
-
由 Martin Wilck 提交于
The dnsmasq man page recommends that dhcp-authoritative "should be set when dnsmasq is definitely the only DHCP server on a network". This is the case for libvirt-managed virtual networks. The effect of this is that VMs that fail to renew their DHCP lease in time (e.g. if the VM or host is suspended) will be able to re-acquire the lease even if it's expired, unless the IP address has been taken by some other host. This avoids various annoyances caused by changing VM IP addresses.
-
- 23 8月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Commit id '0b6336c2' formatted the 'addr', but didn't VIR_FREE it. Found by Coverity.
-
- 20 8月, 2016 3 次提交
-
-
由 Laine Stump 提交于
For some unknown reason the original implementation of the <forwarder> element only took advantage of part of the functionality in the dnsmasq feature it exposes - it allowed specifying the ip address of a DNS server which *all* DNS requests would be forwarded to, like this: <forwarder addr='192.168.123.25'/> This is a frontend for dnsmasq's "server" option, which also allows you to specify a domain that must be matched in order for a request to be forwarded to a particular server. This patch adds support for specifying the domain. For example: <forwarder domain='example.com' addr='192.168.1.1'/> <forwarder domain='www.example.com'/> <forwarder domain='travesty.org' addr='10.0.0.1'/> would forward requests for bob.example.com, ftp.example.com and joe.corp.example.com all to the DNS server at 192.168.1.1, but would forward requests for travesty.org and www.travesty.org to 10.0.0.1. And due to the second line, requests for www.example.com, and odd.www.example.com would be resolved by the libvirt network's own DNS server (i.e. thery wouldn't be immediately forwarded) even though they also match 'example.com' - the match is given to the entry with the longest matching domain. DNS requests not matching any of the entries would be resolved by the libvirt network's own DNS server. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1331796
-
由 Laine Stump 提交于
If you define a libvirt virtual network with one or more IP addresses, it starts up an instance of dnsmasq. It's always been possible to avoid dnsmasq's dhcp server (simply don't include a <dhcp> element), but until now it wasn't possible to avoid having the DNS server listening; even if the network has no <dns> element, it is started using default settings. This patch adds a new attribute to <dns>: enable='yes|no'. For backward compatibility, it defaults to 'yes', but if you don't want a DNS server created for the network, you can simply add: <dns enable='no'/> to the network configuration, and next time the network is started there will be no dns server created (if there is dhcp configuration, dnsmasq will be started with "port=0" which disables the DNS server; if there is no dhcp configuration, dnsmasq won't be started at all).
-
由 Laine Stump 提交于
The new forward mode 'open' is just like mode='route', except that no firewall rules are added to assure that any traffic does or doesn't pass. It is assumed that either they aren't necessary, or they will be setup outside the scope of libvirt. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=846810
-
- 27 7月, 2016 1 次提交
-
-
由 Anton Khramov 提交于
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1181539
-
- 13 7月, 2016 1 次提交
-
-
由 Maxim Perevedentsev 提交于
IPv6 RA always contains an implicit default route via the link-local address of the source of RA. This forces the guest to install a route via isolated network, which may disturb the guest's networking in case of multiple interfaces. More info in 013427e6. The validity of this route is controlled by "default [route] lifetime" field of RA. If the lifetime is set to 0 seconds, then no route is installed by receiver. dnsmasq 2.67+ supports "ra-param=<interface>,<RA interval>,<default lifetime>" option. We pass "ra-param=*,0,0" (here, RA_interval=0 means default) to disable default gateway in RA for isolated networks.
-
- 27 6月, 2016 3 次提交
-
-
由 Laine Stump 提交于
These functions all need to be called from a utility function that must be located in the util directory, so we move them all into util/virnetdevip.[ch] now that it exists. Function and struct names were appropriately changed for the new location, but all code is unchanged aside from motion and renaming.
-
由 Laine Stump 提交于
This patch splits virnetdev.[ch] into multiple files, with the new virnetdevip.[ch] containing all the functions related to setting and retrieving IP-related info for a device (both addresses and routes).
-
由 Laine Stump 提交于
I'm tired of mistyping this all the time, so let's do it the same all the time (similar to how we changed all "Pci" to "PCI" awhile back). (NB: I've left alone some things in the esx and vbox drivers because I'm unable to compile them and they weren't obviously *not* a part of some API. I also didn't change a couple of variables named, e.g. "somethingIptables", because they were derived from the name of the "iptables" command)
-