- 10 4月, 2019 6 次提交
-
-
由 Andrea Bolognani 提交于
Commit 5b9819ee started using the virFileWrapper APIs in the test program, and correctly called them only in the section of code guarded by WITH_QEMU; however, a single call to the virFileWrapperClearPrefixes() function ended up in the hypervisor-agnostic section, causing a build failure on MinGW. Move the call to the QEMU-only section; while at it, also drop the virFileWrapperRemovePrefix() calls, which are entirely redundant since we'd drop all prefixes immediately afterwards anyway. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
If a management application wants to use firmware auto selection feature it can't currently know if the libvirtd it's talking to support is or not. Moreover, it doesn't know which values that are accepted for the @firmware attribute of <os/> when parsing will allow successful start of the domain later, i.e. if the mgmt application wants to use 'bios' whether there exists a FW descriptor in the system that describes bios. This commit then adds 'firmware' enum to <os/> element in <domainCapabilities/> XML like this: <enum name='firmware'> <value>bios</value> <value>efi</value> </enum> We can see both 'bios' and 'efi' listed which means that there are descriptors for both found in the system (matched with the machine type and architecture reported in the domain capabilities earlier and not shown here). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Michal Privoznik 提交于
The point of this API is to fetch all FW descriptors, parse them and return list of supported interfaces and SMM feature for given combination of machine type and guest architecture. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Peter Krempa 提交于
This reverts commit a5e16020. Getting rid of unistd.h from our headers will require more work than just fixing the broken mingw build. Revert it until I have a more complete proposal. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
util/virutil.h bogously included unistd.h. Drop it and replace it by including it directly where needed. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
'viralloc.h' does not provide any type or macro which would be necessary in headers. Prevent leakage of the inclusion. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 08 4月, 2019 1 次提交
-
-
由 Jiri Denemark 提交于
Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 4月, 2019 2 次提交
-
-
由 Eric Blake 提交于
In a constrained CI environment, where it is intentional that attempts to write outside the current directory will fail, virsh-snapshot was failing: @@ -1,2 +1,3 @@ error: invalid argument: parent s3 for snapshot s2 not found error: marker +error: Failed to create '/home/travis/.cache/libvirt/virsh': Permission denied FAIL virsh-snapshot (exit status: 1) But we've already solved the problem in virsh-uriprecedence: tell virsh to use XDG locations pointing to somewhere we can write rather than its default of falling back to $HOME with the test being at risk of breaking due to the user's environment and/or unacceptably altering the user's normal cache. Hoist that solution into test-lib.sh, so that all scripts can use it as needed. While at it, fix a latent typo where XDG_RUNTIME_HOME was set to a literal relative directory name "XDG_CACHE_HOME" (the typo did not affect virsh-uriprecedence, but could matter to other clients). Fixes: 280a2b41 Fixes: 398de147Reported-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Andrea Bolognani 提交于
There are a few differences, but the one we're interested in is that PCIe Root Ports are finally available: as a result of this, our riscv64-virt-headless guest will switch from virtio-mmio to virtio-pci. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 03 4月, 2019 30 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1693066 Up until memfd introduction (in 24b74d18) we did not need to know @pagesize because qemuGetDomainHupageMemPath() could deal with it being zero (value of zero means use the default hugetlbfs mount). But since for memfd we are not passing a path to hugetlbfs mount rather the page size value we need to know its value upfront. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
Somehow, these were not tested. Use symlinks to point expected output back to the input. This way we can also fix some discrepancies in the input XMLs. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
The current location looks very arbitrary. Move it to the end of the mymain() function so it is less confusing. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
There are three test XMLs that have useless spaces at the beginning of each line. I intend to add these to qemuxml2xmltest and make xmlout a symlink to the original XML. In order to do that the XMLs must look better than they do now. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Also switch the expected output of DO_TEST_PARSE_FILE to be in a file, now that we demonstrated the input files match the expected string representation. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Introduce a new macro DO_TEST_PARSE_FILE which takes the input JSON from a file instead of a C string. This lets us get rid of quote escaping and makes the JSON easier to edit. The output JSON is still taken from a string and will be moved separately. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Now that cleanup is handled automatically, we can use 'return' more often. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
The only remaining use of VIR_FREE is for reusing variables. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Remove all explicit usage of virJSONValueFree. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Handle failure to parse the JSON in an else branch for readability. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Instead of using JSON in C strings, put it in separate files for easier manipulation. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Daniel P. Berrangé 提交于
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Quite a few of the tests have a need to mock the stat() / lstat() functions and they are taking somewhat different & inconsistent approaches none of which are actually fully correct. This is shown by fact that 'make check' fails on 32-bit hosts. Investigation revealed that the code was calling into the native C library impl, not getting intercepted by our mocks. The POSIX stat() function might resolve to any number of different symbols in the C library. The may be an additional stat64() function exposed by the headers too. On 64-bit hosts the stat & stat64 functions are identical, always refering to the 64-bit ABI. On 32-bit hosts they refer to the 32-bit & 64-bit ABIs respectively. Libvirt uses _FILE_OFFSET_BITS=64 on 32-bit hosts, which causes the C library to transparently rewrite stat() calls to be stat64() calls. Libvirt will never see the 32-bit ABI from the traditional stat() call. We cannot assume this rewriting is done using a macro. It might be, but on GLibC it is done with a magic __asm__ statement to apply the rewrite at link time instead of at preprocessing. In GLibC there may be two additional functions exposed by the headers, __xstat() and __xstat64(). When these exist, stat() and stat64() are transparently rewritten to call __xstat() and __xstat64() respectively. The former symbols will not actally exist in the library at all, only the header. The leading "__" indicates the symbols are a private impl detail of the C library that applications should not care about. Unfortunately, because we are trying to mock replace the C library, we need to know about this internal impl detail. With all this in mind the list of functions we have to mock will depend on several factors - If _FILE_OFFSET_BITS is set, then we are on a 32-bit host, and we only need to mock stat64 and __xstat64. The other stat / __xstat functions exist, but we'll never call them so they can be ignored for mocking. - If _FILE_OFFSET_BITS is not set, then we are on a 64-bit host and we should mock stat, stat64, __xstat & __xstat64. Either may be called by app code. - If __xstat & __xstat64 exist, then stat & stat64 will not exist as symbols in the library, so the latter should not be mocked. The same all applies to lstat() These rules are complex enough that we don't want to duplicate them across every mock file, so this centralizes all the logic in a helper file virmockstathelper.c that should be #included when needed. The code merely need to provide a filename rewriting callback called virMockStatRedirect(). Optionally VIR_MOCK_STAT_HOOK can be defined as a macro if further processing is needed inline. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Use size_t for all sizes. The '*' modifier unfortunately does require an int so a temporary variable is necessary in the tests. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
This was meant to stop abusing the members directly, but we don't do this for other internal structs. Additionally this did not stop the test from touching the members. Remove the header obscurization. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
'blockdev-snapshot-sync' is present in QEMU since v0.14.0-rc0 and 'transaction' since v1.1.0 (52e7c241ac766406f05fa) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
qemu added the 'drive-mirror' command in v1.3.0 (d9b902db3fb71fdc) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
qemu added the 'block-commit' command in v1.3.0 (ed61fc10e8c8d2) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
This was detected by the presence of 'block-stream' which is present in qemu since v1.1 (db58f9c0605fa151b8c4) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Similarly to the disk source we need to keep the disk index (which is in the qemu driver used for identification of the source for block jobs) for the <mirror> element so that when it's replaced as a disk source after pivoting all the allocated data is present. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
When the block copy operation is started with a reused external file in incremental mode libvirt will need to open and insert the backing chain for that file into qemu (in -blockdev mode). This means that we'll need to track the backing chain and metadata such as node names for the full chain of <mirror>. This patch invokes the full backing chain formatter and parser for <mirror> so that the chain can be kept with <mirror>. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
virDomainDiskSourceParse was now just a thin wrapper without any extra value. Replace all usage of it by the function it calls and remove the function. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
When adding <migrationSource> I've used a slightly unusual approach. To allow using the disk source XML parser and formatter convert <migrationSource> to look like <disk>. This means that <source> will be added as a subelement of <migrationSource> rather than being formatted inline. Conversion from the old format in the parser is very simple as it involves only moving the XPath context current node slightly if the new format is found. The status XML to XML test shows that the upgrade is done correctly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Upcomming change will modify some aspects. To allow testing upgrade path add a separate output file so that we can see the conversion from old to new config. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Upcomming change will modify some aspects. To allow testing upgrade path add another disk. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Block job related data will be stored in a has table and formatted into the status XML. Use the mock to guarantee stable tests. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Remove the wrapper and fix callers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
We parse the seclabels and use them internally so omitting them when formatting would be misleading. Additionally our schema actually allows them. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Andrea Bolognani 提交于
The layout of my home directory is somewhat peculiar: I store all git repositories in ~/src/upstream, but since I spend almost all of my time hacking on libvirt, I also have a convenience symlink ~/src/libvirt -> ~/src/upstream/libvirt that I use to access that specific git repository. The above setup has served me well for years; however, ever since commit ca147162 dropped our own custom definitions for abs_{,top_}{src,build}dir and started using the ones provided by autotools, virstoragetest has started reliably failing with errors such as 2) Storage backing chain 2 ... Offset 0 Expect [chain member: 0 path:/home/abologna/src/upstream/libvirt/tests/virstoragedata/raw backingStoreRaw: <null> capacity: 0 encryption: 0 relPath:<null> type:1 format:1 protocol:none hostname:<null> ] Actual [chain member: 0 path:/home/abologna/src/libvirt/tests/virstoragedata/raw backingStoreRaw: <null> capacity: 0 encryption: 0 relPath:<null> type:1 format:1 protocol:none hostname:<null> ] ... FAILED Using abolute paths instead of canonical ones in the tests makes the problem go away. Note that all tests that are specifically designed to test path canonicalization via TEST_PATH_CANONICALIZE() were passing even before this patch and are not touched by it. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 3月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Introduced in fdf6c89e, this dependency looks weird. It was needed because of the way that while() loop was written - it fetches next argument in every iteration. Therefore, our only option was for ARG_END to have the same value as QEMU_CAPS_LAST. This also meant that QEMU_CAPS_* could have been only at the end of the __VA_ARGS__. This commit reworks the while() loop and removes the dependency. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-