Commit Graph

5394 Commits

Author SHA1 Message Date
Peter Krempa
63a833038f qemu: command: Format netdev as JSON when QEMU_CAPS_NETDEV_JSON is present
Base the JSON output on a regular capability flag rather than purely
internal flag. This will prepare for the time when QEMU will accept JSON
argumets for -netdev.

For now the capability is not set (thus we for now don't have QMP
schema validation) but that will be addressed later.

To achieve this 'qemuBuildNetdevCommandlineFromJSON' is introduced
and all callers of 'virQEMUBuildNetdevCommandlineFromJSON' are
refactored to use the new helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-12 10:26:00 +02:00
Peter Krempa
acf4159556 virJSONValueObjectAddVArgs: Add check for presence of the ':' separator
Enforce that the ':' separator between the key and value is always
present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-12 10:25:59 +02:00
Peter Krempa
eb5b7722ea virJSONValueObjectAddVArgs: Add 'k' convertor for formatting non-negative integers
In many cases we use a signed value, but use the sign to note that it
was not assigned. For converting to JSON objects it will be handy to
have possibility to do this automatically.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-12 10:25:59 +02:00
Michal Privoznik
5de203f879 vireventglib: Remove handles with the highest priority
When a server decides to close a client, the
virNetServerClientCloseLocked() is called. In here various
cleanup steps are taken, but the most important part (from this
commit's POV at least) is the way that the socket is closed.
Firstly, removal of the socket associated with the client from
the event loop is signalized and then the socket is unrefed. The
socket is not closed just yet though, because the event loop
holds a reference to it. This reference will be freed as soon as
the event loop wakes up and starts issuing callbacks (in this
case virNetSocketEventFree()).

So far, this is how things usually work. But if the daemon
reaches the number of opened files limit, things start to work
differently.

If the RLIMIT_NOFILE limit is reached and there's a client that
wants to connect then the event loop wakes up, sees POLLIN on the
socket and calls virNetServerServiceAccept() which in turn calls
virNetSocketAccept(). But because of the limit, accept() fails
with EMFILE leaving the POLLIN event unhandled. The dispatch then
continues to next FDs with events on them. BUT, it will NOT call
the socket removal callback (virNetSocketEventFree()) because it
has low priority (G_PRIORITY_DEFAULT_IDLE). Per glib's
documentation:

 * Each event source is assigned a priority. The default priority,
 * %G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher priorities.
 * Values greater than 0 denote lower priorities. Events from high priority
 * sources are always processed before events from lower priority sources.

and per g_idle_add() documentation:

 * Adds a function to be called whenever there are no higher priority
 * events pending to the default main loop. The function is given the
 * default idle priority, %G_PRIORITY_DEFAULT_IDLE.

Now, because we did not accept() the client we are constantly
seeing POLLIN on the main socket and thus the removal of the
client socket won't ever happen.

The fix is to set at least the same priority as other sources,
but since we want to just close an FD, let's give it the highest
priority and call it before handling other events.

This issue can be easily reproduced, for instance:

 # ulimit -S -n 40 (tweak this number if needed)
 # ./src/libvirtd

from another terminal:

 # for ((i=0; i<100; i++)); do virsh list & done; virsh list

The last `virsh list` must not get stuck.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2007168
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-10-10 18:42:15 +02:00
Michal Privoznik
45aa4c1d2a virhostmem: Introduce virHostMemGetTHPSize()
New virHostMemGetTHPSize() is introduced which allows caller to
obtain THP PMD (Page Middle Directory) size, which is equal to
the minimal size that THP can use, taken from kernel doc
(Documentation/admin-guide/mm/transhuge.rst):

  Some userspace (such as a test program, or an optimized memory allocation
  library) may want to know the size (in bytes) of a transparent hugepage::

    cat /sys/kernel/mm/transparent_hugepage/hpage_pmd_size

Since this size depends on the host architecture and the kernel
it won't change whilst libvirtd is running. Therefore, we can use
virOnce() and cache the value. Of course, we can be running under
kernel that has THP disabled or has no notion of THP at all. In
that case a negative value is returned to signal error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 10:58:27 +02:00
Peter Krempa
acfce77201 util: Remove use of virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC)
It always returns true. Make the logic a bit simpler to see through.

