- 04 7月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Use the probing functionality added in the last patch to turn on a capability bit when active commit is present, and gate active commit on that capability. For my own reference: the difference between BLOCKJOB_SYNC and BLOCKJOB_ASYNC is whether qemu generated an event at the conclusion of blockpull; basically, RHEL 6.2 was the only release of qemu that has the sync semantics and lacks the event. RHEL 6.3 added blockcopy, but also picked up on the upstream style of qemu generating events. As no one is likely to backport active commit to RHEL 6.2, it's safe for blockcommit to always require async blockjob support. Modifying qemucapabilitiestest is painful; the .replies files would be so much easier if they had comments correlating which command generated the given reply. Maybe I'll fix that up later... * src/qemu/qemu_capabilities.h (QEMU_CAPS_ACTIVE_COMMIT): New capability. * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Use the new bit * src/qemu/qemu_capabilities.c (virQEMUCaps): Name the new bit. (virQEMUCapsProbeQMPCommands): Set it. * tests/qemucapabilitiesdata/caps_1.3.1-1.replies: Update. * tests/qemucapabilitiesdata/caps_1.4.2-1.replies: Likewise. * tests/qemucapabilitiesdata/caps_1.5.3-1.replies: Likewise. * tests/qemucapabilitiesdata/caps_1.6.0-1.replies: Likewise. * tests/qemucapabilitiesdata/caps_1.6.50-1.replies: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
We are about to turn on support for active block commit. Although qemu 2.0 was the first version to mostly support it, that version mis-handles 0-length files, and doesn't have anything available for easy probing. But qemu 2.1 fixed bugs, and made life simpler by letting the 'top' argument be optional. Unless someone begs for active commit with qemu 2.0, for now we are just going to enable it only by probing for qemu 2.1 behavior (anyone backporting active commit can also backport the optional argument behavior). This requires qemu.git commit 7676e2c597000eff3a7233b40cca768b358f9bc9. Although all our actual uses of block-commit supply arguments for both base and top, we can omit both arguments and use a bogus device string to trigger an interesting behavior in qemu. All QMP commands first do argument validation, failing with GenericError if a mandatory argument is missing. Once that passes, the code in the specific command gets to do further checking, and the qemu developers made sure that if device is the only supplied argument, then the block-commit code will look up the device first, with a failure of DeviceNotFound, before attempting any further argument validation (most other validations fail with GenericError). Thus, the category of error class can reliably be used to decipher whether the top argument was optional, which in turn implies a working active commit. Since we expect our bogus device string to trigger an error either way, the code is written to return a distinct return value without spamming the logs. * src/qemu/qemu_monitor.h (qemuMonitorSupportsActiveCommit): New prototype. * src/qemu/qemu_monitor.c (qemuMonitorSupportsActiveCommit): Implement it. * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit): Allow NULL for top and base, for probing purposes. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit): Likewise, implementing the probe. * tests/qemumonitorjsontest.c (mymain): Enable... (testQemuMonitorJSONqemuMonitorSupportsActiveCommit): ...a new test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 03 7月, 2014 6 次提交
-
-
由 Michal Privoznik 提交于
The problem is, since 614581f3 domaincapstest is linked with $(LDADDS) by default. Then, since 94e3f23e the test may be conditionally linked with $(qemu_LDADDS) which already contains $(LDADDS). And some linkers doesn't cope with this nicely: CCLD domaincapstest ../src/libvirt_probes.o:(.probes+0x0): multiple definition of `libvirt_event_poll_add_handle_semaphore' ../src/libvirt_probes.o:(.probes+0x0): first defined here ../src/libvirt_probes.o:(.probes+0x2): multiple definition of `libvirt_event_poll_update_handle_semaphore' ../src/libvirt_probes.o:(.probes+0x2): first defined here ../src/libvirt_probes.o:(.probes+0x4): multiple definition of `libvirt_event_poll_remove_handle_semaphore' ../src/libvirt_probes.o:(.probes+0x4): first defined here ../src/libvirt_probes.o:(.probes+0x6): multiple definition of `libvirt_event_poll_dispatch_handle_semaphore' ../src/libvirt_probes.o:(.probes+0x6): first defined here And so on. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So far only information on disks and host devices are exposed in the capabilities XML. Well, at least something. Even a new test is introduced. The qemu capabilities are stolen from already existing qemucapabilities test. There's one tricky point though. Functions that checks host's KVM and VFIO capabilities, are impossible to mock currently. So in the test, we are setting the capabilities by hand. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Later on, we the qemu capabilities XML parsing code may come handy so instead of duplicating the code make the already existing one shared. By the same time, make the function accept file name instead of XML document stored already in memory. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
This new module holds and formats capabilities for emulator. If you are about to create a new domain, you may want to know what is the host or hypervisor capable of. To make sure we don't regress on the XML, the formatting is not something left for each driver to implement, rather there's general format function. The domain capabilities is a lockable object (even though the locking is not necessary yet) which uses reference counter. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Replace: if (virBufferError(&buf)) { virBufferFreeAndReset(&buf); virReportOOMError(); ... } with: if (virBufferCheckError(&buf) < 0) ... This should not be a functional change (unless some callers misused the virBuffer APIs - a different error would be reported then)
-
由 Ján Tomko 提交于
So far, we only report an error if formatting the siblings bitmap in NUMA topology fails. Be consistent and always report error in virCapabilitiesFormatXML.
-
- 02 7月, 2014 1 次提交
-
-
由 Mike Perez 提交于
This introduces two new attributes "cmd_per_lun" and "max_sectors" same with the names QEMU uses for virtio-scsi. An example of the XML: <controller type='scsi' index='0' model='virtio-scsi' cmd_per_lun='50' max_sectors='512'/> The corresponding QEMU command line: -device virtio-scsi-pci,id=scsi0,cmd_per_lun=50,max_sectors=512, bus=pci.0,addr=0x3 Signed-off-by: NMike Perez <thingee@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 01 7月, 2014 2 次提交
-
-
由 Michal Privoznik 提交于
In the test, the snapshot XML is written into a file that's located under: abs_srcdir/vboxsnapshotxmldata/testResult.vbox However, the abs_srcdir doesn't have to be necessarily writable. It should have been abs_builddir instead. Moreover, the label in the func creating the file is called 'fail' while it fulfils the duty of 'cleanup' label. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
At the very beginning of the test we check if the underlying filesystem supports extended attributes as they are used to store fake SELinux labels. In order to check that, a dummy file is created and semi-random attribute is set. However, the file is created under: abs_srcdir "/securityselinuxlabeldata/testxattr" which has two problems: abs_srcdir is not required to be writable, so it should have been abs_builddir. The second one is - there's no "securityselinuxlabeldata" folder under abs_builddir. The problem was introduced in caf164f1. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 6月, 2014 2 次提交
-
-
由 Ján Tomko 提交于
-
由 Jincheng Miao 提交于
libvirt unit test used setxattr with "user.libvirt.selinux" name to emulate setfilecon of selinux. But for some old kernel filesystem (like 2.6.32-431.el6.x86_64), if the filesystem is not mounted with user_xattr flag, the setxattr with "user.libvirt.selinux" will fail. So adding testUserXattrEnabled() in securityselinuxlabeltest.c, if user_xattr is not enabled, skip this case. The user_xattr is departed in newer kernel, therefore this commit is only for the compatablity for old kernel. Signed-off-by: NJincheng Miao <jmiao@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com> Tested-by: NScott Sullivan <ssullivan@liquidweb.com>
-
- 26 6月, 2014 3 次提交
-
-
由 Martin Kletzander 提交于
Since commit d86c876a we are using guestfwd=tcp:IP:PORT,chardev=ID for guestfwd specification, however, that has not changed in qemu, so guestfwd does not work since. Apart from that, guestfwd is not working with older qemu that doesn't have QEMU_CAPS_DEVICE. Both regressions exist since late 2009 and nobody found that (until now), so I'm only fixing the first one. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1112066Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Daniel P. Berrange 提交于
The QEMU VNC client arg code has a long standing typo of SASL_CONF_DIR when it should be SASL_CONF_PATH for the env variable name. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Jiri Denemark 提交于
When CPU comparison APIs return VIR_CPU_COMPARE_INCOMPATIBLE, the caller has no clue why the CPU is considered incompatible with host CPU. And in some cases, it would be nice to be able to get such info in a client rather than having to look in logs. To achieve this, the APIs can be told to return VIR_ERR_CPU_INCOMPATIBLE error for incompatible CPUs and the reason will be described in the associated error message. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 25 6月, 2014 9 次提交
-
-
由 Peter Krempa 提交于
The parent directory doesn't necessarily need to be stored after we don't mangle the path stored in the image. Remove it and tweak the code to avoid using it.
-
由 Peter Krempa 提交于
Store backing chain paths as non-canonical. The canonicalization step will be already taken. This will allow to avoid storing unnecessary amounts of data.
-
由 Peter Krempa 提交于
After we don't test relative paths, remove even more unnecessary cruft from the test code.
-
由 Peter Krempa 提交于
libvirt always uses an absolute path to address the top image of an image chain. Our storage test tests also the relative path which won't ever be used. Additionally it makes the test more complicated.
-
由 Peter Krempa 提交于
Now that we store only relative names in virStorageSource's member relPath the backingRelative member is obsolete. Remove it and adapt the code to the removal.
-
由 Peter Krempa 提交于
Separately remove the now unused variable.
-
由 Peter Krempa 提交于
Due to various refactors and compatibility with the virstoragetest the relPath field of the virStorageSource structure was always filled either with the relative name or the full path in case of absolutely backed storage. Return its original purpose to store only the relative name of the disk if it is backed relatively and tweak the tests.
-
由 Peter Krempa 提交于
Now that we changed ordering of the stored metadata so that the backing store is described by the child element the test should reflect this change too. Remove the expected backing store field as it's actually described by the next element in the backing chain, so there's no need for duplication.
-
由 Peter Krempa 提交于
This patch introduces a function that will allow us to resolve a relative difference between two elements of a disk backing chain. This function will be used to allow relative block commit and block pull where we need to specify the new relative name of the image to qemu. This patch also adds unit tests for the function to verify that it works correctly.
-
- 24 6月, 2014 3 次提交
-
-
由 Peter Krempa 提交于
Introduce a common function that will take a callback to resolve links that will be used to canonicalize paths on various storage systems and add extensive tests.
-
由 Peter Krempa 提交于
To free string lists with some strings stolen from the middle we need to walk the complete array. Introduce a new helper that takes the string list size to free such string lists.
- 23 6月, 2014 3 次提交
-
-
由 Laine Stump 提交于
There are no options to parse here other than the name of the device, and all three possible device names have the same prefix ("virtio-balloon" with "-ccw", "-pci", or "-device" appended), so the code is fairly simple. It has been implemented such that it will be easier to add handling for other -device entries that aren't otherwise recognized - just add another "else if (STRPREFIX(opts, ....)" clause. qemuParseCommandLineString() previously would always add a <memballoon model='virtio'/> to every result (the comments erroneously say that it is adding a <memballoon model='none'/>) This has been changed to add model='none', and 84 test case xml's updated accordingly (so that qemuxml2argvtest won't fail). Now that the memballoon device is properly parsed, we can safely add a test for properly ignoring -nodefconfig and -nodefaults. Rather than adding an entire new test case for this (and memballoon), we just randomly pick the clock-utc test and modify it slightly to fulfill the purpose.
-
由 Peter Krempa 提交于
makefile_conditionals tests/Makefile.am:293:endif maint.mk: match "if FOO" with "endif FOO" in Makefiles make: *** [sc_makefile_conditionals] Error 1
-
由 Peter Krempa 提交于
'virstoragetest' accesses backing chains of files on local storage with the help of the storage driver. Disable the test on builds without the storage driver as the test is crashing otherwise. Reported by: Roman Bogorodskiy
-
- 20 6月, 2014 5 次提交
-
-
由 Michal Privoznik 提交于
The virNodeParseSocket() function tries to get socked ID from 'topology/physical_package_id' file. However, on some architectures the file contains the -1 constant which makes in turn libvirt think the info extraction was unsuccessful. If that's the case, we need to overwrite the obtained integer with zero like we are doing for other architectures. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Currently, we are opening the cpuinfo file via fopen() which if fails doesn't print any error message. We should do that instead. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So far, we are doing compile time decisions on which architecture is used. However, for testing purposes it's much easier if we pass host architecture as parameter and then let the function decide which code snippet for extracting host CPU info will be used. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Laine Stump 提交于
This modifies the formatting function of virInterface to be a proper mirror of the parse function, including the addition of a "parentIfType" arg so that we can decide whether or not it is appropriate to emit the elements that are only in toplevel interfaces, as well as the <link> element (which isn't allowed for bridge interfaces). Since the restructuring of the code necessarily changes the order of some of the elements, some test case data had to be updated.
-
由 Laine Stump 提交于
The interface state for bonds and vlans does seem to reflect the state of the underlying physical devices, at least in some cases, so it makes sense to allow reporting it (netcf now does). The link state/speed for bridge devices is meaningless though, so we don't even look for it.
-
- 19 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
There are two places where you'll find info on page sizes. The first one is under <cpu/> element, where all supported pages sizes are listed. Then the second one is under each <cell/> element which refers to concrete NUMA node. At this place, the size of page's pool is reported. So the capabilities XML looks something like this: <capabilities> <host> <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid> <cpu> <arch>x86_64</arch> <model>Westmere</model> <vendor>Intel</vendor> <topology sockets='1' cores='1' threads='1'/> ... <pages unit='KiB' size='4'/> <pages unit='KiB' size='2048'/> <pages unit='KiB' size='1048576'/> </cpu> ... <topology> <cells num='4'> <cell id='0'> <memory unit='KiB'>4054408</memory> <pages unit='KiB' size='4'>1013602</pages> <pages unit='KiB' size='2048'>3</pages> <pages unit='KiB' size='1048576'>1</pages> <distances/> <cpus num='1'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> </cpus> </cell> <cell id='1'> <memory unit='KiB'>4071072</memory> <pages unit='KiB' size='4'>1017768</pages> <pages unit='KiB' size='2048'>3</pages> <pages unit='KiB' size='1048576'>1</pages> <distances/> <cpus num='1'> <cpu id='1' socket_id='0' core_id='0' siblings='1'/> </cpus> </cell> ... </cells> </topology> ... </host> <guest/> </capabilities> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 6月, 2014 1 次提交
-
-
由 Pavel Hrdina 提交于
On RHEL6 the vboxsnapshotxmltest fails because of wrong xml that is generated by libvirt. However the core issue is in the xml data itself with the wrong indentation. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 17 6月, 2014 2 次提交
-
-
由 Peter Krempa 提交于
Coverity checks for patterns of handling return values of functions. Some recent addition must have tripped a threshold where coverity now complains that we usually check the return value of virUUIDGenerate but don't do it in one place. Add a check to make coverity happy.
-
由 Eric Blake 提交于
Commit 7c6fc394 introduced a regression in the XML produced for older clients. The argument at the time was that clients shouldn't be depending on output-only data for something that is only going to be triggered for a transient guest; but John Ferlan reported that the automated testsuite was such a client. It's better to be safe than sorry by guaranteeing back-compat cruft. Note that later patches will be using <mirror> for active block commit, but there we don't have to worry about back-compat. * src/conf/domain_conf.c (virDomainDiskDefFormat): Restore old style output when necessary. * docs/schemas/domaincommon.rng: Validate back-compat style. * docs/formatdomain.html.in: Update the documentation. * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml: Update tests. * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-