Commit Graph

40874 Commits

Author SHA1 Message Date
Michal Privoznik
e71e13488d Substitute security_context_t with char *
Historically, we've used security_context_t for variables passed
to libselinux APIs. But almost 7 years ago, libselinux developers
admitted in their API that in fact, it's just a 'char *' type
[1]. Ever since then the APIs accept 'char *' instead, but they
kept the old alias just for API stability. Well, not anymore [2].

1: 9eb9c93275
2: 7a124ca275

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-07-15 14:31:07 +02:00
Andrea Bolognani
deceb1e09f tests: Minimize variable scope
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-15 12:52:24 +02:00
Andrea Bolognani
efe6429910 tests: Don't assume IPv4 connectivity is available
If the host doesn't have a single IPv4 address assigned to any of
its interfaces, not even the loopback one, then virnetsockettest
will fail with

  Cannot identify IPv4/6 availability

because, while the IPv6 bind attempt is conditional, the IPv4 one
is not, and in this case it will always fail.

This commit is better viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-15 12:52:20 +02:00
Andrea Bolognani
2b23d194d2 ci: Drop Debian 9 containers
The corresponding libvirt-ci commit is 5abf5e7e2326.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-15 12:06:34 +02:00
Andrea Bolognani
fc832369d0 ci: Drop Debian 9 jobs
The existing cross-compilation jobs are carefully redistributed
among Debian 10 and Debian sid to ensure we don't use the latter
for aarch64, mipsel or mips64el, since those architectures are
currently broken.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-15 12:06:26 +02:00
Stefan Berger
4291080f0c qemu: Choose TPM 2 for backend as default for CRB interface
Choose a TPM 2 device for the backend as default for the CRB interface
since TPM 1.2 would not work.

This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?id=1781913

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-15 08:23:28 +02:00
Stefan Berger
182285214c qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so
prevent the choice of TPM 1.2 when the SPAPR device model is chosen
and use a default of '2.0' (TPM 2) for the backend.

This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?id=1781913

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-15 08:23:28 +02:00
Stefan Berger
5ab5239d89 qemu: Move setting of TPM default to post parse function
Move setting the TPM default version out of the validation function into
the post parse function.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-15 08:23:28 +02:00
Andrea Bolognani
fcac6490f2 docs: platforms: Mention Windows API target
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-14 18:04:13 +02:00
Andrea Bolognani
1b1e3d5f9b docs: platforms: Clarify stance on third-party LTS efforts
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-14 18:04:10 +02:00
Andrea Bolognani
4ec665d360 docs: platforms: Simplify support policy
We discuss Linux, FreeBSD and macOS separately, and we even go as
far as splitting Linux distros into short-lifetime and long-lifetime,
when ultimately the same two priciples apply everywhere: we don't
want to support a platform longer than its vendor does, and in cases
where the vendor support is extremely long we need to have a
time-based escape hatch.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-14 18:04:07 +02:00
Andrea Bolognani
a0b02d5095 docs: platforms: Convert to reStructuredText
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-14 18:04:05 +02:00
Andrea Bolognani
f8d701546f docs: platforms: Add brief outline
This will make the document look nicer, especially after we have
converted it to reStructuredText.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-14 18:03:54 +02:00
Roman Bogorodskiy
9f78225886 docs: bhyve: document ignoring unknown MSRs
Ignoring unknown MSRs using <features> element
<msrs unknown='ignore'/> was supported for quite some already,
so add documentation for it for completeness of flags coverage,
as some guests can be extra picky about flags passed to bhyve,
and it's useful to know how to control those.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-14 19:54:01 +04:00
Prathamesh Chavan
459c30d062 qemu_domainjob: Move PrivateXML parse-job and format-job
Functions `qemuDomainObjPrivateXMLParseJob` and
`qemuDomainObjPrivateXMLFormatJob` are moved from
`qemu_domain` to `qemu_domainjob`.

Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-14 16:48:27 +02:00
Prathamesh Chavan
594e61ed82 qemu_domain: remove passing qemuDomainObjPrivatePtr as param
`qemuDomainObjPrivatePtr` parameter was avoided being passed
as a paramter in functions `qemuDomainObjPrivateXMLParseJob`
and `qemuDomainObjPrivateXMLFormatJob`, as we already pass
`virDomainObjPtr`, which can be used to get `privateData`
pointer.

Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-14 16:48:20 +02:00
Andrea Bolognani
31939c80cd ci: Refresh Dockerfiles
All targets get cpanm, which is now part of the base system, and
xz is now installed explicitly instead of relying on it being either
present by default or dragged in indirectly.