This completely removes 'virCryptoHaveCipher' as it's pointless in the
current form.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-22 14:53:55 +02:00
Peter Krempa
675c222a58 virDevMapperGetTargets: Fix non-linux implementation
s/GSlist/GSList/

Fixes: 6c49c2ee9f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2021-09-21 14:30:19 +02:00
Michal Privoznik
2731717a73 lib: Use $PROG instead of $PROG_PATH
Due to the way we detect programs at runtime there's no
difference between $PROG and $PROG_PATH macros that come from
meson-config.h. Either both are set to the path found during
configure or both are set to just "$prog", e.g.:

  #define EBTABLES "/sbin/ebtables"
  #define EBTABLES_PATH "/sbin/ebtables"
  #define FLAKE8 "flake8"
  #define FLAKE8_PATH "flake8"

Change those few places which use _PATH.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 14:09:44 +02:00
Peter Krempa
9d34136a52 util: virstring: Remove unused 'virStringListMerge'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 12:25:42 +02:00
Peter Krempa
6c49c2ee9f virDevMapperGetTargets: Use a linked list as return type
Of the two callers one simply iterates over the returned paths and the
second one appends the returned paths to another linked list. Simplify
all of this by directly returning a linked list.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 12:25:42 +02:00
Peter Krempa
45ea6a9fcf util: virdevmapper: Sanitize use of macros for buffer size
There are two distinct uses of an arbitrary buffers size when querying
the device mapper. One is related to loading the /proc/devices file,
while the other is used as buffer for ioctls to the devmapper.

Split up the macros used here so that it's clear that they are not meant
for the same thing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 12:25:41 +02:00
Ján Tomko
a26df27662 conf: add cleanup func for virMacMap
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-09-09 18:06:13 +02:00
Ján Tomko
a082c46229 util: virIdentitySetCurrent: only unref the old identity on success
In the unlikely case that we were unable to set the new
identity, we would unref the old one even though it still
could be in the thread-local storage.

Fixes: c6825d8813
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-09-08 16:19:55 +02:00
Michal Privoznik
cb50dc0ecb virscsi: Drop @tmp from virSCSIDeviceListDel
Clang on Rawhide started to complain that @tmp variable in
virSCSIDeviceListDel() is set but not used. This is obviously a
false positive because the variable is used to free device stolen
from the list. Anyway, we can do without the variable so in this
specific case let's fix our code to appease Clang.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-08-26 09:16:44 +02:00
Michal Privoznik
8340ce57b4 virpci: Clarify lifetime of temporary object
The virPCIDeviceIsBehindSwitchLackingACS() function checks
whether given PCI device is not behind a switch that lacks ACS.
It does so by starting at given device and traversing up, one
parent at time towards the root. The parent device is obtained
via virPCIDeviceGetParent() which allocates new virPCIDevice
structure. For freeing the structure we use g_autoptr() and a
temporary variable @tmp. However, Clang fails to understand our
clever algorithm and complains that the variable is set but never
used. This is obviously a false positive, but using a small trick
we can shut Clang up.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-08-26 09:16:44 +02:00
Simon Rowe
5646b7c5e1 iohelper: skip lseek() and ftruncate() on block devices
Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-24 16:02:38 +02:00
Michal Privoznik
78d4c12b8c virhostmem: Handle numactl-less build in hugepages allocation/reporting
When using 'virsh freepages' or 'virsh allocpages' then
virHostMemGetFreePages() or virHostMemAllocPages() is called,
respectively. But the following may happen: libvirt was built
without numactl support and thus a fake NUMA node was constructed
for capabilities, which means that startCell is going to be 0.
But we can't blindly pass startCell = 0 to virNumaGetPageInfo()
nor virNumaSetPagePoolSize() because they would operate over node
specific path (/sys/devices/system/node/nodeX) rather than NUMA
agnostic path (/sys/kernel/mm/hugepages/) and we are not
guaranteed that the former exists (kernel might have been built
without NUMA support).

