- 06 7月, 2011 1 次提交
-
-
由 Guannan Ren 提交于
add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach Initialize three state value of device driver to 1. This is just for a new call to qemudNodeDeviceReAttach()
-
- 04 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Coverity noted that most clients reacted to failure to hash; but in a best-effort kill loop, we can ignore failure. * src/util/cgroup.c (virCgroupKillInternal): Ignore hash failure.
-
- 02 7月, 2011 3 次提交
-
-
由 Eric Blake 提交于
Detected by Coverity. Some, but not all, error paths were clean; but they were repetitive so I refactored them. * src/util/pci.c (pciGetDevice): Plug leak.
-
由 Eric Blake 提交于
Detected by Coverity. Unlikely to hit unless the file contents were corrupted. * src/util/interface.c (ifaceRestoreMacAddress): Plug leak.
-
由 Eric Blake 提交于
To avoid regressions, we let callers specify whether to require a minor and micro version. Callers that were parsing uname() output benefit from defaulting to 0, whereas callers that were parsing version strings from other sources should not change in behavior. * src/util/util.c (virParseVersionString): Allow caller to choose whether to fail if minor or micro is missing. * src/util/util.h (virParseVersionString): Update signature. * src/esx/esx_driver.c (esxGetVersion): Update callers. * src/lxc/lxc_driver.c (lxcVersion): Likewise. * src/openvz/openvz_conf.c (openvzExtractVersionInfo): Likewise. * src/uml/uml_driver.c (umlGetVersion): Likewise. * src/vbox/vbox_MSCOMGlue.c (vboxLookupVersionInRegistry): Likewise. * src/vbox/vbox_tmpl.c (vboxExtractVersion): Likewise. * src/vmware/vmware_conf.c (vmwareExtractVersion): Likewise. * src/xenapi/xenapi_driver.c (xenapiGetVersion): Likewise. Reported by Matthias Bolte.
-
- 01 7月, 2011 3 次提交
-
-
由 Scott Moser 提交于
linux 3.0 has no micro version number, and that is causing problems for virParseVersionString. The patch below should allow for: major major.minor major.minor.micro If major or minor are not present they just default to zero. We found this in Ubuntu (https://bugs.launchpad.net/bugs/802977)
-
由 Eric Blake 提交于
Detected by Coverity. No real harm in leaving these, but fixing them cuts down on the noise for future analysis. * src/rpc/virnetserver.c (virNetServerAddService): Delete unused entry. * src/util/sysinfo.c (virSysinfoRead): Delete dead assignment to base.
-
由 Daniel P. Berrange 提交于
* src/util/json.c: Remove warning message
-
- 29 6月, 2011 5 次提交
-
-
由 Minoru Usui 提交于
If virSysinfoParse{BIOS,System,Processor,Memory}() can't find newline('\n'), these return NULL. This patch fixes this. Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
-
由 Matthias Bolte 提交于
addnhostsSave and hostsfileSave expect < 0 return value on error from addnhostsWrite and hostsfileWrite but then pass err instead of -err to virReportSystemError that expects an errno value. Also addnhostsWrite returns -ENOMEM and errno, change this to -errno. addnhostsWrite and hostsfileWrite tried to unlink the tempfile after renaming it, making both fail on the final step. Remove the unnecessary unlink calls.
-
由 Matthias Bolte 提交于
-
由 Matthias Bolte 提交于
networkSaveDnsmasqHostsfile was added in 8fa9c221 (Apr 2010). It has a force flag. If the dnsmasq hostsfile already exists force needs to be true to overwrite it. networkBuildDnsmasqArgv sets force to false, networkDefine sets it to true. This results in the hostsfile being written only in networkDefine in the common case. If no error occurred networkSaveDnsmasqHostsfile returns true and networkBuildDnsmasqArgv adds the --dhcp-hostsfile to the dnsmasq command line. networkSaveDnsmasqHostsfile was changed in 89ae9849 (24 Jun 2011) to return a new dnsmasqContext instead of reusing one. This change broke the logic of the force flag as now networkSaveDnsmasqHostsfile returns NULL on error, but the early return -- if force was not set and the hostsfile exists -- returns 0. This turned the early return in an error case and networkBuildDnsmasqArgv didn't add the --dhcp-hostsfile option anymore if the hostsfile already exists. It did because networkDefine created the hostsfile already. Then 9d4e2845 fixed the return 0 case in networkSaveDnsmasqHostsfile but didn't apply the force option correctly to the new addnhosts file. Now force doesn't control an early return anymore, but influences the handling of the hostsfile context creation and dnsmasqSave is always called now. This commit also added test cases that reveal several problems. First, the tests now calls functions that try to write the dnsmasq config files to disk. If someone runs this tests as root this might overwrite actively used dnsmasq config files, this is a no-go. Also the tests depend on configure --localstatedir, this needs to be fixed as well, because it makes the tests fail when localstatedir is different from /var. This patch does several things to fix this: 1) Move dnsmasqContext creation and saving out of networkBuildDnsmasqArgv to the caller to separate the command line generation from the config file writing. This makes the command line generation testable without the risk of interfering with system files, because the tests just don't call dnsmasqSave. 2) This refactoring of networkSaveDnsmasqHostsfile makes the force flag useless as the saving happens somewhere else now. This fixes the wrong usage of the force flag in combination with then newly added addnhosts file by removing the force flag. 3) Adapt the wrong test cases to the correct behavior, by adding the missing --dhcp-hostsfile option. Both affected tests contain DHCP host elements but missed the necessary --dhcp-hostsfile option. 4) Rename networkSaveDnsmasqHostsfile to networkBuildDnsmasqHostsfile, because it doesn't save the dnsmasqContext anymore. 5) Move all directory creations in dnsmasq context handling code from the *New functions to dnsmasqSave to avoid directory creations in system paths in the test cases. 6) Now that networkBuildDnsmasqArgv doesn't create the dnsmasqContext anymore the test case can create one with the localstatedir that is expected by the tests instead of the configure --localstatedir given one.
-
由 Eric Blake 提交于
Detected by gcc -O2, introduced in commit 532ce9c2. If dmidecode outputs a field unrecognized by the parsers, then the code would dereference an uninitialized eol variable. * src/util/sysinfo.c (virSysinfoParseBIOS) (virSysinfoParseSystem, virSysinfoParseProcessor) (virSysinfoParseMemory): Avoid uninitialized variable.
-
- 27 6月, 2011 2 次提交
-
-
由 Minoru Usui 提交于
Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]
-
由 Minoru Usui 提交于
Fix lack of error check in virSysinfoFormat(). Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
-
- 25 6月, 2011 3 次提交
-
-
由 Eric Blake 提交于
It's unlikely that we'll ever want to escape a string as long as INT_MAX/6, but adding this check can't hurt. * src/util/buf.c (virBufferEscapeSexpr, virBufferEscapeString): Check for (unlikely) overflow.
-
由 Matthias Bolte 提交于
-
由 Michal Novotny 提交于
Signed-off-by: NMichal Novotny <minovotn@redhat.com>
-
- 24 6月, 2011 3 次提交
-
-
由 Minoru Usui 提交于
* src/util/sysinfo.[ch]: also parse and save all the SMBIOS informations about memory modules
-
由 Minoru Usui 提交于
* src/util/sysinfo.c: add parsing and formatting of processor information data
-
由 Minoru Usui 提交于
* src/util/sysinfo.c: Separate BIOSInfo and SystemInfo part from virSysinfoRead()
-
- 23 6月, 2011 7 次提交
-
-
由 Stefan Berger 提交于
This patch fixes the compilation of netlink.c and interface.c on those systems missing either libnl or that have an older linux/if_link.h include file not supporting macvtap or VF_PORTS. WITH_MACVTAP is '1' if newer include files were detected, '0' otherwise. IFLA_PORT_MAX is defined in linux/if_link.h if yet more functionality is supported.
-
由 Osier Yang 提交于
-
由 Eric Blake 提交于
See previous patch for why this is good... * src/util/pci.c (struct _pciDevice, pciGetDevice, pciFreeDevice): Manage path dynamically. Report snprintf overflow. * src/util/hostusb.c (struct _usbDevice, usbGetDevice) (usbFreeDevice): Likewise.
-
由 Eric Blake 提交于
Bug introduced in commit 6a597883. * src/util/netlink.h: Add boilerplate.
-
由 Stefan Berger 提交于
In a second cleanup step this patch makes several interface functions from macvtap.c commonly available by moving them into interface.c and prefixing their names with 'iface'. Those functions taking Linux-specific structures as parameters are only visible on Linux. ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr call and display an error message if setting the MAC address did not work. The caller is unchanged and still ignores the return code (which is ok).
-
由 Stefan Berger 提交于
In a first cleanup step, make nlComm from macvtap.c commonly available for other code to use. Since nlComm uses Linux-specific structures as parameters it's prototype is only visible on Linux.
-
由 Daniel P. Berrange 提交于
Files under src/util must not depend on src/conf Solve the macvtap problem by moving the definition of macvtap modes from domain_conf.h into macvtap.h * src/util/macvtap.c, src/util/macvtap.h: Add enum for macvtap modes * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove enum for macvtap modes
-
- 22 6月, 2011 1 次提交
-
-
由 Osier Yang 提交于
virCommandProcessIO: It's reading from stdout or stderr of child, but not writing.
-
- 21 6月, 2011 3 次提交
-
-
由 Dirk Herrendoerfer 提交于
The following patch addresses the problem that when a PASSTHROUGH mode DIRECT NIC connection is made the MAC address of the NIC is not automatically set and reset to the configured VM MAC and back again. The attached patch fixes this problem by setting and resetting the MAC while remembering the previous setting while the VM is running. This also works if libvirtd is restarted while the VM is running. the patch passes make syntax-check
-
由 Cole Robinson 提交于
-
由 Cole Robinson 提交于
Since we virEventRegisterDefaultImpl is now a public API, callers need a way to invoke the default registered Handle and Timeout functions. We already have general functions for these internally, so promote them to the public API. v2: Actually add APIs to libvirt.h
-
- 17 6月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Most of the safezero() implementations return -1 on error, setting errno. The safezero() impl using posix_fallocate() though returned a positive errno value on error (due to the unusual API contract of posix_fallocate() compared to most syscall APIs). * src/util/util.c: Ensure safezero() returns -1 and sets errno on error. * src/storage/storage_backend.c: Change safezero != 0 to < 0 for detecting errors
-
- 14 6月, 2011 4 次提交
-
-
由 Eric Blake 提交于
Previously, the parent process opened 'null' to /dev/null, then the child process closes 'null' as well as 'childout'. But if childout was set to be null, then this is a double close. At least the double close was confined to the child process after a fork, and therefore there is no risk of another thread opening an fd of the same value to be bitten by the double close, but it is always better to avoid double-close to begin with. Additionally, if all three fds were specified, then opening 'null' was wasted. This patch fixes things to lazily open null on the first use, then guarantees it gets closed exactly once. * src/util/command.c (getDevNull): New helper function. (virExecWithHook): Use it to avoid spurious opens and double close.
-
由 Eric Blake 提交于
This also reduces malloc pressure for invoking a child when VIR_DEBUG is enabled. * src/util/command.c (virExecWithHook): Drop debug, since the only caller (virCommandRunAsync) also prints debug info.
-
由 Osier Yang 提交于
Push under trivial rule.
-
由 Stefan Berger 提交于
The below patch decreases the response time of libvirt to errors reported by Qemu upon startup by checking whether the qemu process is still alive while polling for the local socket to show up. This patch also introduces a special handling of signal for the Win32 part of virKillProcess.
-
- 13 6月, 2011 2 次提交
-
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
- 08 6月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Coverity already saw through a NULL dereference without these annotations, and gcc is still too puny to do good NULL analysis. But clang still benefits (and is easier to run than coverity), not to mention that adding this bit of documentation to the code may help future developers remember the constraints. * src/util/uuid.h (virGetHostUUID, virUUIDFormat): Document restrictions, for improved static analysis.
-