The corresponding libvirt-ci commit is 8920e8f408ba.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-07-14 12:02:59 +02:00
Andrea Bolognani
4541d3a918 ci: Exclude macOS when generating Dockerfiles
Just like FreeBSD, macOS is not supported by the Dockerfile
generator.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-07-14 12:00:12 +02:00
Côme Borsoi
45ed335450 Translated using Weblate (French)
Currently translated at 11.8% (1222 of 10318 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/fr/

Signed-off-by: Côme Borsoi <fedora@borsoi.fr>
2020-07-13 22:04:40 +02:00
Jin Yan
2f470a4fb1 qemu: fix memleak in qemuDomainAttachDeviceLive()
During disk hot plugging, qemuDomainAttachDeviceLive() adds the new
disk to the device list of the VM object. However, hot plugging
cdroms and floppies only updates the src variable of the original
disk device, so the newly generated disk object needs to be freed.

Signed-off-by: Jin Yan <jinyan12@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 22:00:49 +02:00
Bastien Orivel
7187b8e2b6 news: Document the type attribute for mac addresses
Signed-off-by: Bastien Orivel <bastien.orivel@diateam.net>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 18:47:57 +02:00
Bastien Orivel
454e5961ab Add a type attribute on the mac address element
This is only used in the ESX driver where, when set to "static", it will
ignore all the checks libvirt does about the origin of the MAC address
(whether or not it's in a VMWare OUI) and forward the original one to
the ESX server telling it not to check it either.

This allows keeping a deterministic MAC address which can be useful for
licensed software which might dislike changes.

Signed-off-by: Bastien Orivel <bastien.orivel@diateam.net>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 18:47:44 +02:00
Daniel Henrique Barboza
c051e56d27 docs/kbase: introduce migrationinternals.rst
This document describes briefly how Libvirt migration internals
works, complementing the info available in migration.html.in.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:38 +02:00
Daniel Henrique Barboza
3734dba02e qemu_migration.c: modernize qemuMigrationSrcConfirmPhase()
Use g_autoptr() and remove both 'error' and 'cleanup' labels.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:34 +02:00
Daniel Henrique Barboza
e056fdaed5 libvirt-domain.c: g_autofree in virDomainMigrate() and virDomainMigrate2()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:31 +02:00
Daniel Henrique Barboza
47fe0737b3 qemu_migration.c: use g_auto* in qemuMigrationDstFinish()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:28 +02:00
Daniel Henrique Barboza
494a2acd09 qemu_migration.c: modernize qemuMigrationDstPersist()
Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:25 +02:00
Daniel Henrique Barboza
ab6e89a81d qemu_migration.c: use g_auto* in qemuMigrationSrcPerformJob and Peer2Peer
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:23 +02:00
Daniel Henrique Barboza
866ce83c3e qemu_migration.c: use auto* in qemuMigrationSrcRun()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:19 +02:00
Daniel Henrique Barboza
6f59ffb4c9 qemu_migration.c: modernize qemuMigrationSrcPerformNative()
Use g_autoptr() and remove the unneeded 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:16 +02:00
Daniel Henrique Barboza
b7d5277deb qemu_driver.c: use g_auto* in qemuDomainMigratePerform3* functions
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:10 +02:00
Daniel Henrique Barboza
c54dba525d qemu_migration_cookie.c: modernize qemuMigrationEatCookie()
Use g_autoptr() and remove the obsolete 'error' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:07 +02:00
Daniel Henrique Barboza
ce15bd09d1 qemu_migration.c: modernize qemuMigrationSrcBeginPhase()
Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:04 +02:00
Daniel Henrique Barboza
78db83dc1a qemu_migration_cookie.h: register AUTOPTR_CLEANUP_FUNC for qemuMigrationCookiePtr
Next patch will use g_autoptr() in a qemuMigrationCookiePtr pointer to
modernize qemuMigrationSrcBeginPhase().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:18:01 +02:00
Daniel Henrique Barboza
51f1e7f2da qemu_migration.c: use g_auto* in qemuMigrationDstPrepareDirect()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:59 +02:00
Daniel Henrique Barboza
d9ea60c0a0 qemu_monitor_json.c: modernize qemuMonitorJSONMigrateIncoming()
Use g_autoptr() and remove the now obsolete 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:56 +02:00
Daniel Henrique Barboza
b75ff9a194 qemu_migration_params.c: use g_autofree in qemuMigrationParamsApply()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:54 +02:00
Daniel Henrique Barboza
769de4695b qemu_migration_params.c: modernize qemuMigrationParamsEnableTLS()
Use g_autoptr() and remove both 'cleanup' and 'error' labels.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:52 +02:00
Daniel Henrique Barboza
5b4ae09e71 qemu_migration_params.c: modernize qemuMigrationParamsFetch()
Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:49 +02:00
Daniel Henrique Barboza
db64224bca qemu_migration.c: use g_auto* in qemuMigrationDstPrepareAny()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:47 +02:00
Daniel Henrique Barboza
1a86aee92a qemu_migration.c: modernize qemuMigrationDstPrepare()
Use g_autofree and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:44 +02:00
Daniel Henrique Barboza
e200803f45 qemu_driver.c: modernize qemuDomainMigratePrepare3Params()
Use variable autocleanup and remove the now obsolete 'cleanup'
label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:42 +02:00
Daniel Henrique Barboza
b2aefee3ef qemu_driver.c: modernize qemuDomainMigratePrepare3()
Use g_autoptr() on pointers and remove the unneeded 'cleanup'
label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:40 +02:00
Daniel Henrique Barboza
6c4a3e43e7 qemu_driver.c: modernize qemuDomainMigrateBegin3Params()
Use g_autofree and remove the unneeded 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:35 +02:00
Daniel Henrique Barboza
7916104971 libvirt-domain.c: use g_autofree in virDomainMigrateVersion* functions
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:32 +02:00
Daniel Henrique Barboza
37fce4c2ef libvirt-domain.c: modernize virDomainMigrateVersion1
Use g_autofree on strings and remove the 'done' label since it's
now unneeded.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:30 +02:00
Daniel Henrique Barboza
fe14a62121 libvirt-domain.c: modernize virDomainMigrateCheckNotLocal()
Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-13 17:17:27 +02:00
Nikolay Shirokovskiy
606e7e0318 storage: fix vstorage backend build
Add headers with declarations of  geteuid/getegid
and virGetUserName/virGetGroupName.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-07-13 09:27:42 +03:00
Laine Stump
866bb99644 docs: point out that locals should be defined at the top of a block of code
Although we have nothing in make syntax-check to enforce this, and
apparently there are places where it isn't the case (according to
Dan), we should discourage the practice of defining new variables in
the middle of a block of code.

https://www.redhat.com/archives/libvir-list/2020-July/msg00433.html

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-10 13:42:42 -04:00
Pavel Hrdina
b94856c919 docs: rename fig to svg in Makefile.am
Commit <9ad637c9651ff29955dd6aa8fe31f639b42b7315> converted all fig
files into svg files but did not change the Makefile.am.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2020-07-10 17:39:29 +02:00