- 23 8月, 2019 9 次提交
-
-
由 Roman Bolshakov 提交于
In preparation libtool "-module" flag removal, add lib prefix to all mock shared objects. While at it, introduce VIR_TEST_MOCK macros that makes path out of mock name to be used with VIR_TEST_PRELOAD or VIR_TEST_MAIN_PRELOAD. That, hopefully, improves readability, reduces line length and allows to tailor VIR_TEST_MOCK for specific platform if it has shared library suffix different from ".so". Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
由 Roman Bolshakov 提交于
LD_PRELOAD has no effect on macOS. Instead, dyld(1) provides a way for symbol hooking via DYLD_INSERT_LIBRARIES. The variable should contain colon-separated paths to the dylibs to be inserted. Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
由 Roman Bolshakov 提交于
getnameinfo on macOS formats certain IPv6 addresses as IPv4-translated addresses. The following pattern has been observed: ::ffff is formated as ::0.0.255.255 ::fffe is formated as ::0.0.255.254 ::ffff:0 is formated as ::255.255.0.0 ::fffe:0 is formated as ::255.254.0.0 ::ffff:0:0 is formated as ::ffff:0.0.0.0 ::fffe:0:0 is formated as ::fffe:0:0 ::ffff:0:0:0 is formated as ::ffff:0:0:0 The getnameinfo behavior causes a failure for: DO_TEST_PARSE_AND_FORMAT("::ffff", AF_UNSPEC, true); Use non-ambigious IPv6 for parse/format testing. Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
由 Roman Bolshakov 提交于
getaddrinfo on macOS doesn't interpret octal IPv4 addresses. Only inet_aton can be used for that. Therefore, from macOS standpoint "0177.0.0.01" is not the same as "127.0.0.1". The issue was also discovered by python and dotnet core: https://bugs.python.org/issue27612 https://github.com/dotnet/corefx/issues/8362Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
由 Michal Privoznik 提交于
This enum was introduced to model how RHEL-7 kernel behaves - for some reason going with the old way (via new_id + bind) fails but using driver_override succeeds. Well, we don't need to care about that anymore since we don't create new_id file. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Now that PCI attach/detach happens solely via driver_override these two files are no longer needed. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Now that nothing supports "pci-stub" driver (aka KVM style of PCI device assignment) there is no need for virpcimock to create it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The KVM assignment was removed in qemu driver in previous commit. Remove it from domaincapstest too which is hard coding it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
KVM style of PCI devices assignment was dropped in kernel in favor of vfio pci (see kernel commit v4.12-rc1~68^2~65). Since vfio is around for quite some time now and is far superior discourage people in using KVM style. Ideally, I'd make QEMU_CAPS_VFIO_PCI implicitly assumed but turns out qemu-3.0.0 doesn't support vfio-pci device for RISC-V. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 22 8月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
It may happen that we leave some XATTRs behind. For instance, on a sudden power loss, the host just shuts down without calling restore on domain paths. This creates a problem, because when the host starts up again, the XATTRs are there but they don't reflect the true state and this may result in libvirt denying start of a domain. To solve this, save a unique timestamp (host boot time) among with our XATTRs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741140Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Ján Tomko 提交于
In preparation to moving the validation to the parser, we need to supply the correct caps. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 20 8月, 2019 3 次提交
-
-
由 Wang Huaqiang 提交于
resctrl object stored in def->resctrls is shared by cachetune and memorytune. The domain xml configuration is parsed firstly for cachetune then memorytune, and the resctrl object will not be created in parsing settings for memorytune once it found sharing exists. But resctrl is improperly freed when sharing happens. Signed-off-by: NWang Huaqiang <huaqiang.wang@intel.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel P. Berrangé 提交于
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Mocking of the __open_2 function was added in commit 459f071c Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Aug 15 16:37:17 2019 +0200 virpcimock: Mock __open_2() This function only exists in glibc, however, and the mocking code runs on systems not using glibc, such as FreeBSD. Even Linux hosts might be using a different libc impl, though we don't actively try to support that. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 19 8月, 2019 4 次提交
-
-
由 Daniel P. Berrangé 提交于
The nwfilter XML configs are not merely examples, they are data that is actively shipped and used in production by users. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Vitaly Kuznetsov 提交于
QEMU-4.1 supports 'Direct Mode' for Hyper-V synthetic timers (hv-stimer-direct CPU flag): Windows guests can request that timer expiration notifications are delivered as normal interrupts (and not VMBus messages). This is used by Hyper-V on KVM. Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Vitaly Kuznetsov 提交于
In particular, use DO_TEST_CAPS_LATEST which tests the canonical 'hv-feature' syntax instead of 'hv_feature' aliases and DO_TEST_CAPS_VER with 4.0.0 to also test the old syntax. Suggested-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
virpcimock.c:685:26: error: unused variable 'devid' [-Werror,-Wunused-variable] VIR_AUTOFREE(char *) devid = NULL; ^ Fixes: 76b42294Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 17 8月, 2019 16 次提交
-
-
由 Michal Privoznik 提交于
The pci-stub is so old school that no one uses it. All modern systems have adapted VFIO. Switch our virpcitest too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci-stub is so old school that no one uses it. All modern systems have adapted VFIO. Switch our virhostdevtest too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci-assign device is so old school that no one uses it. All modern systems have adapted VFIO. Switch our xml2argv test too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
So far, we don't need to create anything under /sys/kernel/iommu_groups/N/devices directory (which is symlinked from /sys/bus/pci/devices/DDDD:BB:DD.F/iommu_group directory) because virhostdevtest still tests the old KVM assignment and thus has no notion of IOMMU groups. This will change in near future though. And in order to discover devices belonging to the same IOMMU group we need to do what kernel does - create symlinks to devices. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
So far, we are creating devices directly under /sys/bus/pci/devices/*. There is not much problem with it, but if we really want to model kernel behaviour we need to create them under /sys/devices/pciDDDD:BB and then only symlink them from the old location. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
In upcoming patches we will need only some portions of the PCI address. To construct that easily, it's better if the PCI address of a device is stored as four integers rather than one string. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Have just one function to generate path to a PCI driver so that when we change it in near future there's only few of the places we need to fix. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Have just one function to generate path to a PCI device so that when we change it in near future there's only few of the places we need to fix. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
In near future, we will be creating devices under different location and just symlink them under devices/. Just like real kernel does. But for that we need the directories to exist. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
We will need to create more directories and instead of introducing bunch of new variables to hold their actual paths, we can have one and reuse it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The @fakesysfspcidir is derived from @fakerootdir. We don't need two global variables that contain nearly the same content, especially when we construct the actual path anyways. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
It saves us couple of lines. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
When creating a PCI device, the pciDevice structure contains @id member which holds device address (DDDD.BB:DD.F) and is type of 'char *'. But the structure is initialized from a const char and in fact we never modify or free the @id. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Newer kernels (v3.16-rc1~29^2~6^4) have 'driver_override' file which simplifies way of binding a PCI device to desired driver. Libvirt has support for this for some time too (v2.3.0-rc1~236), but not our virpcimock. So far we did not care because our code is designed to deal with this situation. Except for one. hypothetical case: binding a device to the vfio-pci driver can be successful only via driver_override. Any attempt to bind a PCI device to vfio-pci driver using old method (new_id + unbind + bind) will fail because of b803b29c. While on vanilla kernel I'm able to use the old method successfully, it's failing on RHEL kernels (not sure why). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
This reverts commit b70c093f. In next commit the virpcimock is going to be extended and thus binding a PCI device to vfio-pci driver will finally succeed. Remove this test as it will no longer make sense. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci_driver_bind() and pci_driver_unbind() functions are "internal implementation", meaning other parts of the code should be able to call them and get the job done. Checking for actions (PCI_ACTION_BIND and PCI_ACTION_UNBIND) should be done in handlers (pci_driver_handle_bind() and pci_driver_handle_unbind()). Surprisingly, the other two actions (PCI_ACTION_NEW_ID and PCI_ACTION_REMOVE_ID) are checked already at this level. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 16 8月, 2019 5 次提交
-
-
由 Peter Krempa 提交于
Implement job handling for the block copy job (drive/blockdev-mirror) when using -blockdev. In contrast to the previously implemented blockjobs the block copy job introduces new images to the running qemu instance, thus requires a bit more handling. When copying to new images the code now makes use of blockdev-create to format the images explicitly rather than depending on automagic qemu behaviour. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
QEMU finally exposes an interface which allows us to instruct it to format or create arbitrary images. This is required for blockdev integration of block copy and snapshots as we need to pre-format images prior to use with blockdev-add. This path introduces job handling and also helpers for formatting and attaching a whole image described by a virStorageSource. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
If the nbd export name contains a colon, our parser would not parse it properly as we split the string by colons. Modify the code to look up the exportname and copy any trailing characters as the export name is supposed to be at the end of the string. https://bugzilla.redhat.com/show_bug.cgi?id=1733044Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Peter Krempa 提交于
In some cases e.g. with clang on fedora 30 __open2 isn't even declared which results in the following build error: /home/pipo/libvirt/tests/virpcimock.c:939:1: error: no previous prototype for function '__open_2' [-Werror,-Wmissing-prototypes] __open_2(const char *path, int flags) Add a separate declaration to appease the compiler. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
Hold on to your hat, this is going to be a wild ride. As nearly nothing in glibc, nor open() is a real function. Just look into bits/fcntl2.h and you'll see that open() is actually a thin wrapper that calls either __open_alias() or __open_2(). Now, before 801ebb5e the open() done in virPCIDeviceConfigOpenInternal() had a constant oflags (we were opening the pci config with O_RDWR). And since we were not passing any mode nor O_CREAT the wrapper decided to call __open_alias() which was open() provided by our mock. So far so good. But after the referenced commit, the oflags is no longer compile time constant and therefore the wrapper calls __open_2() which we don't mock and thus the real __open_2() from glibc was called and thus we did try to open real path from host's /sys. This of course fails with variety of errors. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 14 8月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Similar to how we cache the availability of machined. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-