Resolves:https://bugzilla.redhat.com/show_bug.cgi?id=1978574

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-23 14:00:20 +02:00
Michal Privoznik
ebec3de97d virhostmem: Let caller pass max NUMA node to virHostMemAllocPages
In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemAllocPages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-23 14:00:15 +02:00
Michal Privoznik
59e3584f71 virhostmem: Let caller pass max NUMA node to virHostMemGetFreePages
In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemGetFreePages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-23 14:00:10 +02:00
Michal Privoznik
9f33a6dcb4 virsocket: Don't preserve errno in virSocketRecvFD()
When setting O_CLOEXEC flag on received FD fails the FD is closed
using VIR_FORCE_CLOSE(). But the call is wrapped in errno save
which is not necessary because VIR_FORCE_CLOSE() preserves  errno
value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-20 15:00:53 +02:00
Jinsheng Zhang
47437bbe3a virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces
Warn these error instead of return when removing qos or queues. This will
avoid residual qos clearance on multiple interfaces.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-19 16:47:40 +02:00
Jinsheng Zhang
56723f8846 virnetdevopenvswitch: Introduce virNetDevOpenvswitchInterfaceClearTxQos and virNetDevOpenvswitchInterfaceClearRxQos
Separate virNetDevOpenvswitchInterfaceClearQos into two steps. When setting
qos, we can set only rx or tx and the other one should be cleared.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-19 16:47:38 +02:00
Jinsheng Zhang
a6986fb2cf virnetdevopenvswitch: Extract common code block to a single function
Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-19 16:46:52 +02:00
Jinsheng Zhang
d05aa66db3 virnetdevopenvswitch: Extract conversion parameters between virNetDevBandwidth and ovs
Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-19 16:46:45 +02:00
Jinsheng Zhang
c40421f702 virnetdevopenvswitch: Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos
Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos,
and change vmid to vmuuid.

Signed-off-by: Jinsheng Zhang <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-19 16:46:36 +02:00
Ján Tomko
2c426d2e30 Use g_auto for xmlFreeDoc everywhere
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-08-17 18:27:13 +02:00
Pavel Hrdina
c6c3dd5971 vircgroup: fix build on non-linux systems
virCgroupGetInode needs to be in '#ifdef __linux__'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-17 15:29:38 +02:00
Pavel Hrdina
10c2c0b249 vircgroup: introduce virCgroupGetInode function
For new feature Fibre Channel VMID we will need to get inode of the
VM root cgroup as it is used in the new kernel API together with VMID.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-17 12:35:45 +02:00
Ján Tomko
69e810945e util: xml: clean up unnecessary ret variables
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-08-12 15:47:36 +02:00
Ján Tomko
441d2f4e23 util: xml: use g_auto for xmlXPathObject
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-08-12 15:47:36 +02:00
Ján Tomko
8f6657aea9 util: define cleanup func for xmlXPathObject
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-08-12 15:47:36 +02:00
Kristina Hanicova
323a1318a3 util: add xml validation against schema in virXMLParseHelper()
We need this in order to validate XML against schema at one
place, rather than have the same code for validation in different
functions.
I will add '--validate' option to more virsh commands soon and
this makes it easier as virXMLParse() is called in every one I
plan to change.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-08-12 13:12:29 +02:00
Kristina Hanicova
f43c27960e src: add 'schema' and 'validate' variable to virXMLParseHelper()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-08-12 13:12:29 +02:00
Peter Krempa
b160cb7201 util: virstring: Remove unused virStringListFreeCount
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:01 +02:00
Peter Krempa
d40e9d1df8 virNetDevGetVirtualFunctions: Directly return virPCIVirtualFunctionList
Remove the conversion from virPCIVirtualFunctionList which encapsulates
the list of virtual functions to two disjunct arrays.

This greatly simplifies the fetching of the parameters as well as
cleanup in the caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Peter Krempa
795e9e05c3 virPCIGetVirtualFunctions: Fetch also network interface name if needed
'virNetDevGetVirtualFunctions' calls 'virPCIGetVirtualFunctions' and
then re-iterates the returned list to fetch the interface names for the
returned virtual functions.

If we move the fetching of the interface name into
virPCIGetVirtualFunctions we can simplify the code and remove a bunch of
impossible error states.

