- 20 11月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Compilation on a RHEL 5 host failed, due to the older dbus headers present on that machine, and triggered by commit 2aa167ca: util/virdbus.c: In function 'virDBusMessageIterDecode': util/virdbus.c:952: error: 'DBusBasicValue' undeclared (first use in this function) * m4/virt-dbus.m4 (LIBVIRT_CHECK_DBUS): Check for DBusBasicValue. * src/util/virdbuspriv.h (DBusBasicValue): Provide fallback. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Commit dc33e6e4 caused older platforms like Fedora 20 to emit scary log messages at startup: 2014-11-19 23:12:58.800+0000: 28906: error : virCommandWait:2532 : internal error: Child process (/usr/sbin/iptables -w -L -n) unexpected exit status 2: iptables v1.4.19.1: unknown option "-w" Try `iptables -h' or 'iptables --help' for more information. Since we are probing and expect to handle the case where -w is not supported, we should not let virCommand log it as an error. * src/util/virfirewall.c (virFirewallCheckUpdateLock): Handle non-zero status ourselves. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 11月, 2014 3 次提交
-
-
由 Eric Blake 提交于
I noticed this while working on qemuDomainGetBlockInfo. Assigning a bool value to an int variable compiles fine, but raises red flags on the maintenance front as it becomes too easy to assign -1 or 2 or any other non-bool value to the same variable. * cfg.mk (sc_prohibit_int_assign_bool): New rule. * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix offenders. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo) (qemuDomainSnapshotCreateXML): Likewise. * src/test/test_driver.c (testDomainSnapshotAlignDisks): Likewise. * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise. * src/util/virpci.c (virPCIDeviceBindToStub): Likewise. * src/util/virutil.c (virIsCapableVport): Likewise. * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise. * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot) (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal) (cmdDetachInterface): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Use of an 'int' to represent a 'bool' value is confusing. Just because dbus made the mistake of cementing their 4-byte wire format of dbus_bool_t into their API doesn't mean we have to repeat the mistake. With a little bit of finesse, we can guarantee that we provide a large-enough value to the DBus code, while still copying only the relevant one-byte bool to the client code, and isolate the rest of our code base from the DBus stupidity. * src/util/virdbus.c (GET_NEXT_VAL): Add parameter. (virDBusMessageIterDecode): Adjust all clients. * src/util/virpolkit.c (virPolkitCheckAuth): Use nicer type. * tests/virdbustest.c (testMessageSimple, testMessageStruct): Test new behavior. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Anirban Chakraborty 提交于
Ethernet interfaces in libvirt currently do not support bandwidth setting. For example, following xml file for an interface will not apply these settings to corresponding qdiscs. <interface type="ethernet"> <mac address="02:36:1d:18:2a:e4"/> <model type="virtio"/> <script path=""/> <target dev="tap361d182a-e4"/> <bandwidth> <inbound average="984" peak="1024" burst="64"/> <outbound average="2000" peak="2048" burst="128"/> </bandwidth> </interface> Signed-off-by: NAnirban Chakraborty <abchak@juniper.net> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 14 11月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
A previous commit introduced use of locking with invocation of iptables in the viriptables.c module commit ba95426d Author: Serge Hallyn <serge.hallyn@ubuntu.com> Date: Fri Nov 1 12:36:59 2013 -0500 util: use -w flag when calling iptables This only ever had effect with the virtual network driver, as it was not wired up into the nwfilter driver. Unfortunately in the firewall refactoring the use of the -w flag was accidentally lost. This patch introduces it to the virfirewall.c module so that both the virtual network and nwfilter drivers will be using it. It also ensures that the equivalent --concurrent flag to ebtables is used.
-
- 11 11月, 2014 1 次提交
-
-
由 Hao Liu 提交于
This patch fixes the following issues. 1) When an invalid wwn is introduced, libvirt reports "Malformed wwn: %s". The template won't be replaced. 2) "target" option for dompmsuspend and "xml" option for save-image-define are required options and should use VSH_OT_DATA instead of VSH_OT_STRING as an option type. 3) A typo. Signed-off-by: NHao Liu <hliu@redhat.com>
-
- 07 11月, 2014 2 次提交
-
-
由 Chen Fan 提交于
Introduced by commit c63ef045, when nodeset is NULL, validation will pass in virNumaSetupMemoryPolicy, but virBitmapNextSetBit must ensure bitmap is not NULL, otherwise that might cause a segmentation fault. This patch fixes it. Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Prerna Saxena 提交于
This adds support for PowerPC Little Endian architecture., and allows libvirt to spawn VMs based on 'ppc64le' architecture. Signed-off-by: NPradipta Kr. Banerjee <bpradip@in.ibm.com> Signed-off-by: NPrerna Saxena <prerna@linux.vnet.ibm.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 11月, 2014 5 次提交
-
-
由 Michal Privoznik 提交于
One of the latest patches (9a8fc3ef) introduced call of geteuid(). However, not all systems have the function implemented, e.g. mingw. Therefore, we fail to build on those system. The fix consist of including virutil.h which defines geteuid in needed. Sigh. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Martin Kletzander 提交于
When compiled without full numa support, the stub function for virNumaNodeIsAvailable() just checks whether specified node is in range <0, max); where max is maximum NUMA node available on the host. But because the maximum node number is the highest usabe number (and not the count of nodes), the check is incorrect as it should check whether the specified node is in range <0, max> instead. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
This is a reaction to Michal's fix [1] for non-NUMA systems that also splits out conf/ out of util/ because libvirt_util shouldn't require libvirt_conf if it is the other way around. This particular use case worked, but we're trying to avoid it as mentioned [2], many times. The only functions from virnuma.c that needed numatune_conf were virDomainNumatuneNodesetIsAvailable() and virNumaSetupMemoryPolicy(). The first one should be in numatune_conf as it works with virDomainNumatune, the second one just needs nodeset and mode, both of which can be passed without the need of numatune_conf. Apart from fixing that, this patch also fixes recently added code (between commits d2460f85^..5c851562) that doesn't support non-contiguous nodesets. It uses new function virNumaNodesetIsAvailable(), which doesn't need a stub as it doesn't use any libnuma functions, to check if every specified nodeset is available. [1] https://www.redhat.com/archives/libvir-list/2014-November/msg00118.html [2] http://www.redhat.com/archives/libvir-list/2011-June/msg01040.htmlSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Erik Skultety 提交于
Patch 43b67f2e disallowed network tuning only with qemu driver, however this patch moved the check for root privileges into virNetDevBandwidthSet function, so the call should now fail in all possible cases. A mock function was created so that the test suite doesn't fail because of unsufficient privileges.
-
由 Michal Privoznik 提交于
Well, in fact only add comments to mark ifdef, else and endif sections. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 04 11月, 2014 4 次提交
-
-
由 Martin Kletzander 提交于
Coverity found out the very obvious problem in the code. That is that virPidFileReleasePath() was called only if virPidFileAcquirePath() returned 0. But virPidFileAcquirePath() doesn't return only 0 on success, but the FD that needs to be closed. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Chen Fan 提交于
There was no check for 'nodeset' attribute in numatune-related elements. This patch adds validation that any nodeset specified does not exceed maximum host node. Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
- 03 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
This function is used to cleanup a pidfile doing whatever it takes, even killing the owning process. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 01 11月, 2014 1 次提交
-
-
由 Pavel Hrdina 提交于
This macro seems to be defined only on linux/unix and it fails during mingw build. Its value is '16' (taken from net/if.h) so define it if it's not defined. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 30 10月, 2014 6 次提交
-
-
由 Roman Bogorodskiy 提交于
The virGetSCSIHostNumber function return type is int, however its stubbed version returns NULL. That results in a build fail on systems that use the stubbed version. Fix by using a proper return type.
-
由 Roman Bogorodskiy 提交于
Currently, build fails on FreeBSD because its struct ifreq does not have ifr_hwaddr member. In order to fix that, check if this member is present, otherwise fall back to the stub version of the virNetDev{Add,Del}Multi functions.
-
由 John Ferlan 提交于
virFileReadAll returns a chunk of memory that needs to be free'd when done
-
由 John Ferlan 提交于
The complaint is that if cleanup is called when virFileReadAll fails, then mcast->entries is NULL and could be dereferenced in the clear function. After following the code some - I saw that the caller to the function (virNetDevGetMulticastTable) will also call virNetDevMcastListClear if this function returns -1, so this isn't necessary, so I removed the call.
-
由 John Ferlan 提交于
Coverity complains that because the for loop is from 0 to 5 (max tokens) and the impending switch/case statements used each of the #define values that the 'default' wouldn't reachable. This patch will convert the #define's into enum's and add the obligatory dead_error_begin marker for these type situations. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Peter Krempa 提交于
The code that parses the schema from the URI touches the "hosts[0]" member of the storage file source structure in case the URI contains a schema. The hosts array was not yet allocated at the point in the code where the transport protocol was parsed and set. This lead to a crash of libvirtd. Fix the code by allocating the "hosts" array upfront and add a test case to verify this scenario. (Unfortunately this requires shuffling the test case numbers too). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1156288
-
- 29 10月, 2014 6 次提交
-
-
由 Eric Blake 提交于
C guarantees that static variables are zero-initialized. Some older compilers (and also gcc -fno-zero-initialized-in-bss) create larger binaries if you explicitly zero-initialize a static variable. * src/libvirt.c: Fix initialization. * src/util/viralloc.c: Likewise. * src/util/virdbus.c: Likewise. * src/util/virevent.c: Likewise. * src/util/virfile.c (safezero): Likewise. * src/util/virlog.c: Likewise. * src/util/virnetlink.c: Likewise. * src/util/virthread.h (VIR_ONCE_GLOBAL_INIT): Likewise. * src/util/virprocess.c (virProcessGetStartTime): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
We weren't ever using the value for anything other than being non-zero. * src/util/viraudit.h (virAuditLog): Change signature. * src/util/viraudit.c (virAuditLog): Update user. * daemon/libvirtd.c (main): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 John Ferlan 提交于
Create the function from the code in getAdapterName() in order to return the "host#" name for the provided parentaddr values.
-
由 John Ferlan 提交于
Create/use virGetSCSIHostNumber to replace the static getHostNumber Removed the "if (result &&" since result is now required to be non NULL on input.
-
由 Cédric Bosdonnat 提交于
libc has another constant with the same name, which leads to redefinition error when building against static libvirt
-
由 Tony Krowiak 提交于
This patch provides the utility functions to needed to synchronize the changes made to a guest domain network device's multicast filter with the corresponding macvtap device's filter on the host: * Get/add/remove multicast MAC addresses * Get the macvtap device's RX filter list Signed-off-by: NTony Krowiak <akrowiak@linux.vnet.ibm.com> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 27 10月, 2014 1 次提交
-
-
由 Laine Stump 提交于
virNetDevLinkDump() gets a message from netlink into "resp", then calls nlmsg_parse() to fill the table "tb" with pointers into resp. It then returns tb to its caller, but not before freeing the buffer at resp. That means that all the callers of virNetDevLinkDump() are examining memory that has already been freed. This can be verified by filling the buffer at resp with garbage prior to freeing it (or, I suppose, just running libvirtd under valgrind) then performing some operation that calls virNetDevLinkDump(). The code has been like this ever since virNetDevLinkDump() was written - the original author didn't notice it, and neither did later additional users of the function. It has only been pure luck (or maybe a lack of heavy load, and/or maybe an allocation algorithm in malloc() that delays re-use of just-freed memory) that has kept this from causing errors, for example when configuring a PCI passthrough or macvtap passthrough network interface. The solution taken in this patch is the simplest - just return resp to the caller along with tb, then have the caller free it after they are finished using the data (pointers) in tb. I alternately could have made a cleaner interface by creating a new struct that put tb and resp together along with a vir*Free() function for it, but this function is only used in a couple places, and I'm not sure there will be additional new uses of virNetDevLinkDump(), so the value of adding a new type, extra APIs, etc. is dubious.
-
- 22 10月, 2014 3 次提交
-
-
由 Peter Krempa 提交于
The helper checks whether a string contains only whitespace or is NULL. This will be helpful to skip cases where a user string is optional, but may be provided empty with the same meaning.
-
由 Rick Harris 提交于
Newer versions of Debian use '/run/initctl' instead of '/dev/initctl'. This patch updates the code to search for the FIFO from a list of well-known locations.
-
由 Roman Bogorodskiy 提交于
Build with clang fails with: CC util/libvirt_util_la-virsocketaddr.lo util/virsocketaddr.c:904:17: error: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] inet4 = (struct sockaddr_in*) res->ai_addr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/virsocketaddr.c:909:17: error: cast from 'struct sockaddr *' to 'struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] inet6 = (struct sockaddr_in6*) res->ai_addr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Fix that by replacing virSocketAddrParseInternal() call with virSocketAddrParse() in the virSocketAddrIsNumericLocalhost() function. virSocketAddrParse stores an address in virSocketAddr. virSocketAddr uses a union to store an address, so it doesn't need casting.
-
- 15 10月, 2014 3 次提交
-
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Peter Krempa 提交于
Add a new option specifier that will optionally add a JSON key=value pair containing a nested object if the added object isn't NULL.
-
由 Peter Krempa 提交于
The JSON structure constructor has an option to add JSON arrays to the constructed object. The description is inaccurate as it can add any json object even a dict. Change the docs to cover this option and reject adding NULL objects.
-