Account for the possible SATA disks too, which means 120 potential
disks.
This means the size of the array triples, however that is unavoidable
with the current way of reading disks.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Add it to the list of 'deviceType' values ignored for disks.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Move all the private helpers for parsing and formatting of domain
elements as private static functions in vmx.c, to avoid using them
directly.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
These variables seem to be left over from a previous refactoring and
they don't add anything to the code.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reflect in the virtiofs documentation that virtiofs can now be used
even without NUMA. While at it, be more precise where and why shared
memory is required.
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
...if a machine memory-backend using shared memory is configured for
the guest. This is especially important for QEMU machine types that
don't have NUMA but virtiofs support.
An example snippet:
<domain type='kvm'>
<name>test</name>
<memory unit='KiB'>2097152</memory>
<memoryBacking>
<access mode='shared'/>
</memoryBacking>
<devices>
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<source dir='/tmp/test'/>
<target dir='coffee'/>
</filesystem>
...
</devices>
...
</domain>
and the corresponding QEMU command line:
/usr/bin/qemu-system-s390x \
-machine s390-ccw-virtio-5.2,memory-backend=s390.ram \
-m 2048 \
-object
memory-backend-file,id=s390.ram,mem-path=/var/lib/libvirt/qemu/ram/46-test/s390.ram,share=yes,size=2147483648 \
...
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This provides basic testing for the free-page-reporting feature that is
introduced in qemu 5.1.
Signed-off-by: Nico Pache <npache@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This patch enables the free-page-reporting in qemu.
Signed-off-by: Nico Pache <npache@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This patch will introduce the free-page-reporting feature capabilities
that are in qemu 5.1
Signed-off-by: Nico Pache <npache@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This will add the proper documentation and parser support for the free page
reporting feature that is introduced in QEMU 5.1.
Signed-off-by: Nico Pache <npache@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
By default, pfifo_fast queueing discipline (qdisc) is set on
newly created interfaces (including TAPs). This qdisc has three
queues and packets that want to be sent through given NIC are
placed into one of the queues based on TOS field. Queues are then
emptied based on their priority allowing interactive sessions
stay interactive whilst something else is downloading a large
file.
Obviously, this means that kernel has to be involved and some
locking has to happen (when placing packets into queues). If
virtualization is taken into account then the above algorithm
happens twice - once in the guest and the second time in the
host.
This is arguably not optimal as it burns host CPU cycles
needlessly. Guest already made it choice and sent packets in the
order it wants.
To resolve this, Linux kernel offers 'noqueue' qdisc which can be
applied on virtual interfaces and in fact for 'lo' it is by
default:
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
Set it for other TAP devices we create for domains too. With this
change I was able to squeeze 1Mbps more from a macvtap attached
to a guest and to my 1Gbps LAN (as measured by iperf3).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329644
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This helper changes the root qdisc on given interface.
Ideally, it would be written using netlink but my attempts to
write the code were not successful and thus I've fallen back to
virCommand() + tc.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
The rpath improvements in:
commit 69980ab798
Author: Andrea Bolognani <abologna@redhat.com>
Date: Wed Aug 19 11:15:35 2020 +0200
meson: Improve RPATH handling
missed that Fedora's %meson macro sets --auto-features=enabled, thus
force enabling rpath in the RPM build. Thus we need to explicitly
disable it
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel Letai <dani@letai.org.il>
Currently setting max_len=0 causes virtlogd to spin in a busy loop. It
is natural to allow this to disable log rollover which can be useful for
developers debugging things.
Note disabling rollover exposes the host to denial of service from a
malicious guest, so must be used with care.
Closes https://gitlab.com/libvirt/libvirt/-/issues/85
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Fixes commit <d5b05614dfbc9bd60ea1a31a9cc32aaf3c771ddc> which changed
allocation from VIR_ALLOC_N to g_new0 but missed one +1 on number of
allocated elements.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Fixes commit <a5d88ffe0ad9b5d5314ab0058c5b363f9f79b8ee> which changed
allocation from VIR_ALLOC_N to g_new0 but missed some +1 on number of
allocated elements.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
If storage migration is requested, and the destination storage does
not exist on the remote host, qemu's migration support will call
into the libvirt storage driver to precreate the destination storage.
The storage driver virConnectPtr is opened too early though, adding
an unnecessary dependency on the storage driver for several cases
that don't require it. This currently requires kubevirt to install
the storage driver even though they aren't actually using it.
Push the virGetConnectStorage calls to right before the cases they are
actually needed.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
For the virtio-9p bhyve command line argument, the proper order
is mount_tag=/path/to/host/dir, not the opposite.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
The aim of virSocketAddrPrefixToNetmask() is to initialize passed
virSocketAddr structure based on prefix length and family.
However, it doesn't set all members in the struct which may lead
to reads of uninitialized values:
==15421== Use of uninitialised value of size 8
==15421== at 0x50F297A: _itoa_word (in /lib64/libc-2.31.so)
==15421== by 0x510C8FE: __vfprintf_internal (in /lib64/libc-2.31.so)
==15421== by 0x5120295: __vsnprintf_internal (in /lib64/libc-2.31.so)
==15421== by 0x50F8969: snprintf (in /lib64/libc-2.31.so)
==15421== by 0x51BB602: getnameinfo (in /lib64/libc-2.31.so)
==15421== by 0x496DEE0: virSocketAddrFormatFull (virsocketaddr.c:486)
==15421== by 0x496DD9F: virSocketAddrFormat (virsocketaddr.c:444)
==15421== by 0x11871F: networkDnsmasqConfContents (bridge_driver.c:1404)
==15421== by 0x1118F5: testCompareXMLToConfFiles (networkxml2conftest.c:48)
==15421== by 0x111BAF: testCompareXMLToConfHelper (networkxml2conftest.c:112)
==15421== by 0x112679: virTestRun (testutils.c:142)
==15421== by 0x111D09: mymain (networkxml2conftest.c:144)
==15421== Uninitialised value was created by a stack allocation
==15421== at 0x1175D2: networkDnsmasqConfContents (bridge_driver.c:1056)
All callers expect the function to initialize the structure
fully.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Recently virtio-9p support was added to bhyve.
On the host side it looks this way:
bhyve .... -s 25:0,virtio-9p,sharename=/path/to/shared/dir
It could also have ",ro" suffix to make share read-only.
In the Linux guest, this share is mounted with:
mount -t 9p sharename /mnt/sharename
In the guest user will see the same permissions and ownership
information for this directory as on the host. No uid/gid remapping is
supported, so those could resolve to wrong user or group names.
The same applies to the other side: chowning/chmodding in the guest will
set specified ownership and permissions on the host.
In libvirt domain XML it's modeled using the 'filesystem' element:
<filesystem type='mount'>
<source dir='/path/to/shared/dir'/>
<target dir='sharename'/>
</filesystem>
Optional 'readonly' sub-element enables read-only mode.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
As preparation for g_autoptr() we need to change the function to take
only virCgroupPtr.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Actual change is "s/``elements``/``feature`` elements/", rest is
reflow.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
With this commit, all architecture lists that we base feature
enablement decisions on are defined within a few lines of each
other, increasing maintainability.
Additionally, generic architecture lists that appear in the
conditions for multiple features are defined, so that repetition
is reduced.
Note that a few checks (numactl, zfs, ceph) have been changed
from %ifarch to %ifnarch for consistency: while doing so, the
corresponding list of architectures has also been replaced with
the complement of the original one to ensure the overall behavior
would be preserved.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
There's no need to set a default for it if we're going to override
it immediately afterwards anyway, and setting with_qemu_tcg at the
same time only makes things more confusing.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Neither Fedora nor RHEL build packages on this architecture.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
It belongs before package-specific feature flags are defined.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
To keep things maintainable, we want to have architecture handling
all in one spot instead of sprinkling %ifarch conditionals all over
the place.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
The right-hand side of these expressions will always evaluate to
zero. Stop obfuscating this fact.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
These are always enabled so it doesn't make any sense to have the result
in summary as meson will fail if they are missing.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>