- 24 12月, 2010 1 次提交
-
-
由 Laine Stump 提交于
The functions in iptables.c all return -1 on failure, but all their callers (which all happen to be in bridge_driver.c) assume that they are returning an errno, and the logging is done accordingly. This patch fixes all the error checking and logging to assume < 0 is an error, and nothing else.
-
- 20 12月, 2010 1 次提交
-
-
由 Paweł Krześniak 提交于
While not technically a double free (since VIR_FREE NULLs the pointer), this is unnecessary extra code. This crept in when the function was converted from virRun to virCommand. The AUTHORS file has also been updated.
-
- 11 12月, 2010 1 次提交
-
-
由 Laine Stump 提交于
This is pretty straightforward - even though dnsmasq gets daemonized and uses a pid file, those things are both handled by the dnsmasq binary itself. And libvirt doesn't need any of the output of the dnsmasq command either, so we just setup the args and call virRun(). Mainly it was just a (mostly) mechanical job of replacing the APPEND_ARG() macro (and some other *printfs()) with virCommandAddArg*().
-
- 03 12月, 2010 1 次提交
-
-
由 Jean-Baptiste Rouault 提交于
This patch adds a mode_t parameter to virFileWriteStr(). If mode is different from 0, virFileWriteStr() will try to create the file if it doesn't exist. * src/util/util.h (virFileWriteStr): Alter signature. * src/util/util.c (virFileWriteStr): Allow file creation. * src/network/bridge_driver.c (networkEnableIpForwarding) (networkDisableIPV6): Adjust clients. * src/node_device/node_device_driver.c (nodeDeviceVportCreateDelete): Likewise. * src/util/cgroup.c (virCgroupSetValueStr): Likewise. * src/util/pci.c (pciBindDeviceToStub, pciUnBindDeviceFromStub): Likewise.
-
- 17 11月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* bootstrap.conf (gnulib_modules): Add configmake. * daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by gnulib. * src/Makefile.am (INCLUDES): Likewise. * tests/Makefile.am (INCLUDES): Likewise. * tools/Makefile.am (virsh_CFLAGS): Likewise. * daemon/libvirtd.c (qemudInitPaths, usage, main): Update clients. * src/cpu/cpu_map.c (CPUMAPFILE): Likewise. * src/driver.c (DEFAULT_DRIVER_DIR): Likewise. * src/internal.h (_): Likewise. * src/libvirt.c (virInitialize): Likewise. * src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR): Likewise. * src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig): Likewise. * src/network/bridge_driver.c (NETWORK_PID_DIR) (NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise. * src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup): Likewise. * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise. * src/qemu/qemu_driver.c (qemudStartup): Likewise. * src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET) (LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE) (LIBVIRT_PKI_DIR): Likewise. * src/secret/secret_driver.c (secretDriverStartup): Likewise. * src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise. * src/security/virt-aa-helper.c (main): Likewise. * src/storage/storage_backend_disk.c (PARTHELPER): Likewise. * src/storage/storage_driver.c (storageDriverStartup): Likewise. * src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise. * src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise. * tools/virsh.c (main): Likewise. * docs/hooks.html.in: Likewise.
-
- 28 10月, 2010 1 次提交
-
-
由 Laine Stump 提交于
During virtual network startup, the iptables rule that allows tftp traffic is only added if network->def->tftproot is non-empty, but when the virtual network is destroyed, we had been unconditionally trying to delete the rule. This was harmless, except that it created a bogus error message. This patch conditionalizes the delete command in the same manner that the insert command is already conditionalized.
-
- 26 10月, 2010 2 次提交
-
-
由 Daniel P. Berrange 提交于
When failing to start a virtual network, we have to cleanup, tearing down any iptables rules. If the iptables rules were not present yet though, this raises an error, which squashes the original error we were handling. * src/network/bridge_driver.c: When failing to start a virtual network, don't squash the original error in cleanup
-
由 Daniel P. Berrange 提交于
The network address was being set to 192.168.122.0 instead of 192.168.122.0/24. Fix this by removing the unneccessary 'network' field from virNetworkDef and just pass the network address and netmask into the iptables APIs directly. * src/conf/network_conf.h, src/conf/network_conf.c: Remove the 'network' field from virNEtworkDef. * src/network/bridge_driver.c: Update for iptables API changes * src/util/iptables.c, src/util/iptables.h: Require the network address + netmask pair to be passed in
-
- 22 10月, 2010 4 次提交
-
-
由 Daniel P. Berrange 提交于
Instead of storing the IP address string in virNetwork related structs, store the parsed virSocketAddr. This will make it easier to add IPv6 support in the future, by letting driver code directly check what address family is present * src/conf/network_conf.c, src/conf/network_conf.h, src/network/bridge_driver.c: Convert to use virSocketAddr in virNetwork, instead of char *. * src/util/bridge.c, src/util/bridge.h, src/util/dnsmasq.c, src/util/dnsmasq.h, src/util/iptables.c, src/util/iptables.h: Convert to take a virSocketAddr instead of char * for any IP address parameters * src/util/network.h: Add macros to determine if an address is set, and what address family is set.
-
由 Daniel P. Berrange 提交于
The virSocketParse method was not doing any error reporting which meant the true cause of the problem was lost. Remove all error reporting from callers, and push it into virSocketParse * src/util/network.c: Add error reporting to virSocketParse * src/conf/domain_conf.c, src/conf/network_conf.c, src/network/bridge_driver.c: Remove error reporting in callers of virSocketParse
-
由 Daniel P. Berrange 提交于
The virSocketParseAddr function was accepting any AF_* constant and using that to set the ai_flags field in struct addrinfo. This is invalid, since address families must go in the ai_family field of the struct. * src/util/network.c: Fix handling of address family * src/conf/network_conf.c, src/network/bridge_driver.c: Pass AF_UNSPEC instead of relying on it being 0.
-
由 Daniel P. Berrange 提交于
Some operations on socket addresses need to know the length of the sockaddr struct for the particular address family. This info was being discarded when passing around virSocketAddr instances. Turn it from a union into a struct containing union+socklen_t fields, so length is always kept around. * src/util/network.h: Add socklen_t field to virSocketAddr * src/util/network.c, src/network/bridge_driver.c, src/conf/domain_conf.c: Update to take account of new struct definition.
-
- 10 9月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
For static-only DHCP, i.e. with no <range> but at least one <host> element within <dhcp> element, we have to add "--dhcp-range IP,static" option to dnsmasq to actually enable the service. Without this option, dnsmasq will not respond to DHCP requests.
-
- 12 8月, 2010 2 次提交
-
-
由 Jiri Denemark 提交于
--dhcp-no-override description from dnsmasq man page: Disable re-use of the DHCP servername and filename fields as extra option space. If it can, dnsmasq moves the boot server and filename information (from dhcp-boot) out of their dedicated fields into DHCP options. This make extra space available in the DHCP packet for options but can, rarely, confuse old or broken clients. This flag forces "simple and safe" behaviour to avoid problems in such a case. It seems some virtual network card ROMs are this old/buggy so let's add --dhcp-no-override as a workaround for them. We don't use extra DHCP options so this should be safe. The option was added in dnsmasq-2.41, which becomes the minimum required version.
-
由 Jiri Denemark 提交于
We add --dhcp-lease-max=xxx argument when network->def->nranges > 0 but we only allocate space for in the opposite case :-) I guess we are lucky enough to miscount somewhere else so that we actually allocate more space than we need since no-one has hit this bug so far.
-
- 02 8月, 2010 1 次提交
-
-
由 Laine Stump 提交于
This patch attempts to take advantage of a newly added netfilter module to correct for a problem with some guest DHCP client implementations when used in conjunction with a DHCP server run on the host systems with packet checksum offloading enabled. The problem is that, when the guest uses a RAW socket to read the DHCP response packets, the checksum hasn't yet been fixed by the IP stack, so it is incorrect. The fix implemented here is to add a rule to the POSTROUTING chain of the mangle table in iptables that fixes up the checksum for packets on the virtual network's bridge that are destined for the bootpc port (ie "dhcpc", ie port 68) port on the guest. Only very new versions of iptables will have this support (it will be in the next upstream release), so a failure to add this rule only results in a warning message. The iptables patch is here: http://patchwork.ozlabs.org/patch/58525/ A corresponding kernel module patch is also required (the backend of the iptables patch) and that will be in the next release of the kernel.
-
- 31 7月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* src/network/bridge_driver.c (networkDefine): Kill dead store.
-
- 28 7月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* src/network/bridge_driver.c (networkAddMasqueradingIptablesRules): Fix spelling and grammar.
-
- 19 7月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
IPtables will seek to preserve the source port unchanged when doing masquerading, if possible. NFS has a pseudo-security option where it checks for the source port <= 1023 before allowing a mount request. If an admin has used this to make the host OS trusted for mounts, the default iptables behaviour will potentially allow NAT'd guests access too. This needs to be stopped. With this change, the iptables -t nat -L -n -v rules for the default network will be Chain POSTROUTING (policy ACCEPT 95 packets, 9163 bytes) pkts bytes target prot opt in out source destination 14 840 MASQUERADE tcp -- * * 192.168.122.0/24 !192.168.122.0/24 masq ports: 1024-65535 75 5752 MASQUERADE udp -- * * 192.168.122.0/24 !192.168.122.0/24 masq ports: 1024-65535 0 0 MASQUERADE all -- * * 192.168.122.0/24 !192.168.122.0/24 * src/network/bridge_driver.c: Add masquerade rules for TCP and UDP protocols * src/util/iptables.c, src/util/iptables.c: Add source port mappings for TCP & UDP protocols when masquerading.
-
- 23 6月, 2010 2 次提交
-
-
由 Alan Pevec 提交于
add iptables rules to allow TFTP from the virtual network if <tftp> element is defined in the network definition. Fedora bz#580215 * src/network/bridge_driver.c: open UDP port 69 for TFTP traffic if tftproot is defined
-
由 Alan Pevec 提交于
-
- 08 6月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
The network driver is not doing correct checking for duplicate UUID/name values. This introduces a new method virNetworkObjIsDuplicate, based on the previously written virDomainObjIsDuplicate. * src/conf/network_conf.c, src/conf/network_conf.c, src/libvirt_private.syms: Add virNetworkObjIsDuplicate, * src/network/bridge_driver.c: Call virNetworkObjIsDuplicate for checking uniqueness of uuid/names
-
- 28 5月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=235961 If using the default virtual network, an easy way to lose guest network connectivity is to install libvirt inside the VM. The autostarted default network inside the guest collides with host virtual network routing. This is a long standing issue that has caused users quite a bit of pain and confusion. On network startup, parse /proc/net/route and compare the requested IP+netmask against host routing destinations: if any matches are found, refuse to start the network. v2: Drop sscanf, fix a comment typo, comment that function could use libnl instead of /proc v3: Consider route netmask. Compare binary data rather than convert to string. v4: Return to using sscanf, drop inet functions in favor of virSocket, parsing safety checks. Don't make parse failures fatal, in case expected format changes. v5: Try and continue if we receive unexpected. Delimit parsed lines to prevent scanning past newline
-
- 20 5月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/xen/xend_internal.c (xenDaemonDomainDefineXML): Remove \n. * src/network/bridge_driver.c (networkAddMasqueradingIptablesRules): Likewise.
-
- 19 5月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
Approximately 60 messages were marked. Since these diagnostics are intended solely for developers and maintainers, encouraging translation is deemed to be counterproductive: http://thread.gmane.org/gmane.comp.emulators.libvirt/25050/focus=25052 Run this command: git grep -l VIR_WARN|xargs perl -pi -e \ 's/(VIR_WARN0?)\s*\(_\((".*?")\)/$1($2/'
-
- 07 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
81 patches to gnulib, picks up several new syntax checks. * .gnulib: Update to latest. * .x-sc_prohibit_always_true_header_tests: New file. * bootstrap.conf (gnulib_modules): Add sched. * src/util/processinfo.c (includes): <sched.h> is now guaranteed. * src/network/bridge_driver.c (includes): Drop useless <strings.h>. * src/openvz/openvz_conf.c (includes): Likewise. * src/openvz/openvz_driver.c (includes): Likewise. * src/phyp/phyp_driver.c (includes): Likewise. * src/qemu/qemu_driver.c (includes): Likewise. * src/uml/uml_driver.c (includes): Likewise.
-
- 28 4月, 2010 1 次提交
-
-
由 Daniel Veillard 提交于
use /var/lib/libvirt/dnsmasq since /var/lib/libvirt/network is unreadable by the dnsmasq binary * src/network/bridge_driver.c: update DNSMASQ_STATE_DIR * src/Makefile.am: create it on make install * libvirt.spec.in: take the new directory into account
-
- 26 4月, 2010 1 次提交
-
-
由 Satoru SATOH 提交于
This patch makes libvirtd start the dnsmasq daemon with a --dhcp-hostsfile option instead of --dhcp-host options for each '//ip/dhcp/host' entries defined in network xml file. the dnsmasq host file is stored into /var/lib/libvirt/network * src/network/bridge_driver.c: define the directory for the hostfiles and save/delete them to be used by dnsmasq
-
- 08 3月, 2010 1 次提交
-
-
由 Eric Blake 提交于
Prior to this patch, there was an inconsistent mix between GNU and C99. For consistency, and potential portability to other compilers, stick with the C99 vararg macro syntax. * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU vararg macro syntax. * src/conf/domain_conf.c (virDomainReportError): Likewise. * src/conf/domain_event.c (eventReportError): Likewise. * src/conf/interface_conf.c (virInterfaceReportError): Likewise. * src/conf/network_conf.c (virNetworkReportError): Likewise. * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise. * src/conf/secret_conf.h (virSecretReportError): Likewise. * src/conf/storage_conf.h (virStorageReportError): Likewise. * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than GNU vararg macro syntax. * src/esx/esx_driver.c (ESX_ERROR): Likewise. * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise. * src/esx/esx_network_driver.c (ESX_ERROR): Likewise. * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise. * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise. * src/esx/esx_util.c (ESX_ERROR): Likewise. * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vmx.c (ESX_ERROR): Likewise. * src/util/hostusb.c (usbReportError): Use C99 rather than GNU vararg macro syntax. * src/util/json.c (virJSONError): Likewise. * src/util/macvtap.c (ReportError): Likewise. * src/util/pci.c (pciReportError): Likewise. * src/util/stats_linux.c (virStatsError): Likewise. * src/util/util.c (virUtilError): Likewise. * src/util/xml.c (virXMLError): Likewise. * src/xen/proxy_internal.c (virProxyError): Use C99 rather than GNU vararg macro syntax. * src/xen/sexpr.c (virSexprError): Likewise. * src/xen/xen_driver.c (xenUnifiedError): Likewise. * src/xen/xen_hypervisor.c (virXenError): Likewise. * src/xen/xen_inotify.c (virXenInotifyError): Likewise. * src/xen/xend_internal.c (virXendError): Likewise. * src/xen/xm_internal.c (xenXMError): Likewise. * src/xen/xs_internal.c (virXenStoreError): Likewise. * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU vararg macro syntax. * src/datatypes.c (virLibConnError): Likewise. * src/interface/netcf_driver.c (interfaceReportError): Likewise. * src/libvirt.c (virLibStreamError): Likewise. * src/lxc/lxc_conf.h (lxcError): Likewise. * src/network/bridge_driver.c (networkReportError): Likewise. * src/nodeinfo.c (nodeReportError): Likewise. * src/opennebula/one_conf.h (oneError): Likewise. * src/openvz/openvz_conf.h (openvzError): Likewise. * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise. * src/qemu/qemu_conf.h (qemuReportError): Likewise. * src/remote/remote_driver.c (errorf): Likewise. * src/security/security_driver.h (virSecurityReportError): Likewise. * src/test/test_driver.c (testError): Likewise. * src/uml/uml_conf.h (umlReportError): Likewise. * src/vbox/vbox_driver.c (vboxError): Likewise. * src/vbox/vbox_tmpl.c (vboxError): Likewise.
-
- 18 2月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
We were accessing the wrong private data structure, which would cause a segfault.
-
- 10 2月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virConnectPtr is no longer required for error reporting since that is recorded in a thread local. Remove use of virConnectPtr from all APIs in network_conf.{h,c} and update all callers to match
-
- 09 2月, 2010 3 次提交
-
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
由 Matthias Bolte 提交于
-
由 Matthias Bolte 提交于
-
- 21 1月, 2010 1 次提交
-
-
由 Laine Stump 提交于
* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c src/network/bridge_driver.c src/qemu/qemu_driver.c src/uml/uml_driver.c: virFileMakePath returns 0 for success, or the value of errno on failure, so error checking should be to test if non-zero, not if lower than 0
-
- 20 1月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
I noticed some debug messages are printed with an empty lines after them. This patch removes these empty lines from all invocations of the following macros: VIR_DEBUG VIR_DEBUG0 VIR_ERROR VIR_ERROR0 VIR_INFO VIR_WARN VIR_WARN0 Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 07 1月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/network/bridge_driver.c (networkBuildDnsmasqArgv): Correct test for NULL *argv.
-
- 10 12月, 2009 3 次提交
-
-
由 Mark McLoughlin 提交于
Long ago we tried to use Fedora's lokkit utility in order to register our iptables rules so that 'service iptables restart' would automatically load our rules. There was one fatal flaw - if the user had configured iptables without lokkit, then we would clobber that configuration by running lokkit. We quickly disabled lokkit support, but never removed it. Let's do that now. The 'my virtual network stops working when I restart iptables' still remains. For all the background on this saga, see: https://bugzilla.redhat.com/227011 * src/util/iptables.c: remove lokkit support * configure.in: remove --enable-lokkit * libvirt.spec.in: remove the dirs used only for saving rules for lokkit * src/Makefile.am: ditto * src/libvirt_private.syms, src/network/bridge_driver.c, src/util/iptables.h: remove references to iptablesSaveRules
-
由 Mark McLoughlin 提交于
This is the expected behaviour, I think - reloading libvirtd should be a subset of restarting it. Note, we reload the rules after we've determined which networks are active (because we only add the rules for active networks) and before we start autostart networks (to avoid re-adding the rules). * src/network/bridge_driver.c: reload iptables rules on startup
-
由 Mark McLoughlin 提交于
Currently, when we add iptables rules, we keep them on a list so that we can easily reload them on e.g. 'service libvirtd reload'. However, we don't save this list to disk, so if libvirtd is restarted we lose the ability to reload the rules. The fix is simple - just re-add the damn things on reload. Note, we delete the rules before re-adding them, just like the current behaviour of iptRulesReload(). * src/network/bridge_driver.c: re-add the iptables rules on reload.
-