summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* util: Introduce virFileFindInPathFull()Andrea Bolognani2023-05-103-0/+37
| | | | | Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* util: Small refactorAndrea Bolognani2023-05-101-6/+8
| | | | | | | Prepare for further changes. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* ci: integration: Flip QEMU upstream integration tests to Fedora 38Erik Skultety2023-05-101-12/+12
| | | | | Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* ci: Flip mingw jobs from Fedora 37 to Fedora 38Erik Skultety2023-05-107-23/+23
| | | | | Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* ci: Drop Fedora 36 targetErik Skultety2023-05-106-285/+0
| | | | | Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* ci: Add Fedora 38 targetErik Skultety2023-05-106-0/+285
| | | | | Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* Translated using Weblate (Hungarian)Dankaházi (ifj.) István2023-05-101-8/+6
| | | | | | | | | | Currently translated at 2.3% (243 of 10399 strings) Translation: libvirt/libvirt Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/hu/ Co-authored-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com> Signed-off-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com>
* virfirewallmock: Replace virFindFileInPath() with virFirewallDIsRegistered()Michal Privoznik2023-05-101-12/+4
| | | | | | | | | | | | | | | | | Neither of tests that use virfirewallmock.c (networkxml2firewalltest, nwfilterebiptablestest, nwfilterxml2firewalltest, virfirewalltest) really call virFindFileInPath(). But at least networkxml2firewalltest calls virFirewallDIsRegistered(), under the hood. Now, the actual implementation connects to dbus and something, which is definitely not what we want in our test suite. Therefore, drop virFindFileInPath() implementation and provide implementation for virFirewallDIsRegistered() which just returns -2 to signal that firewalld is not registered. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
* util: include virfirewall.h in virfirewalld.hMichal Privoznik2023-05-101-0/+2
| | | | | | | | | | The virfirewalld.h file provides a declaration for virFirewallDApplyRule() which accepts an argument of type virFirewallLayer. But the typedef lives in virfirewall.h and thus including just virfirewalld.h is not sufficient. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
* conf: qemu: Add support for multi-channel mode for 'usb' sound cardsPeter Krempa2023-05-099-4/+44
| | | | | | | | | | Allow users controlling the multi-channel mode by adding a 'multichannel' property parsed for USB audio devices and wire up the support in the qemu driver. Closes: https://gitlab.com/libvirt/libvirt/-/issues/472 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* conf: Register autoptr cleanup for 'virDomainSoundDef' and refactor ↵Peter Krempa2023-05-092-12/+8
| | | | | | | | | virDomainSoundDefParseXML Use our modern cleanup path pattern. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemuxml2(argv|xml)test: Modernize 'sound-device' casePeter Krempa2023-05-096-34/+66
| | | | | | | | | | | | | | Drop the unnecessary disk definition and use x86_64 emulator. For 'qemuxml2argvtest' replace the fake-caps invocation by a 4.2.0 version-locked invocation and add a '_CAPS_LATEST' invocation. For 'qemuxml2xmltest' convert to use '_CAPS_LATEST' only. There are no sound-device relevant changes in the output files. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemuxml2(argv|xml)test: Remove 'sound' casePeter Krempa2023-05-095-116/+0
| | | | | | | The test case is a subset of what the 'sound-device' case tests. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* docs: formatdomain: Use code blocks to emphasize various sound device optionsPeter Krempa2023-05-091-25/+25
| | | | | | | | Emphasize the various sound card models and other config options by using ``...``. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemu: Report domain name in unexpectedly closed monitor messageMichal Privoznik2023-05-091-3/+6
| | | | | | | | | | | | | | When QEMU closes the monitor suddenly, the following error message is reported: internal error: qemu unexpectedly closed the monitor: ... And this works. But other error messages produced in the same function include domain name too. Do that for the unexpectedly closed monitor message too. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
* logging: Provide empty VIRTLOGD_ARGS in the unit fileMichal Privoznik2023-05-091-0/+1
| | | | | | | | | | | | | | | | | | | For all our daemons, we provide VIRXXXD_ARGS env var in the unit file. The variable can then be overridden in corresponding file: EnvironmentFile=-@initconfdir@/virtxxxd The daemon is then executed as: ExecStart=@sbindir@/virtxxxd $VIRTXXXD_ARGS But virtlogd is exception, for no good reason. And while there are probably no arguments we want to pass to virtlogd by default, just mimic what we do for say virtlockd, where we also don't pass any default argument. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* .gitlab-ci.yml: Fix Leap 15.4 codestyle jobErik Skultety2023-05-091-3/+3
| | | | | | | | | Commit a3cc0e9ceb3e forgot to tweak the codestyle job so that we refer to Leap 15.4 as Leap 15 (with the recent change in lcitool). However, it was easy to miss as that job is not managed by the manifest. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* qemu: hotplug: Reorder setup of disk backend metadataPeter Krempa2023-05-051-3/+3
| | | | | | | | | | | | | | The regular VM startup code first calls the setup of the disk backing chain as defined in the XML and then calls the function to load the rest of the backing chain from the image metadata. The hotplug code did it the other way around, thus causing a failure when attempting to attach a QCOW2 image via FD passing. Reorder the hotplug code to have the same order. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2193315 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* meson: Improve initconfdir defaultsAndrea Bolognani2023-05-051-1/+10
| | | | | | | | Keep /etc/sysconfig as the fallback, but pick more suitable values for various Linux distros. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* meson: Move definition of os_releaseAndrea Bolognani2023-05-051-1/+5
| | | | | | | | We're about to introduce another user of the value in a different scope. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* rpm: Set initconfdir explicitlyAndrea Bolognani2023-05-051-0/+1
| | | | | | | | The default would already work fine for Fedora and RHEL, but it's better to be explicit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* meson: Use initconfdirAndrea Bolognani2023-05-0523-26/+31
| | | | | Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* meson: Introduce initconfdir optionAndrea Bolognani2023-05-052-0/+6
| | | | | | | | | | | | | | | | | Right now we expect the configuration files for init scripts to live in /etc/sysconfig, but that location is only used by RHEL- and SUSE-derived distros. This means that packagers for other distros have to patch things as part of the build process, while people building from source will get wonky integration. This new option will provide a convenient way to override the default location at build time that is usable by distro packagers and people building from source alike. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* util: Improve comment for workaroundAndrea Bolognani2023-05-041-2/+1
| | | | | | | | | Now that a version of GLib that contains the fix has been released, it's more useful to record that information. Adding a TODO annotation makes the whole thing easily greppable. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemu: Fix error messageAndrea Bolognani2023-05-041-1/+1
| | | | | | | The spelling is slightly different from another otherwise identical error message in the same file. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* cpu_riscv64.c: add update() implementationDaniel Henrique Barboza2023-05-042-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | At this moment it is not possible to launch a 'riscv64' domain if a CPU definition is presented in the domain. For example, adding this CPU definition: <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>rv64</model> </cpu> Will trigger the following error: $ sudo ./run tools/virsh start riscv-virt1 error: Failed to start domain 'riscv-virt1' error: this function is not supported by the connection driver: cannot update guest CPU for riscv64 architecture The error comes from virCPUUpdate(), via qemuProcessUpdateGuestCPU(), and it's caused by the absence of the 'update' API in the existing RISC-V driver. Add an 'update' API impl to the RISC-V driver to allow for CPU definitions to be declared in RISC-V domains. This API was copied from the ARM driver (virCPUarmUpdate()) since it's a good enough implementation to get us going. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* meson: Fix qemu_{user,group} defaults for ArchAndrea Bolognani2023-05-031-7/+5
| | | | | | | | | The current values might have been accurate at the time when the logic was introduced, but these days Arch is using the same ones as Debian. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat>
* tools: virsh-domain: display progress with enhanced granularityShaleen Bathla2023-05-021-6/+7
| | | | | | | | | Switch from int to double for displaying job progress upto 2 decimal places. Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* tools: virsh-domain: refactor variable initializationShaleen Bathla2023-05-021-5/+3
| | | | | | Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* qemu: Use configured iothread poll parameters on startupPeter Krempa2023-05-023-17/+37
| | | | | | | | Implement the support for the persisted poll parameters and remove restrictions on saving config when modifying them during runtime. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* conf: Store the iothread 'poll' settings in the XMLPeter Krempa2023-05-025-5/+85
| | | | | | | | | Currently we allow configuring the 'poll-max-ns', 'poll-grow', and 'poll-shrink' parameters of qemu iothreads only during runtime and they are not persisted. Add XML machinery to persist them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* virsh: cmdIOThreadSet: Use bigger types for --poll-grow and --poll-shrinkPeter Krempa2023-05-021-8/+7
| | | | | | | | | | The qemu driver now accepts also _ULLONG as type for bigger numbers. Use the 'virTypedParamListAddUnsigned' helper to use the bigger typed parameter type if necessary to allow full range of the values while preserving compatibility. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemu: Store all iothread's 'poll*' attributes as unsigned long longPeter Krempa2023-05-025-37/+54
| | | | | | | | | | | | | | | | | | | | Convert the internal types to unsigned long long. Luckily we can also covert the external types too: - 'qemuDomainSetIOThreadParams' can accept both _UINT and _ULLONG by converting to 'virTypedParamsGetUnsigned' - querying is handled via the bulk stats API which is flexible: - we use virTypedParamListAddUnsigned to use the bigger type only if necessary - most users don't even notice because the bindings abstract the data types Apart from the code modifications we also improve the documentation which was missing for the setters. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemu: Remove iothread 'poll-' value validationPeter Krempa2023-05-022-28/+0
| | | | | | | | | | | | QEMU accepts even values bigger than INT_MAX. The reasoning for these checks was that the QAPI definition declares them as 'int', but in QAPI terms that's any number as it's JSON. Remove the validation as well as the comment misinterpreting the QAPI definiton. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* virsh: cmdIOThreadSet: Refactor to use virTypedParamListPeter Krempa2023-05-021-47/+31
| | | | | | | | Refactor to use the new data type so that we can use the APIs of it in upcoming patches. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* virTypedParamsValidate: Allow typed params to be both _UINT and _ULLONGPeter Krempa2023-05-022-5/+23
| | | | | | | | | | | | | | | For certain typed parameters we want to extend the supproted range by switching to VIR_TYPED_PARAM_ULLONG. To preserve compatibility we've added APIs such as 'virTypedParamsGetUnsigned' and 'virTypedParamListAddUnsigned' which automatically select the bigger type if necessary. This patch adds a new internal macro VIR_TYPED_PARAM_UNSIGNED which is used with virTypedParamsValidate to allow both types and adjusts the code to handle it properly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* virTypedParamsValidate: Refactor variable declaration and cleanupPeter Krempa2023-05-021-15/+16
| | | | | | | | | Use automatic memory cleanup for the 'keys' and 'sorted' helpers and remove the 'cleanup' label. Since this patch is modifying variable declarations ensure that all declarations conform with our coding style. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Introduce virTypedParamsGetUnsignedPeter Krempa2023-05-023-0/+57
| | | | | | | | | | | | Add an internal helper for fetching a typed parameter which can be either of the '_UINT' or '_ULONG' type and store it in a unsigned long long variable. Since this is an internal helper it offers less protections against invalid use compared to those we expose as public API. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: typedparam: Introduce virTypedParamListAddUnsignedPeter Krempa2023-05-023-0/+43
| | | | | | | | | | | The new helper adds a unsigned value, stored as _UINT if it fits into the type and stored as _ULLONG otherwise. This is useful for the statistics code which is quite tolerant to changes in type in cases when we'll need more range for the value. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Remove return values from virTypedParamListAdd* APIsPeter Krempa2023-05-026-394/+173
| | | | | | | | The function now return always 0. Refactor the code and remove return values. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Store errors inside virTypedParamListPeter Krempa2023-05-021-28/+34
| | | | | | | | | | The only non-abort()-ing error which can happen is if the field name is too long. Store the overly long name in the virTypedParamList container so that in upcoming patches the helpers adding to the list can be refactored to not have a return value. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Refactor return value of virTypedParamListStealParamsPeter Krempa2023-05-027-16/+35
| | | | | | | | | | | | Return the number of parameters via pointer passed as argument to free up possibility to report errors. Strangely all callers actually use 'int' as type for storing the count of elements, thus this function will use the same. The function is also renamed to virTypedParamListSteal. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Privatize definition of struct _virTypedParamListPeter Krempa2023-05-022-5/+7
| | | | | | | Ensure that all callers access it via the APIs. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* Use 'virTypedParamListFetch' for extracting identity parameters listPeter Krempa2023-05-022-2/+13
| | | | | Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* util: virtypedparam: Introduce 'virTypedParamListFetch'Peter Krempa2023-05-023-0/+33
| | | | | | | | | | | Introduce a helper that fetches the typed parameters from the list while still preserving ownership of the pointer by the list. In the future this will be also able to report errors stored in the list. Signed-off-by: Peter Krempa <pkrempa@redhat.com Reviewed-by: Ján Tomko <jtomko@redhat.com>
* qemuDomainGetStatsBlock: Don't directly access virTypedParamListPeter Krempa2023-05-021-10/+6
| | | | | | | | | | The struct will be made private in upcoming patches. Construct the list of block entries into a separate list and append them rather than remember the index of the count element. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* util: typedparam: Introduce 'virTypedParamListConcat'Peter Krempa2023-05-023-0/+28
| | | | | | | | | | Introduce a helper function to concatenate two virTypedParamLists. This will allow us to refactor qemuDomainGetStatsBlock to not access the list directly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* util: virtypedparam: Introduce virTypedParamListNew()Peter Krempa2023-05-027-7/+16
| | | | | | | | | Add an allocator function and refactor all allocations to use it. In upcoming patches 'struct _virTypedParamList' will be made private. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* virtypedparam.h: Consistently use contemporary header stylePeter Krempa2023-05-021-60/+80
| | | | | | | | | The header uses both styles randomly, switch it to the contemporary style. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* util: virtypedparam: Simplify error handling in virTypedParamListAdd*Peter Krempa2023-05-021-31/+15
| | | | | | | | | | Don't check the return value of 'virTypedParamListExtend' which will always be a valid pointer and 'virTypedParameterAssignValue' always returns 0. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>