- 20 1月, 2014 3 次提交
-
-
由 Jiri Denemark 提交于
This file is used by PCI detach and reattach APIs to probe for a driver that handles a specific device. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Jiri Denemark 提交于
For example: ... 5) testVirPCIDeviceIsAssignable(0005:90:01.0) ... OK 6) testVirPCIDeviceIsAssignable(0001:01:00.0) ... OK Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Gao feng 提交于
This patch introduces virCgroupSetBlkioDeviceReadIops, virCgroupSetBlkioDeviceWriteIops, virCgroupSetBlkioDeviceReadBps and virCgroupSetBlkioDeviceWriteBps, we can use these interfaces to set up throttle blkio cgroup for domain. This patch also adds the new throttle blkio cgroup elements to the test xml. Signed-off-by: NGuan Qiang <hzguanqiang@corp.netease.com> Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
- 16 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
While working on v1.0.5-maint (the branch in use on Fedora 19) with the host at Fedora 20, I got a failure in virstoragetest. I traced it to the fact that we were using qemu-img to create a qcow2 file, but qemu-img changed from creating v2 files by default in F19 to creating v3 files in F20. Rather than leaving it up to qemu-img, it is better to write the test to force testing of BOTH file formats (better code coverage and all). This patch alone does not fix all the failures in v1.0.5-maint; for that, we must decide to either teach the older branch to understand v3 files, or to reject them outright as unsupported. But for upstream, making the test less dependent on changing qemu-img defaults is always a good thing. * tests/virstoragetest.c (testPrepImages): Simplify creation of raw file; check if qemu supports compat and if so use it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 15 1月, 2014 2 次提交
-
-
由 Pavel Hrdina 提交于
For a "newfd1" the coverity tools thinks that the fd is closed in a "virCommandPassFD", but with "flags == 0" it cannot be closed. The code itself is ok, but coverity tool thinks that there is "double_close" of the "newfd1" and to prevent showing this error we simply add a comment before the proper close. This has been found by coverity. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Strings "file" and "context" may not be freed if "VIR_EXPAND_N" fails and it leads into memory leak. This has been found by coverity. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 14 1月, 2014 1 次提交
-
-
由 Nehal J Wani 提交于
While running objecteventtest, it was found that valgrind pointed out the following memory leak: ==125== 538 (56 direct, 482 indirect) bytes in 1 blocks are definitely lost in loss record 216 of 226 ==125== at 0x4A06B6F: calloc (vg_replace_malloc.c:593) ==125== by 0x4C65D8D: virAllocVar (viralloc.c:558) ==125== by 0x4C9F055: virObjectNew (virobject.c:190) ==125== by 0x4D2B2E8: virGetDomain (datatypes.c:220) ==125== by 0x4D79180: testDomainDefineXML (test_driver.c:2962) ==125== by 0x4D4977D: virDomainDefineXML (libvirt.c:8512) ==125== by 0x4029C2: testDomainCreateXMLMixed (objecteventtest.c:226) ==125== by 0x403A21: virtTestRun (testutils.c:138) ==125== by 0x4021C2: mymain (objecteventtest.c:549) ==125== by 0x4040C2: virtTestMain (testutils.c:593) ==125== by 0x341F421A04: (below main) (libc-start.c:225) Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 11 1月, 2014 2 次提交
-
-
由 Daniel P. Berrange 提交于
Any test suite which involves a virDomainDefPtr should call virDomainDefCheckABIStability with itself just as a basic sanity check that the identity-comparison always succeeds. This would have caught the recent NULL pointer access crash. Make sure we cope with def->name being NULL since the VMWare config parser produces NULL names. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Eric Blake 提交于
When idmap was added to LXC, we forgot to cover it in the testsuite. The schema was missing an <element> layer, and as a result, virt-xml-validate was failing on valid dumpxml output. Reported by Eduard - Gabriel Munteanu on IRC. * docs/schemas/domaincommon.rng (idmap): Include <idmap> element, and support interleaves. * tests/lxcxml2xmldata/lxc-idmap.xml: New file. * tests/lxcxml2xmltest.c (mymain): Test it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 1月, 2014 5 次提交
-
-
由 Eric Blake 提交于
If a user registers for a domain event filtered to a particular domain, but the persistent domain is offline at the time, then the code silently failed to set up the filter. As a result, the event fires for all domains, rather than being filtered. Network events were immune, since they always passed an id 0 argument. The key to this patch is realizing that virObjectEventDispatchMatchCallback() only cared about uuid; so refusing to create a meta for a negative id is pointless, and in fact, malloc'ing meta at all was overkill; instead, just directly store a uuid and a flag of whether to filter. Note that virObjectEventPtr still needs all fields of meta, because this is how we reconstruct a virDomainPtr inside the dispatch handler before calling the end user's callback pointer with the correct object, even though only the uuid portion of meta is used in deciding whether a callback matches the given event. So while uuid is optional for callbacks, it is mandatory for events. The change to testDomainCreateXMLMixed is merely on the setup scenario (as you can't register for a domain unless it is either running or persistent). I actually first wrote that test for this patch, then rebased it to also cover a prior patch (commit 4221d64f), but had to adjust it for that patch to use Create instead of Define for setting up the domain long enough to register the event in order to work around this bug. But while the setup is changed, the main body of the test is still about whether creation events fire as expected. * src/conf/object_event_private.h (_virObjectEventCallback): Replace meta with uuid and flag. (virObjectEventCallbackListAddID): Update signature. * src/conf/object_event.h (virObjectEventStateRegisterID): Likewise. * src/conf/object_event_private.h (virObjectEventNew): Document use of name and uuid in events. * src/conf/object_event.c (virObjectEventCallbackListAddID): Drop arguments that don't affect filtering. (virObjectEventCallbackListRemoveID) (virObjectEventDispatchMatchCallback) (virObjectEventStateRegisterID): Update clients. * src/conf/domain_event.c (virDomainEventCallbackListAdd) (virDomainEventStateRegisterID): Likewise. * src/conf/network_event.c (virNetworkEventStateRegisterID): Likewise. * tests/objecteventtest.c (testDomainCreateXMLMixed): Enhance test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Consider these two calls, in either order: id1 = virConnectDomainEventRegisterAny(conn, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(callback), NULL, NULL); virConnectDomainEventRegister(conn, callback, NULL, NULL); Right now, the second call fails, because under the hood, the old-style function registration is tightly coupled to the new style lifecycle eventID, and the two calls both try to register the same global eventID callback representation. We've alreay documented that users should avoid old-style registration and deregistration, so anyone heeding the advice won't run into this situation. But it would be even nicer if we pretend the two interfaces are completely separate, and disallow any cross-linking. That is, a call to old-style deregister should never remove a new-style callback even if it is the same function pointer, and a call to new-style callback using only callbackIDs obtained legitimately should never remove an old-style callback (of course, since our callback IDs are sequential, and there is still coupling under the hood, you can easily guess the callbackID of an old style registration and use new-style deregistration to nuke it - but that starts to be blatantly bad coding on your part rather than a surprising result on what looks like reasonable stand-alone API). With this patch, you can now register a global lifecycle event handler twice, by using both old and new APIs; if such an event occurs, your callback will be entered twice. But that is not a problem in practice, since it is already possible to use the new API to register both a global and per-domain event handler using the same function, which will likewise fire your callback twice for that domain. Duplicates are still prevented when using the same API with same parameters twice (old-style twice, new-style global twice, or new-style per-domain with same domain twice), and things are still bounded (it is not possible to register a single function pointer more than N+2 times per event id, where N is the number of domains available on the connection). Besides, it has always been possible to register as many separate function pointers on the same event id as desired, through either old or new style API, where the bound there is the physical limitation of writing a program with enough distinct function pointers. Adding another event registration in the testsuite is sufficient to cover this, where the test fails without the rest of the patch. * src/conf/object_event.c (_virObjectEventCallback): Add field. (virObjectEventCallbackLookup): Add argument. (virObjectEventCallbackListAddID, virObjectEventStateCallbackID): Adjust callers. * tests/objecteventtest.c (testDomainCreateXMLMixed): Enhance test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
When determining if a device is behind a PCI bridge, the PCI device class is checked by reading the config space. However, there are some devices which have the wrong class on the config space, but the class is initialized by Linux correctly as a PCI BRIDGE. This class can be read by the sysfs file '/sys/bus/pci/devices/xxxx:xx:xx.x/class'. One example of such bridge is IBM PCI Bridge 1014:03b9, which is identified as a Host Bridge when reading the config space. Signed-off-by: NThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
-
由 Eric Blake 提交于
Bah, serves me right for merging patches without one last compile test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Right now, the older virConnectDomainEventRegister (takes a function pointer, returns 0 on success) and the newer virConnectDomainEventRegisterID (takes an eventID, returns a callbackID) share the underlying implementation (the older API ends up consuming a callbackID for eventID 0 under the hood). We implemented that by a lot of copy and pasted code between object_event.c and domain_event.c, according to whether we are dealing with a function pointer or an eventID. However, our copy and paste is not symmetric. Consider this sequence: id1 = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(callback), NULL, NULL); virConnectDomainEventRegister(conn, callback, NULL, NULL); virConnectDomainEventDeregister(conn, callback); virConnectDomainEventDeregsiterAny(conn, id1); the first three calls would succeed, but the third call ended up nuking the id1 callbackID (the per-domain new-style handler), then the fourth call failed with an error about an unknown callbackID, leaving us with the global handler (old-style) still live and receiving events. It required another old-style deregister to clean up the mess. Root cause was that virDomainEventCallbackList{Remove,MarkDelete} were only checking for function pointer match, rather than also checking for whether the registration was global. Rather than playing with the guts of object_event ourselves in domain_event, it is nicer to add a mapping function for the internal callback id, then share common code for event removal. For now, the function-to-id mapping is used only internally; I thought about whether a new public API to let a user learn the callback would be useful, but decided exposing this to the user is probably a disservice, since we already publicly document that they should avoid the old style, and since this patch already demonstrates that older libvirt versions have weird behavior when mixing old and new styles. And like all good bug fix patches, I enhanced the testsuite, validating that the changes in tests/ expose the failure without the rest of the patch. * src/conf/object_event.c (virObjectEventCallbackLookup) (virObjectEventStateCallbackID): New functions. (virObjectEventCallbackLookup): Use helper function. * src/conf/object_event_private.h (virObjectEventStateCallbackID): Declare new function. * src/conf/domain_event.c (virDomainEventStateRegister) (virDomainEventStateDeregister): Let common code handle the complexity. (virDomainEventCallbackListRemove) (virDomainEventCallbackListMarkDelete) (virDomainEventCallbackListAdd): Drop unused functions. * tests/objecteventtest.c (testDomainCreateXMLMixed): New test. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 1月, 2014 3 次提交
-
-
test:///default由 Eric Blake 提交于
Prior to this patch, every test:/// URI has its own event manager, which means that registering for an event can only ever receive events from the connection where it issued the API that triggered the event. But the whole idea of events is to be able to learn about something where an API call did NOT trigger the action. In order to actually test asynchronous events, I wanted to be able to tie multiple test connections to the same state. Use of a file in a test URI is still per-connection state, but now parallel connections to test:///default (from the same binary, of course) now share common state and can affect one another. The updated testsuite fails without the rest of this patch. Valgrind didn't report any leaks. * src/test/test_driver.c (testConnectOpen): Move per-connection state initialization... (testOpenFromFile): ...here. (defaultConn, defaultConnections, defaultLock, testOnceInit): New shared state. (testOpenDefault): Only initialize on first connection. (testConnectClose): Don't clobber state if still shared. * tests/objecteventtest.c (testDomainStartStopEvent): Enhance to cover this. (timeout, mymain): Ensure test fails rather than blocks. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Ever since their introduction (commit 1509b802 in v0.5.0 for virConnectDomainEventRegister, commit 44457238 in v0.8.0 for virConnectDomainEventDeregisterAny), the event deregistration functions have been documented as returning 0 on success; likewise for older registration (only the newer RegisterAny must return a non-zero callbackID). And now that we are adding virConnectNetworkEventDeregisterAny for v1.2.1, it should have the same semantics. Fortunately, all of the stateful drivers have been obeying the docs and returning 0, thanks to the way the remote_driver tracks things (in fact, the RPC wire protocol is unable to send a return value for DomainEventRegisterAny, at least not without adding a new RPC number). Well, except for vbox, which was always failing deregistration, due to failure to set the return value to anything besides its initial -1. But for local drivers, such as test:///default, we've been returning non-zero numbers; worse, the non-zero numbers have differed over time. For example, in Fedora 12 (libvirt 0.8.2), calling Register twice would return 0 and 1 [the callbackID generated under the hood]; while in Fedora 20 (libvirt 1.1.3), it returns 1 and 2 [the number of callbacks registered for that event type]. Since we have changed the behavior over time, and since it differs by local vs. remote, we can safely argue that no one could have been reasonably relying on any particular behavior, so we might as well obey the docs, as well as prepare callers that might deal with older clients to not be surprised if the docs are not strictly followed. For consistency, this patch fixes the code for all drivers, even though it only makes an impact for vbox and for local drivers. By fixing all drivers, future copy and paste from a remote driver to a local driver is less likely to reintroduce the bug. Finally, update the testsuite to gain some coverage of the issue for local drivers, including the first test of old-style domain event registration via function pointer instead of event id. * src/libvirt.c (virConnectDomainEventRegister) (virConnectDomainEventDeregister) (virConnectDomainEventDeregisterAny): Clarify docs. * src/libxl/libxl_driver.c (libxlConnectDomainEventRegister) (libxlConnectDomainEventDeregister) (libxlConnectDomainEventDeregisterAny): Match documentation. * src/lxc/lxc_driver.c (lxcConnectDomainEventRegister) (lxcConnectDomainEventDeregister) (lxcConnectDomainEventDeregisterAny): Likewise. * src/test/test_driver.c (testConnectDomainEventRegister) (testConnectDomainEventDeregister) (testConnectDomainEventDeregisterAny) (testConnectNetworkEventDeregisterAny): Likewise. * src/uml/uml_driver.c (umlConnectDomainEventRegister) (umlConnectDomainEventDeregister) (umlConnectDomainEventDeregisterAny): Likewise. * src/vbox/vbox_tmpl.c (vboxConnectDomainEventRegister) (vboxConnectDomainEventDeregister) (vboxConnectDomainEventDeregisterAny): Likewise. * src/xen/xen_driver.c (xenUnifiedConnectDomainEventRegister) (xenUnifiedConnectDomainEventDeregister) (xenUnifiedConnectDomainEventDeregisterAny): Likewise. * src/network/bridge_driver.c (networkConnectNetworkEventDeregisterAny): Likewise. * tests/objecteventtest.c (testDomainCreateXMLOld): New test. (mymain): Run it. (testDomainCreateXML): Check return values. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Pranavkumar Sawargaonkar 提交于
AArch64 qemu has similar behavior as armv7l, like use of mmio etc. This patch adds similar bypass checks what we have for armv7l to aarch64. E.g. we are enabling mmio transport for Nicdev. Making addDefaultUSB and addDefaultMemballoon to false etc. V3: - Adding missing domain rng schema for aarcg64 and test case in testutilsqemu.c which was causing test suite failure while running make check. V2: - Added testcase to qemuxml2argvtest as suggested during review comments of V1. V1: - Initial patch. Signed-off-by: NAnup Patel <anup.patel@linaro.org> Signed-off-by: NPranavkumar Sawargaonkar <pranavkumar@linaro.org>
-
- 06 1月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Do not leave the PCI address of the primary video card set to the legacy default (0000:00:02.0) if we're doing two-pass allocation. Since QEMU 1.6 (QEMU_CAPS_VIDEO_PRIMARY) we allow the primary video card to be on other slots than 0000:00:02.0 (as we use -device instead of -vga). However we fail to assign it an address if: * another device explicitly uses 0000:00:02.0 and * the primary video device has no address specified On the first pass, we have set the address to default, then checked if it's available, leaving it set even if it wasn't. This address got picked up by the second pass, resulting in a conflict: XML error: Attempted double use of PCI slot 0000:00:02.0 (may need "multifunction='on'" for device on function 0) Also fix the test that was supposed to catch this.
-
- 02 1月, 2014 4 次提交
-
-
由 Eric Blake 提交于
'make syntax-check' wasn't happy with commit fb004207. * tests/virnetsockettest.c (checkProtocols): Typo fix. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Richard W.M. Jones 提交于
On AArch64 the kernel prints one "processor" (lower case 'p') line per core. As this was missing from the test data, virSysinfo was not parsing any processors at all. Fix the test data so the test now passes.
-
由 Richard W.M. Jones 提交于
-
由 Richard W.M. Jones 提交于
-
- 24 12月, 2013 1 次提交
-
-
由 Cédric Bosdonnat 提交于
On openSUSE 12.x with GNUTLS 3.0.28, virnettlscontexttest fails. It has been reported to work from GNUTLS 3.1.11 on Fedora 19. Changed the constraints on gnutls to 3.1+ for unit test cacert4req. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 12月, 2013 1 次提交
-
-
由 Cédric Bosdonnat 提交于
D-bus introduced some changes in its locking code. Overriding the init function skips the new locking init and thus crashes later in libvirt test. Removing the function makes the test pass again.
-
- 18 12月, 2013 1 次提交
-
-
由 Eric Blake 提交于
On a system that is enforcing FIPS, most libraries honor the current mode by default. Qemu, on the other hand, refused to honor FIPS mode unless you add the '-enable-fips' command line option; worse, this option is not discoverable via QMP, and is only present on binaries built for Linux. So, if we detect FIPS mode, then we unconditionally ask for FIPS; either qemu is new enough to have the option and then correctly cripple insecure VNC passwords, or it is so old that we are correctly avoiding a FIPS violation by preventing qemu from starting. Meanwhile, if we don't detect FIPS mode, then omitting the argument is safe whether the qemu has the option (but it would do nothing because FIPS is disabled) or whether qemu lacks the option (including in the case where we are not running on Linux). The testsuite was a bit interesting: we don't want our test to depend on whether it is being run in FIPS mode, so I had to tweak things to set the capability bit outside of our normal interaction with capability parsing. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1035474 * src/qemu/qemu_capabilities.h (QEMU_CAPS_ENABLE_FIPS): New bit. * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Conditionally set capability according to detection of FIPS mode. * src/qemu/qemu_command.c (qemuBuildCommandLine): Use it. * tests/qemucapabilitiestest.c (testQemuCaps): Conditionally set capability to test expected output. * tests/qemucapabilitiesdata/caps_1.2.2-1.caps: Update list. * tests/qemucapabilitiesdata/caps_1.6.0-1.caps: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 13 12月, 2013 2 次提交
-
-
由 Martin Kletzander 提交于
The support for <boot rebootTimeout="12345"/> was added before we were checking for qemu command line options in QMP, so we haven't properly adapted virQEMUCaps when using it and thus we report unsupported option with new enough qemu. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1042690Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Hu Tao 提交于
Map the new <panic> device in XML to the '-device pvpanic' command line of qemu. Clients can then couple the <panic> device and the <on_crash> directive to control behavior when the guest reports a panic to qemu. Signed-off-by: NHu Tao <hutao@cn.fujitsu.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 11 12月, 2013 1 次提交
-
-
由 Cédric Bosdonnat 提交于
-
- 10 12月, 2013 3 次提交
-
-
由 Cédric Bosdonnat 提交于
Leave virDomainEventRegister and its Deregister brother as these are legacy functions only for domain lifecycle events.
-
由 Cédric Bosdonnat 提交于
These unit tests are aiming at providing some help during the domain events refactoring.
-
由 Martin Kletzander 提交于
When changing memtune limits to unlimited with AFFECT_CONFIG, the values in virDomainDef are set to PARAM_UNLIMITED, which causes the whole <memtune> to be formatted. This can be changed in all drivers, but it also makes sense to use the default (0) as another value for "unlimited", since zero memory limit makes no sense. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 06 12月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1035118 When outputting the XML for the RNG device, the code didn't format the PCI address info. Additionally the schema wasn't expecting the info although it was being parsed and used internally. Fix those mistakes and add test for the PCI info section.
-
- 05 12月, 2013 5 次提交
-
-
由 Peter Krempa 提交于
Commit 5a66c667 fixed a NULL dereference if the disk driver element was empty. Add a test for this case.
-
由 Peter Krempa 提交于
There were plenty snapshot XMLs in the tests/domainsnapshotxml2xmlin directory that actually weren't used in XML testing. The upgraded domainsnapshotxml2xml test now allows us to use them.
-
由 Peter Krempa 提交于
The new tests that will be added later would collide with files of existing tests. Move and rename those files.
-
由 Peter Krempa 提交于
Until now the test was only testing redefinition of snapshot XMLs stored in tests/domainsnapshotxml2xmlout. This patch adds new infrastructure to allow testing of files that may differ and will allow to utilize files in tests/domainsnapshotxml2xmlin as new tests too.
-
由 Peter Krempa 提交于
The 'internal' variable holds only two states; convert it to a boolean and the 'fail' label should be called 'cleanup'. This patch also fixes a minor memory leak of driver capabilities in case the XML config object can't be allocated.
-
- 03 12月, 2013 2 次提交
-
-
由 Laine Stump 提交于
These *should* have been pushed in commit 96fddee3.
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=888635 (which was already closed as CANTFIX because the qemu "-boot strict" commandline option wasn't available at the time). Problem: you couldn't have a domain that used PXE to boot, but also had an un-bootable disk device *even if that disk wasn't listed in the boot order*, because if PXE timed out (e.g. due to the bridge forwarding delay), the BIOS would move on to the next target, which would be the unbootable disk device (again - even though it wasn't given a boot order), and get stuck at a "BOOT DISK FAILURE, PRESS ANY KEY" message until a user intervened. The solution available since sometime around QEMU 1.5, is to add "-boot strict=on" to *every* qemu command. When this is done, if any devices have a boot order specified, then QEMU will *only* attempt to boot from those devices that have an explicit boot order, ignoring the rest.
-
- 02 12月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Commit bae124e4 was accidentaly pushed without review feedback worked in. Fix it up.
-