To accomplish this the function is renamed to
'virPCIGetVirtualFunctionsFull' while keeping a wrapper with original
name and if the physical port ID is passed the interface name is fetched
too without the need to re-convert the address into a sysfs link.

For now 'virNetDevGetVirtualFunctions' still converts the returned data
into two lists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Peter Krempa
7ef618f30a virPCIGetNetName: Make 'physPortID' argument const
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Peter Krempa
9766d0bac7 virPCIGetVirtualFunctionIndex: Refactor cleanup
The 'ret' variable and 'out' label can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Peter Krempa
c97518d9b8 virPCIGetVirtualFunctions: Simplify cleanup of returned data
Introduce a struct for holding the list of VFs returned by
virPCIGetVirtualFunctions so that we can employ automatic memory
clearing and also allow querying more information at once.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Peter Krempa
00f804c1cf virNetDevGetVirtualFunctions: Remove 'max_vfs' argument
The only caller doesn't use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-09 10:09:00 +02:00
Daniel P. Berrangé
1280a631ef src: stop checking virIdentityNew return value
This method will always succeed.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-06 12:11:58 +01:00
Daniel P. Berrangé
5df2c49263 util: directly query KVM for TSC scaling support
We currently query the host MSRs to determine if TSC scaling is
supported. This works OK when running privileged and can open
the /dev/cpu/0/msr. When unprivileged we fallback to querying
MSRs from /dev/kvm. This is incorrect because /dev/kvm only
reports accurate info for MSRs that are valid to use from inside
a guest.  The TSC scaling support MSR is not, thus we always end
up reporting lack of TSC scaling when unprivileged.

The solution to this is easy, because KVM can directly report
whether TSC scaling is available, which matches what QEMU will
do at startup.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/188
Reported-by: Roman Mohr <rmohr@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-06 12:00:53 +01:00
Peter Krempa
f90de01763 util: alloc: Completely replace VIR_APPEND_ELEMENT_QUIET by VIR_APPEND_ELEMENT
VIR_APPEND_ELEMENT doesn't report any errors now so we can remove
VIR_APPEND_ELEMENT_QUIET and replace all uses by VIR_APPEND_ELEMENT

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
98f6f2081d util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement
Use virAppendElement instead of virInsertElementsN to implement
VIR_APPEND_ELEMENT which allows us to remove error handling as the
only relevant errors were removed when switching to aborting memory
allocation functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
8c22b28dbe util: alloc: Reimplement VIR_APPEND_ELEMENT_QUIET using virAppendElement
For now it was an alias to VIR_APPEND_ELEMENT. Use virAppendElement
directly until VIR_APPEND_ELEMENT is refactored too and we'll be able to
get rid of VIR_APPEND_ELEMENT_QUIET completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
592517636f util: alloc: Reimplement VIR_APPEND_ELEMENT_COPY using virAppendElement
Use virAppendElement instead of virInsertElementsN to implement
VIR_APPEND_ELEMENT_COPY which allows us to remove error handling as the
only relevant errors were removed when switching to aborting memory
allocation functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
0215139bc6 util: alloc: Reimplement VIR_APPEND_ELEMENT_(COPY_)INPLACE using virAppendElement
VIR_APPEND_ELEMENT_INPLACE and VIR_APPEND_ELEMENT_COPY_INPLACE already
ignore the return value from 'virInsertElementsN' which allows a trivial
conversion to virAppendElement without the need for 'ignore_value'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
51c8245847 util: alloc: Introduce virAppendElement helper
The new wrapper calls virInsertElementInternal with the appropriate
arguments without any checks which are unnecessary for appension. This
allows to have no return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
853fb577d8 virInsertElementsN: Split out actual insertion code
Split out the code doing the movement of the elements and insertion from
the range checks. This will help in adding an error-free version for
appension.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
05b69f3ec4 virInsertElementsN: Rename 'add' argument
The idea of @add was that the insersion/appension macros would allow
adding more than one element but this feature was never implemented.

'add' is nowadays used as a dummy variable consuming the result of the
VIR_TYPEMATCH compile time check.

Make it obvious that we don't use 'add' by renaming it to
'typematchDummy', marking it as unused and replacing all occurences
where the value was used by literal '1'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00