- 03 6月, 2014 6 次提交
-
-
由 Peter Krempa 提交于
qemuMonitorJSONSendKey declares the "holdtime" argument as unsigned int while the command was constructed in qemuMonitorJSONMakeCommand using the "P" modifier which took a unsigned long from the variable arguments which then made it possible to access uninitialized memory. This broke the qemumonitorjsontest on 32bit fedora 20: 64) qemuMonitorJSONSendKey ... libvirt: QEMU Driver error : internal error: unsupported data type 'W' for arg 'WVSì D$0èwÿÿÃAå' FAILED Uncovered by upstream commit f744b831. Additionally add test for the hold-time option.
-
由 Peter Krempa 提交于
All the fields crammed into two lines weren't easy to parse by human eyes. Split up the format string into lines and put it into a central variable so that changes in two places aren't necessary.
-
由 Peter Krempa 提交于
To allow using the array manipulation macros on the arrays returned by virStringSplit we need to know the count of the elements in the array. Modify virStringSplit to return this value, rename it and add a helper with the old name so that we don't need to update all the code.
-
由 Peter Krempa 提交于
Use the new backing store parser in the backing chain crawler. This change needs one test change where information about the NBD image are now parsed differently.
-
由 Peter Krempa 提交于
Stat the path of the storage file being tested to set the correct type into the virStorageSource. This will avoid breaking the test suite when inquiring metadata of directory paths in the next patches.
-
由 Peter Krempa 提交于
My future work will modify the metadata crawler function to use the storage driver file APIs to access the files instead of accessing them directly so that we will be able to request the metadata for remote files too. To avoid linking the storage driver to every helper file using the utils code, the backing chain traversal function needs to be moved to the storage driver source. Additionally the virt-aa-helper and virstoragetest programs need to be linked with the storage driver as a result of this change.
-
- 01 6月, 2014 1 次提交
-
-
由 Laine Stump 提交于
Reported by: Roman Bogorodskiy <bogorodskiy@gmail.com> Some of the tests for virTimeLocalOffsetFromUTC set an imaginary timezone that attempts to force dyalight savings time active all the time by setting a start date of 0/00:00:00 and end date of 366/23:59:59. Since the day is 0-based, 366 really means "day 367" which will never occur - this was an attempt to eliminate problems with DST not being active in some cases right around midnight on January 1. Even though it didn't completely solve the problem, it didn't seem to cause harm so it was left in the test timezones. Although Linux glibc doesn't mind having a DST end date of 366, FreeBSD refuses to use such timezones, so the tests fail. This patch changes the 366 to 365. This may or may not cause failure of the remaining DST tests around midnight Jan 1. If so, we will need to disable those tests at year's end too.
-
- 31 5月, 2014 1 次提交
-
-
由 Eric Blake 提交于
On a 32-bit platform: virstringtest.c: In function 'mymain': virstringtest.c:673: warning: this decimal constant is unsigned only in ISO C90 I already had a comment in the file about the 64-bit counterpart; the easiest fix was to make both sites use the standardized macro that is guaranteed to work. * tests/virstringtest.c (mymain): Minimum signed integers are a pain. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 29 5月, 2014 3 次提交
-
-
由 Laine Stump 提交于
The original version of virTimeLocalOffsetFromUTC() would fail for certain times of the day if daylight savings time was active. This could most easily be seen by uncommenting the TEST_LOCALOFFSET() cases that include a DST setting. After a lot of experimenting, I found that the way to solve it in almost all test cases is to set tm_isdst = -1 in the struct tm prior to calling mktime(). Once this is done, the correct offset is returned for all test cases at all times except the two hours just after 00:00:00 Jan 1 UTC - during that time, any timezone that is *behind* UTC, and that is supposed to always be in DST will not have DST accounted for in its offset. I believe that the code of virTimeLocalOffsetFromUTC() actually is correct for all cases, but the problem still encountered is due to our inability to come up with a TZ string that properly forces DST to *always* be active. Since a modfication of the (currently fixed) expected result data to account for this would necessarily use the same functions that we're trying to test, I've instead just made the test program conditionally bypass the problematic cases if the current date is either December 31 or January 1. This way we get maximum testing during 363 days of the year, but don't get false failures on Dec 31 and Jan 1.
-
由 Jim Fehlig 提交于
Commit 292d3f2d fixed the build with libselinux 2.3, but missed some suggestions by eblake https://www.redhat.com/archives/libvir-list/2014-May/msg00977.html This patch changes the macro introduced in 292d3f2d to either be empty in the case of newer libselinux, or contain 'const' in the case of older libselinux. The macro is then used directly in tests/securityselinuxhelper.c.
-
由 Cédric Bosdonnat 提交于
Several function signatures changed in libselinux 2.3, now taking a 'const char *' instead of 'security_context_t'. The latter is defined in selinux/selinux.h as typedef char *security_context_t; Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 27 5月, 2014 2 次提交
-
-
由 Olivia Yin 提交于
QEMU ppce500 board uses the legacy -serial option. Other PPC boards don't give any way to explicitly wire in a -chardev except pseries which uses -device spapr-vty with -chardev. Add test case for -serial option for ppce500 Signed-off-by: NOlivia Yin <Hong-Hua.Yin@freescale.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Olivia Yin 提交于
ppce500v2 is not machine supported by official release of QEMU. It should be replaced by ppce500. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 26 5月, 2014 1 次提交
-
-
由 Laine Stump 提交于
Since there isn't a single libc API to get this value, this patch supplies one which gets the value by grabbing current time, then converting that into a struct tm with gmtime_r(), then back to a time_t using mktime. The returned value is the difference between UTC and localtime in seconds. If localtime is ahead of UTC (east) the offset will be a positive number, and if localtime is behind UTC (west) the offset will be negative. This function should be POSIX-compliant, and is threadsafe, but not async signal safe. If it was ever necessary to know this value in a child process, we could cache it with a one-time init function when libvirtd starts, then just supply the cached value, but that complexity isn't needed for current usage; that would also have the problem that it might not be accurate after a local daylight savings boundary. (If it weren't for DST, we could simply replace this entire function with "-timezone"; timezone contains the offset of the current timezone (negated from what we want) but doesn't account for DST. And in spite of being guaranteed by POSIX, it isn't available on older versions of mingw.) Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 5月, 2014 1 次提交
-
-
由 Eric Blake 提交于
I got a build failure when cross-compiling to mingw with the mingw64-dbus package installed: CC virmockdbus_la-virmockdbus.lo ../../tests/virmockdbus.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes] VIR_MOCK_STUB_VOID_ARGS(dbus_connection_set_change_sigpipe, ^ ../../tests/virmockdbus.c:33:18: error: 'dbus_bus_get' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes] VIR_MOCK_STUB_RET_ARGS(dbus_bus_get, ... Well duh - mingw lacks dlopen and friends, even if it can support dbus. A similar failure occured in virsystemdtest.c; but in that file, we know that systemd is a Linux-only concept. * tests/virmockdbus.c: Cripple on mingw. * tests/virsystemdtest.c: Cripple on non-Linux. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 5月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
We allow a seclabel to be specified in the <source> element of a chardev: <serial type='file'> <source path='/tmp/serial.file'> <seclabel model='dac' relabel='no'/> </source> </serial> But we format it outside the source: <serial type='file'> <source path='/tmp/serial.file'/> <target port='0'/> <seclabel model='dac' relabel='no'/> </serial> Move the formatting inside the source to fix this to make the seclabel persistent across XML format->parse. Introduced by commit f8b08d0e 'Add <seclabel> to character devices.'
-
- 13 5月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
With this patch, virDomainFSFreeze will pass the mountpoints argument to qemu guest agent. For example, virDomainFSFreeze(dom, {"/mnt/vol1", "/mnt/vol2"}, 2, 0) will issue qemu guest agent command: {"execute":"guest-fsfreeze-freeze", "arguments":{"mountpoints":["/mnt/vol1","/mnt/vol2"]}} Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com> Acked-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 07 5月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
QEMU commit 5e2ac51 added a boolean '-msg timestamp=[on|off]' option, which can enable timestamps on errors: $ qemu-system-x86_64 -msg timestamp=on zghhdorf 2014-04-09T13:25:46.779484Z qemu-system-x86_64: -msg timestamp=on: could not open disk image zghhdorf: Could not open 'zghhdorf': No such file or directory Enable this timestamp if the QEMU binary supports it. Add a 'log_timestamp' option to qemu.conf for disabling this behavior.
-
- 06 5月, 2014 3 次提交
-
-
由 Laine Stump 提交于
This uses the new QEMU_CAPS_HOST_PCI_MULTIDOMAIN capability when present, for -devivce pci-assign, -device vfio-pci, and -pcidevice. While creating tests for this new functionality, I noticed that the xmls for two existing tests had erroneously specified an until-now-ignored domain="0x0002", so I corrected those two tests, and also added two failure tests to be sure that we alert users who attempt to use a non-zero domain with a qemu that doesn't support it.
-
由 Laine Stump 提交于
Quite a long time ago, (apparently between qemu 0.12 and 0.13) qemu quietly began supporting the optional specification of a domain in the host-side address of all pci passthrough commands (by simply prepending it to the bus:slot.function format, as "dddd:bb:ss.f"). Since machines with multiple PCI domains are very rare, this never came up in practice, so libvirt was never updated to support it. This patch takes the first step to supporting specification of a non-0 domain in the host-side address of PCI devices being assigned to a domain, by adding a capability bit to indicate support "QEMU_CAPS_HOST_PCI_MULTIDOMAIN", and detect it. Since this support was added in a version prior to the minimum version required for QMP-style capabilities detection, the capability is always enabled for any qemu that uses QMP for capabilities detection. For older qemus, the only clue that a domain can be specified in the host pci address is the presence of the string "[seg:]" in the help string for -pcidevice. (Ironically, libvirt will not be modified to support specification of domain for -pcidevice, since any qemu new enough for us to care about also supports "-device pci-assign" or "-device vfio-pci", which are greatly preferred).
-
由 Julio Faracco 提交于
In "src/util/" there are many enumeration (enum) declarations. Sometimes, it's better using a typedef for variable types, function types and other usages. Other enumeration will be changed to typedef's in the future. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 5月, 2014 1 次提交
-
-
由 Roman Bogorodskiy 提交于
* bhyve_command.c (bhyveBuildNetArgStr, virBhyveProcessBuildBhyveCmd): add dryRun mode which doesn't create any devices when enabled * bhyve_command.c (virBhyveProcessBuildBhyveCmd, virBhyveProcessBuildDestroyCmd, virBhyveProcessBuildLoadCmd): accept virDomainDefPtr instead of virDomainObjPtr.
-
- 03 5月, 2014 2 次提交
-
-
由 Guido Günther 提交于
This fixes link failures like: CCLD virfirewalltest /usr/bin/ld: virfirewalltest-virfirewalltest.o: undefined reference to symbol 'dbus_message_iter_init_append'
-
由 Guido Günther 提交于
When building packages in a clean chroot the QEMU_USER and QEMU_GROUP don't exist making VirQemuDriverConfigNew fail with privileged=true. Avoid that by not requiring privileged mode upfront but setting it later so we skip the user/group existence check. This solution was suggested by Daniel P. Berrange and tested by Martin Kletzander.
-
- 02 5月, 2014 4 次提交
-
-
由 Roman Bogorodskiy 提交于
Currently firewalling is supported on Linux only, so skip the virfirewalltest on other platforms.
-
由 Martin Kletzander 提交于
gnutls-3.3.0 and newer leaves 2 FDs open in order to be backwards compatible when it comes to chrooted binaries [1]. Linking commandhelper with gnutls then leaves these two FDs open and commandtest fails thanks to that. This patch does not link commandhelper with libvirt.la, but rather only the utilities making the test pass. Based on suggestion from Daniel [2]. [1] http://lists.gnutls.org/pipermail/gnutls-help/2014-April/003429.html [2] https://www.redhat.com/archives/libvir-list/2014-April/msg01119.htmlSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Eric Blake 提交于
strtoul() is required to parse negative numbers as their twos-complement positive counterpart. But sometimes we want to reject negative numbers. Add new functions to do this. The 'p' suffix is a mnemonic for 'positive' (technically it also parses 0, but 'non-negative' doesn't lend itself to a nice one-letter suffix). * src/util/virstring.h (virStrToLong_uip, virStrToLong_ulp) (virStrToLong_ullp): New prototypes. * src/util/virstring.c (virStrToLong_uip, virStrToLong_ulp) (virStrToLong_ullp): New functions. * src/libvirt_private.syms (virstring.h): Export them. * tests/virstringtest.c (testStringToLong): Test them. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Commit f22b7899 called to light a long-standing latent bug: the behavior of virStrToLong_ui was different on 32-bit platforms than on 64-bit platforms. Curse you, C type promotion and narrowing rules, and strtoul specification. POSIX says that for a 32-bit long, strtol handles only 2^32 values [LONG_MIN to LONG_MAX] while strtoul handles 2^33 - 1 values [-ULONG_MAX to ULONG_MAX] with twos-complement wraparound for negatives. Thus, parsing -1 as unsigned long produces ULONG_MAX, rather than a range error. We WANT[1] this same shortcut for turning -1 into UINT_MAX when parsing to int; and get it for free with 32-bit long. But with 64-bit long, ULONG_MAX is outside the range of int and we were rejecting it as invalid; meanwhile, we were silently treating -18446744073709551615 as 1 even though it textually exceeds INT_MIN. Too bad there's not a strtoui() in libc that does guaranteed parsing to int, regardless of the size of long. The bug has been latent since 2007, introduced by Jim Meyering in commit 5d254191 in the attempt to eradicate unsafe use of strto[u]l when parsing ints and longs. How embarrassing that we are only discovering it now - so I'm adding a testsuite to ensure that it covers all the corner cases we care about. [1] Ideally, we really want the caller to be able to choose whether to allow negative numbers to wrap around to their 2s-complement counterpart, as in strtoul, or to force a stricter input range of [0 to UINT_MAX] by rejecting negative signs; this will be added in a later patch for all three int types. This patch is tested on both 32- and 64-bit; the enhanced virstringtest passes on both platforms, while virstoragetest now reliably fails on both platforms instead of just 32-bit platforms. That test will be fixed later. * src/util/virstring.c (virStrToLong_ui): Ensure same behavior regardless of platform long size. * tests/virstringtest.c (testStringToLong): New function. (mymain): Comprehensively test string to long parsing. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 01 5月, 2014 1 次提交
-
-
由 Stefan Berger 提交于
Refactor the ebiptablesTearNewRules function so that the teardown of temporary filters can also be called by the ebiptablesAllTeardown function. This fixes a problem that leaves temporary filters behind when a VM shuts down while its filters are modified. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> v1->v2: - test cases adjusted to expect more commands
-
- 30 4月, 2014 1 次提交
-
-
由 Pavel Hrdina 提交于
We need to include the testutils.h also for freebsd. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 29 4月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 26 4月, 2014 1 次提交
-
-
由 Dwight Engen 提交于
Signed-off-by: NDwight Engen <dwight.engen@oracle.com>
-
- 25 4月, 2014 8 次提交
-
-
由 Daniel P. Berrange 提交于
dlfcn.h does not exist on Win32 so must only be used conditionally Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Create a nwfilterxml2firewalltest to exercise the ebiptables_driver.applyNewRules method with a variety of different XML input files. The XML input files are taken from the libvirt-tck nwfilter tests. While the nwfilter tests verify the final state of the iptables chains, this test verifies the set of commands invoked to create the chains. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebtablesApplyDropAllRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebtablesApplyDHCPOnlyRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebtablesApplyBasicRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebiptablesTearNewRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebtablesRemoveBasicRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebiptablesTearOldRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-