- 24 3月, 2020 24 次提交
-
-
由 Michal Privoznik 提交于
As a part of c799d150 I've introduced a test case that tests whether passing error object between processes works. The test spawns a child which reports a system error, parent process then reads the error and compares with expected output. Problem with this approach is that error message contains stringified errno which is not portable. FreeBSD has generally different messages than Linux. Therefore, use g_strerror() to do the errno to string translation for us. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Our code allows snapshots of NVMe based disks which means we create overlay file with a 'json:{}' pseudo-uri refering to the NVME device. Our parser code doesn't handle them though. Add the parser and test it via the XML->json->XML round-trip and reference data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Format cookies into the backing store string without encryption as they will not be visible on the command line when formatting a 'target' only string. In cases when cookies or other options are used we must use the JSON format rather than pure URI. Add tests to validate the scenario. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Introduce qemuBlockStorageSourceGetCookieString which does the concatenation so that we can reuse it later. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
QEMU requires an extra wrapper object where only the "file" member is populated. This is basically a placeholder for establishing the format layer. We did the same in qemuDiskSourceGetProps for the old-school JSON usage with -drive but forgot to adopt this for -blockdev. https://bugzilla.redhat.com/show_bug.cgi?id=1804617Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
qemublocktest showed that we don't add the "fat:" prefix for directory storage when formatting the backing store string. While it's unlikely to be used it's simple enough to actually implement the support rather than trying to forbid it. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
We can return the appropriate string directly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
With -blockdev libvirt provides the string which is recorded as 'backing store' property of an image to qemu. Add testing for qemuBlockGetBackingStoreString which generates these strings as there's logic which determines which format to use. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
We had two non-syncrhonized arrays holding the individual data. This was a lazy way to do it when I was adding new tests recently. Since it's hard to extend with new data to test refactor the storage of test data to use a new struct where all per-image data are kept and can be extended easily. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Add support for pretty-printing of the JSON variant of the output for consumption in tests. All current callers pass 'false'. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
The function was misplaced. Group it together with other helper functions for testing disk XML to qemu JSON props conversion. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Use automatic variable clearing and remove the cleanup sections of testQemuDiskXMLToProps, testQemuDiskXMLToPropsValidateSchema and testQemuDiskXMLToPropsValidateFile. testQemuDiskXMLToPropsValidateFileSrcOnly already uses new helpers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
VIR_TRISTATE_BOOL_ABSENT which maps to the 'default' string would not be parsed back, so we shouldn't format it either. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Based on the configuration from the only qemuxml2argv test. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
While 'namespace' is not a reserved word in C, it is in C++. Our compilers are happy with it but syntax-hilighting in some editors hilights is as a keyword. Rename it to prevent confusion. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Mauro S. M. Rodrigues 提交于
virHostCPUGetStatsLinux walks through every cpu in /proc/stat until it finds cpu%cpuNum that matches with the requested cpu. If none is found it logs the error but it should return -1, instead of 0. Otherwise virsh nodecpustats --cpu <invalid cpu number> and API bindings don't fail properly, printing a blank line instead of an error message. This patch also includes an additional test for virhostcputest to avoid this regression to happen again in the future. Fixes: 93af79fbReported-by: NSatheesh Rajendran <satheera@in.ibm.com> Signed-off-by: NMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Tested-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
由 Ján Tomko 提交于
Use just 'fs' instead of 'virtiofsd'. https://bugzilla.redhat.com/show_bug.cgi?id=1816577Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
There is no need to repeat the shortName, since it's already present in the directory path. Also use just 'fs' instead of 'virtiofsd'. https://bugzilla.redhat.com/show_bug.cgi?id=1816577Signed-off-by: NJán Tomko <jtomko@redhat.com> Suggested-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Using the 'uuid' element for ppc64 NVDIMM memory added in the previous patch, use it in qemuBuildMemoryDeviceStr() to pass it over to QEMU. Another ppc64 restriction is the necessity of a mem->labelsize, given than ppc64 only support label-area backed NVDIMMs. Finally, we don't want ppc64 NVDIMMs to align up due to the high risk of going beyond the end of file with a 256MiB increment that the user didn't predict. Align it down instead. If target size is less than the minimum of 256MiB + labelsize, error out since QEMU will error out if we attempt to round it up to the minimum. Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
ppc64 NVDIMM support was implemented in QEMU by commit [1]. The support is similar to what x86 already does, aside from an extra 'uuid' element. This patch introduces a new optional 'uuid' element for the NVDIMM memory model. This element behaves like the 'uuid' element of the domain definition - if absent, we'll create a new one, otherwise use the one provided by the XML. The 'uuid' element is exclusive to pseries guests and are unavailable for other architectures. Next patch will use this new element to add NVDIMM support for ppc64. [1] https://github.com/qemu/qemu/commit/ee3a71e36654317b14ede0290e87628f8b79f850Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Update ppc64 capabilities to pick up the new NVDIMM capability support for ppc64. Since the ppc64 capabilities weren't updated for some time, the bulk of the changes here are related to the blockdev support (see commit c6a9e54c for info) that we are picking up just now. Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 3月, 2020 7 次提交
-
-
由 Michal Privoznik 提交于
In previous patches virKeyFile was replaced with its GLib counterpart which created an incompatible change: comments can now begin only with a number sign (#). While this won't probably affect anyone, mention it in the release notes. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Rafael Fonseca 提交于
The functionality is now provided by glib's GKeyFile. Signed-off-by: NRafael Fonseca <r4f4rfs@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Rafael Fonseca 提交于
Replace libvirt's virKeyFile by glib's GKeyFile. Signed-off-by: NRafael Fonseca <r4f4rfs@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
This function changes the amount of time that libvirt waits for a response from the guest agent for all guest agent commands. Since this is a configuration change, it should not be allowed on read-only connections. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
The agent 'guest-sync' command historically had a 5s response timeout which was different from other agent commands, which waited forever. When we added the ability to customize the response timeout for guest agent commands, we intended to continue to use 5s for 'guest-sync' when the user specified a response timeout greater than 5s, and use the user-specified timeout if it was below 5s. Unfortunately, when attempting to determine whether the user-specified timeout was less than 5s, we were comparing against an enum value of VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT (which is -1) rather than against the actual time value that it represented (5). This change makes it so that 'guest-sync' now uses the user-specified tiemout if it is less than 5s. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Seeteena Thoufeek 提交于
Signed-off-by: NSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Rafael Fonseca 提交于
Use existing function built for this exact purpose. Signed-off-by: NRafael Fonseca <r4f4rfs@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 20 3月, 2020 9 次提交
-
-
由 Michal Privoznik 提交于
When a QEMU process dies in the middle of a hotplug, then we fail to restore the seclabels on the device. The problem is that if the thread doing hotplug locks the domain object first and thus blocks the thread that wants to do qemuProcessStop(), the seclabel cleanup code will see vm->pid still set and mount namespace used and therefore try to enter the namespace represented by the PID. But the PID is gone really and thus entering will fail and no restore is done. What we can do is to try enter the namespace (if requested to do so) but if entering fails, fall back to no NS mode. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1814481Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Michal Privoznik 提交于
When running a function in a forked child, so far the only thing we could report is exit status of the child and the error message. However, it may be beneficial to the caller to know the actual error that happened in the child. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Michal Privoznik 提交于
The @src is not always a file. It may also be a directory (for instance qemuDomainCreateDeviceRecursive() assumes that) - even though it doesn't happen usually. Anyway, mount() can mount only a dir onto a dir and a file onto a file. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Michal Privoznik 提交于
The @devPath variable is not modifiable. It merely just points to string containing path where private devtmpfs is being constructed. Make it const so it doesn't look weird that it's not freed. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Michal Privoznik 提交于
If building namespace fails somewhere in the middle (that is some files exists under devMountsSavePath[i]), then plain rmdir() is not enough to remove dir. Umount the temp location and use virFileDeleteTree() to remove the directory. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Michal Privoznik 提交于
The virFileMakePathWithMode() which is our recursive version of mkdir() fails, it simply just returns a negative value with errno set. No error is reported (as compared to virFileTouch() for instance). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com>
-
由 Peter Krempa 提交于
Validate that we are able to parse back the dotted syntax arrays we were generating in the pre-blockdev era. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
For the few instances where we'd generate an array in dotted syntax we should be able to parse it back. Add another step in deflattening of the dotted syntax which reconstructs the arrays so that the backing store parser can parse it. https://bugzilla.redhat.com/show_bug.cgi?id=1466177Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-