]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
4 years agoconf: convert network_conf.c to use g_auto* pointers
Laine Stump [Wed, 10 Jun 2020 03:43:56 +0000 (23:43 -0400)]
conf: convert network_conf.c to use g_auto* pointers

This was mostly boilerplate conversion, but in one case I needed to
define several differently named char* to take the place of a single
char *tmp that was re-used multiple times, and in another place there
was a single char* that was used at the toplevel of the function, and
then later used repeatedly inside a for loop, so I defined a new
separate char* inside the loop.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agonetwork: wire up support for IPv6 NAT rules
Daniel P. Berrangé [Mon, 8 Jun 2020 13:40:15 +0000 (14:40 +0100)]
network: wire up support for IPv6 NAT rules

Now that we have support for IPv6 in the iptables helpers, and a new
option in the XML schema, we can wire up support for it in the network
driver.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: add an attribute to turn on NAT for IPv6 virtual networks
Daniel P. Berrangé [Mon, 8 Jun 2020 13:35:02 +0000 (14:35 +0100)]
conf: add an attribute to turn on NAT for IPv6 virtual networks

Historically IPv6 did not support NAT, so when IPv6 was added to
libvirt's virtual networks, when requesting <forward mode="nat"/>
libvirt will NOT apply NAT to IPv6 traffic, only IPv4 traffic.

This is an annoying historical design decision as it means we
cannot enable IPv6 automatically. We thus need to introduce a
new attribute

   <forward mode="nat">
     <nat ipv6="yes"/>
   </forward>

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoutil: add support for IPv6 masquerade rules
Daniel P. Berrangé [Mon, 8 Jun 2020 13:28:20 +0000 (14:28 +0100)]
util: add support for IPv6 masquerade rules

IPv6 does support masquerade since Linux 3.9.0 / ip6tables 1.4.18,
which is Fedora 18 / RHEL-7 vintage, which covers all our supported
Linux versions.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirDevMapperGetTargetsImpl: Check for dm major properly
Michal Privoznik [Thu, 11 Jun 2020 10:14:33 +0000 (12:14 +0200)]
virDevMapperGetTargetsImpl: Check for dm major properly

In v6.4.0-rc1~143 I've introduced a check that is supposed to
return from the function early, if given path is not a dm target.
While the idea is still valid, the implementation had a flaw.
It calls stat() over given path and the uses major(sb.st_dev) to
learn the major of the device. This is then passed to
dm_is_dm_major() which returns true or false depending whether
the device is under devmapper's control or not.

The problem with this approach is in how the major of the device
is obtained - paths managed by devmapper are special files and
thus we want to be using st_rdev instead of st_dev to obtain the
major number. Well, that's what virIsDevMapperDevice() does
already so might as well us that.

Fixes: 01626c668ecfbe465d18799ac4628e6127ea1d47
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1839992

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoutil: Move virIsDevMapperDevice() to virdevmapper.c
Michal Privoznik [Thu, 11 Jun 2020 09:57:14 +0000 (11:57 +0200)]
util: Move virIsDevMapperDevice() to virdevmapper.c

When introducing virdevmapper.c (in v4.3.0-rc1~427) I didn't
realize there is a function that calls in devmapper. The function
is called virIsDevMapperDevice() and lives in virutil.c. Now that
we have a special file for handling devmapper move it there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agodocs: Remove libvirt-dockerfiles from CI dashboard
Andrea Bolognani [Mon, 15 Jun 2020 09:57:50 +0000 (11:57 +0200)]
docs: Remove libvirt-dockerfiles from CI dashboard

The repository is now obsolete, and it never had proper GitLab CI
support anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add kbase entry showing KVM real time guest config
Daniel P. Berrangé [Mon, 1 Jun 2020 11:35:24 +0000 (12:35 +0100)]
docs: add kbase entry showing KVM real time guest config

There are many different settings that required to config a KVM guest
for real time, low latency workoads. The documentation included here is
based on guidance developed & tested by the Red Hat KVM real time team.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoRemove use of variables passed only to 'VIR_FREE'
Peter Krempa [Thu, 11 Jun 2020 08:22:09 +0000 (10:22 +0200)]
Remove use of variables passed only to 'VIR_FREE'

Compilers are not very good at detecting this problem. Fixed by manual
inspection of compilation warnings after replacing 'VIR_FREE' with an
empty macro.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agovboxDomainScreenshot: Don't pass uninitialized 'screenData' to VIR_FREE
Peter Krempa [Thu, 11 Jun 2020 08:38:05 +0000 (10:38 +0200)]
vboxDomainScreenshot: Don't pass uninitialized 'screenData' to VIR_FREE

If one of the early checks to get screen resolution fails 'screenData'
would be passed to VIR_FREE uninitialized. Unfortunately the compiler
isn't able to detect this when VIR_FREE is implemented using
g_clear_pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agoremoteDispatchDomainMigratePrepare*: Don't pass uninitialized variable to VIR_FREE
Peter Krempa [Thu, 11 Jun 2020 08:34:21 +0000 (10:34 +0200)]
remoteDispatchDomainMigratePrepare*: Don't pass uninitialized variable to VIR_FREE

'uri_out' may be passed to VIR_FREE uninitialized if 'conn' is NULL.
Unfortunately the compiler isn't able to detect this problem when
VIR_FREE is implemented using g_clear_pointer. Initialize the variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agovirTPMEmulatorInit: Don't use temporary variable to free path
Peter Krempa [Thu, 11 Jun 2020 08:26:19 +0000 (10:26 +0200)]
virTPMEmulatorInit: Don't use temporary variable to free path

Use VIR_FREE directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agocputest: Avoid use of temporary variable in DO_TEST macro
Peter Krempa [Thu, 11 Jun 2020 08:24:54 +0000 (10:24 +0200)]
cputest: Avoid use of temporary variable in DO_TEST macro

Use g_free directly to free the returned pointer from
virTestLogContentAndReset rather than store it in a temp variable which
was necessary when we only allowed VIR_FREE.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agotestVirFindSCSIHostByPCI: Remove unused 'path_addr'
Peter Krempa [Thu, 11 Jun 2020 08:23:52 +0000 (10:23 +0200)]
testVirFindSCSIHostByPCI: Remove unused 'path_addr'

The path is formatted but then just freed without any use since
introduction of the test function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agolibxlDomainMigrationDstPrepareDef: remove use of temporary variable
Peter Krempa [Thu, 11 Jun 2020 08:16:34 +0000 (10:16 +0200)]
libxlDomainMigrationDstPrepareDef: remove use of temporary variable

We can free 'def->name' directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
4 years agoci: Swap mipsel and ppc64le builds
Andrea Bolognani [Thu, 11 Jun 2020 18:06:02 +0000 (20:06 +0200)]
ci: Swap mipsel and ppc64le builds

Debian sid is currently broken on mipsel, so use Debian 10 for
that architecture; at the same time, move the ppc64le build from
Debian 10 to Debian sid to keep things balanced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: Update build system integration
Andrea Bolognani [Tue, 2 Jun 2020 15:28:58 +0000 (17:28 +0200)]
ci: Update build system integration

The ci-* targets need to know where our container images are stored
and how they are called to work, so now that we use the GitLab
container registry instead of Quay some changes are necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Use GitLab container registry
Andrea Bolognani [Tue, 2 Jun 2020 15:28:57 +0000 (17:28 +0200)]
ci: Use GitLab container registry

Instead of using pre-built containers hosted on Quay, build
containers as part of the GitLab CI pipeline and upload them to the
GitLab container registry for later use.

This will not significantly slow down builds, because containers are
only rebuilt when the corresponding Dockerfile has been modified.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Use variables to build image names
Andrea Bolognani [Tue, 2 Jun 2020 15:28:55 +0000 (17:28 +0200)]
ci: Use variables to build image names

This removes a lot of repetition and makes the configuration much
easier to read.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: Document CIRRUS_GITHUB_REPO variable
Andrea Bolognani [Wed, 10 Jun 2020 16:11:04 +0000 (18:11 +0200)]
docs: Document CIRRUS_GITHUB_REPO variable

This needs to be set for every repository for Cirrus CI integration
to work.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: snapshot: Drop unused variable 'creation'
Yi Li [Thu, 11 Jun 2020 03:26:29 +0000 (11:26 +0800)]
conf: snapshot: Drop unused variable 'creation'

Signed-off-by: Yi Li <yili@winhong.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Reduce number of stages
Andrea Bolognani [Wed, 10 Jun 2020 10:11:30 +0000 (12:11 +0200)]
ci: Reduce number of stages

Right now we're dividing the jobs into three stages: prebuild, which
includes DCO checking as well as building artifacts such as the
website, and native_build/cross_build, which do exactly what you'd
expect based on their names.

This organization is nice from the logical point of view, but results
in poor utilization of the available CI resources: in particular, the
fact that cross_build jobs can only start after all native_build jobs
have finished means that if even a single one of the latter takes a
bit longer the pipeline will stall, and with native builds taking
anywhere from less than 10 minutes to more than 20, this happens all
the time.

Building artifacts in a separate pipeline stage also doesn't have any
advantages, and only delays further stages by a couple of minutes.
The only job that really makes sense in its own stage is the DCO
check, because it's extremely fast (less than 1 minute) and, if that
fails, we can avoid kicking off all other jobs.

Reducing the number of stages results in significant speedups:
specifically, going from three stages to two stages reduces the
overall completion time for a full CI pipeline from ~45 minutes[1]
to ~30 minutes[2].

[1] https://gitlab.com/abologna/libvirt/-/pipelines/154751893
[2] https://gitlab.com/abologna/libvirt/-/pipelines/154771173

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agonews: Document -fw_cfg
Michal Privoznik [Thu, 4 Jun 2020 18:24:40 +0000 (20:24 +0200)]
news: Document -fw_cfg

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Generate command line for -fw_cfg
Michal Privoznik [Tue, 2 Jun 2020 15:07:59 +0000 (17:07 +0200)]
qemu: Generate command line for -fw_cfg

This is pretty straightforward and self explanatory.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosecdrivers: Relabel firmware config files
Michal Privoznik [Tue, 2 Jun 2020 18:56:09 +0000 (20:56 +0200)]
secdrivers: Relabel firmware config files

For the case where -fw_cfg uses a file, we need to set the
seclabels on it to allow QEMU the access. While QEMU allows
writing into the file (if specified on the command line), so far
we are enabling reading only and thus we can use read only label
(in case of SELinux).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Introduce fw_cfg capability
Michal Privoznik [Tue, 2 Jun 2020 14:57:56 +0000 (16:57 +0200)]
qemu: Introduce fw_cfg capability

This capability tracks whether QEMU supports -fw_cfg command line
option, more specifically whether it allows specifying filename.

There are some releases of QEMU which support -fw_cfg but not
filename. If this is ever a problem we can refine the capability
later on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Validate firmware blob configuration
Michal Privoznik [Tue, 2 Jun 2020 14:38:05 +0000 (16:38 +0200)]
qemu: Validate firmware blob configuration

There are recommendations and limitations to the name of the
config blobs we need to follow [1].

We don't want users to change any value only add new blobs. This
means, that the name must have "opt/" prefix and at the same time
must not begin with "opt/ovmf" nor "opt/org.qemu" as these are
reserved for OVMF or QEMU respectively.

1: docs/specs/fw_cfg.txt from qemu.git

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: Add firmware blob configuration
Michal Privoznik [Thu, 4 Jun 2020 12:15:40 +0000 (14:15 +0200)]
conf: Add firmware blob configuration

QEMU has -fw_cfg which allows users to tweak how firmware
configures itself and/or provide new configuration blobs.
Introduce new <sysinfo/> type "fwcfg" that will hold these
new blobs.

It's possible to either specify new value as a string or
provide a filename which contents then serve as the value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirsysinfo: Parse OEM strings
Michal Privoznik [Tue, 2 Jun 2020 08:15:38 +0000 (10:15 +0200)]
virsysinfo: Parse OEM strings

Setting OEM strings for a domain was introduced in
v4.1.0-rc1~315. However, any application that wanted to use them
(e.g. to point to an URL where a config file is stored) had to
'dmidecode -u --oem-string N' (where N is index of the string).
Well, we can expose them under our <sysinfo/> XML and if the
domain is running Libvirt inside it can be obtained using
virConnectGetSysinfo() API.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirsysinfo: Drop global @sysinfoDmidecode
Michal Privoznik [Mon, 8 Jun 2020 10:53:04 +0000 (12:53 +0200)]
virsysinfo: Drop global @sysinfoDmidecode

Since nobody sets custom dmidecode path anymore, we can drop all
code that exists only because of that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosysinfotest: Move from custom dmidecode scripts to virCommandSetDryRun()
Michal Privoznik [Mon, 8 Jun 2020 10:51:07 +0000 (12:51 +0200)]
sysinfotest: Move from custom dmidecode scripts to virCommandSetDryRun()

Problem with custom dmidecode scripts is that they are hard to
modify, especially if we will want them to act differently based
on passed arguments. So far, we have two scripts which do no more
than 'cat $sysinfo' where $sysinfo is saved dmidecode output.

The virCommandSetDryRun() can be used to trick
virSysinfoReadDMI() thinking it executed real dmidecode.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosysinfotest: Dissolve sysinfotest_run() in testSysinfo()
Michal Privoznik [Mon, 8 Jun 2020 10:32:52 +0000 (12:32 +0200)]
sysinfotest: Dissolve sysinfotest_run() in testSysinfo()

There is no real need to have two separate functions. They can be
merged together which not only saves couple of lines, but
prepares the structure of the code for future expansion. See next
commits.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotestSysinfo: Use more g_auto*()
Michal Privoznik [Mon, 8 Jun 2020 09:56:45 +0000 (11:56 +0200)]
testSysinfo: Use more g_auto*()

Some variables defined in the function can be freed
automatically when going out of scope. This renders @result
variable and cleanup label needless.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirSysinfoReadDMI: Drop needless virFindFileInPath()
Michal Privoznik [Mon, 8 Jun 2020 08:49:36 +0000 (10:49 +0200)]
virSysinfoReadDMI: Drop needless virFindFileInPath()

When trying to decode DMI table, just before constructing
virCommand() the decoder is looked for in PATH using
virFindFileInPath(). Well, this is not necessary because
virCommandRun() will do this too (in virExec()).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirSysinfoReadDMI: Use more g_auto*()
Michal Privoznik [Mon, 8 Jun 2020 08:44:19 +0000 (10:44 +0200)]
virSysinfoReadDMI: Use more g_auto*()

Virtually every variable defined in the function can be freed
automatically when going out of scope.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Remove Travis CI
Andrea Bolognani [Mon, 8 Jun 2020 12:14:01 +0000 (14:14 +0200)]
ci: Remove Travis CI

Since we now use Cirrus CI for macOS jobs, we no longer need to
keep Travis CI around.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Enable Cirrus CI integration
Andrea Bolognani [Fri, 5 Jun 2020 18:37:55 +0000 (20:37 +0200)]
ci: Enable Cirrus CI integration

We use cirrus-run to trigger Cirrus CI jobs from GitLab CI jobs,
making it possible to extend our platform coverage to include
FreeBSD without having to maintain our own runners; additionally,
we'll be able to ditch Travis CI and, since results for Cirrus CI
jobs are reflected back to the GitLab CI jobs that triggered them,
we will be able to get all information from a single dashboard.

The FreeBSD and macOS job definitions can be improved further: for
example, we will want to enable caching to speed up builds, and
ultimately we should figure out a way to generate at least part of
them, notably the list of packages to be installed, using lcitool.
All of that will happen in later patches: for now, this is good
enough to start using Cirrus CI.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Pass migratable=on|off property for -cpu host
Jiri Denemark [Tue, 2 Jun 2020 19:06:02 +0000 (21:06 +0200)]
qemu: Pass migratable=on|off property for -cpu host

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Fill default value in //cpu/@migratable attribute
Jiri Denemark [Tue, 2 Jun 2020 13:34:07 +0000 (15:34 +0200)]
qemu: Fill default value in //cpu/@migratable attribute

Before QEMU introduced migratable CPU property, "-cpu host" included all
features that could be enabled on the host, even those which would block
migration. In other words, the default was equivalent to migratable=off.
When the migratable property was introduced, the default changed to
migratable=on. Let's record the default in domain XML.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Advertise migratable attribute for CPU in domcaps
Jiri Denemark [Tue, 2 Jun 2020 22:28:10 +0000 (00:28 +0200)]
qemu: Advertise migratable attribute for CPU in domcaps

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: Advertise migratable attribute for CPU in domcaps
Jiri Denemark [Tue, 2 Jun 2020 22:28:10 +0000 (00:28 +0200)]
conf: Advertise migratable attribute for CPU in domcaps

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: Introduce migratable attribute for the <cpu> element
Jiri Denemark [Tue, 2 Jun 2020 10:29:57 +0000 (12:29 +0200)]
conf: Introduce migratable attribute for the <cpu> element

The attribute is only allowed for host-passthrough CPUs and it can be
used to request only migratable or all supported features to be enabled
in the virtual CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Avoid probing unsupported migratable CPU expansion
Jiri Denemark [Tue, 2 Jun 2020 23:07:06 +0000 (01:07 +0200)]
qemu: Avoid probing unsupported migratable CPU expansion

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Probe for migrtability support in CPU expansion
Jiri Denemark [Tue, 2 Jun 2020 23:05:36 +0000 (01:05 +0200)]
qemu: Probe for migrtability support in CPU expansion

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Probe for .migratable property of a CPU
Jiri Denemark [Tue, 2 Jun 2020 18:15:53 +0000 (20:15 +0200)]
qemu: Probe for .migratable property of a CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: Use g_auto* in virCPUDefParseXML
Jiri Denemark [Fri, 29 May 2020 12:41:26 +0000 (14:41 +0200)]
conf: Use g_auto* in virCPUDefParseXML

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirSysinfoParseXML: Mangle ctxt inside virSysinfoParseXML()
Michal Privoznik [Thu, 4 Jun 2020 12:57:12 +0000 (14:57 +0200)]
virSysinfoParseXML: Mangle ctxt inside virSysinfoParseXML()

There's no need to set ctxt->node outside of the function. The
function can set it itself - it has all the info needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodomain_conf: Format NS always last
Michal Privoznik [Tue, 2 Jun 2020 14:09:23 +0000 (16:09 +0200)]
domain_conf: Format NS always last

I think that since <qemu:commandline/> is kind of a hack, it
doesn't deserve place in the front row.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoFix some wrong usage of ATTRIBUTE_NONNULL()
Bihong Yu [Sat, 6 Jun 2020 10:52:35 +0000 (18:52 +0800)]
Fix some wrong usage of ATTRIBUTE_NONNULL()

The virStateInitialize() function has ATTRIBUTE_NONNULL()
referring to @root argument (incorrectly anyway) but in
daemonRunStateInit() NULL is passed in anyway.

Then there is virCommandAddArgPair() which also has
ATTRIBUTE_NONNULL() for one of its arguments and then checks the
argument for being NULL anyways.

Signed-off-by:Bihong Yu <yubihong@huawei.com>
Reviewed-by:Chuan Zheng <zhengchuan@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: blockcommit: Fix placement of qemuDomainDiskBlockJobIsSupported
Peter Krempa [Fri, 5 Jun 2020 10:19:29 +0000 (12:19 +0200)]
qemu: blockcommit: Fix placement of qemuDomainDiskBlockJobIsSupported

Commit b50a8354f6d added call to qemuDomainDiskBlockJobIsSupported prior
to filling the 'disk' variable resulting in a crash when attempting a
block commit.

https://gitlab.com/libvirt/libvirt/-/issues/31

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agonetwork: add private chains only if there are networks adding iptables rules
Laine Stump [Fri, 5 Jun 2020 17:11:02 +0000 (13:11 -0400)]
network: add private chains only if there are networks adding iptables rules

Juan Quintela noticed that when he restarted libvirt he was getting
extra iptables rules added by libvirt even though he didn't have any
libvirt networks that used iptables rules. It turns out this also
happens if the firewalld service is restarted. The extra rules are
just the private chains, and they're sometimes being added
unnecessarily because they are added separately in a global
networkPreReloadFirewallRules() that does the init if there are any
active networks, regardless of whether or not any of those networks
will actually add rules to the host firewall.

The fix is to change the check for "any active networks" to instead
check for "any active networks that add firewall rules".

(NB: although the timing seems suspicious, this isn't a new regression
caused by the recently pushed f5418b427 (which forces recreation of
private chains when firewalld is restarted); it was an existing bug
since iptables rules were first put into private chains, even after
commit c6cbe18771 delayed creation of the private chains. The
implication is that any downstream based on v5.1.0 or later that cares
about these extraneous (but harmless) private chains would want to
backport this patch (along with the other two if they aren't already
there))

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agorpm: adapt docs filelist to NEWS -> NEWS.rst rename
Daniel P. Berrangé [Mon, 8 Jun 2020 17:52:58 +0000 (18:52 +0100)]
rpm: adapt docs filelist to NEWS -> NEWS.rst rename

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: fix update-po target to take account of libvirt.pot in srcdir
Daniel P. Berrangé [Fri, 5 Jun 2020 12:32:09 +0000 (13:32 +0100)]
po: fix update-po target to take account of libvirt.pot in srcdir

Now that we're storing libvirt.pot in git, it will be in srcdir instead
of builddir. Weblate is responsible for running msgmerge when the .pot
file changes, so add a warning that this target is not for general usage.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: remove obsolete zanata config file
Daniel P. Berrangé [Mon, 8 Jun 2020 10:53:19 +0000 (11:53 +0100)]
po: remove obsolete zanata config file

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: remove obsolete zanata push/pull rules
Daniel P. Berrangé [Mon, 8 Jun 2020 10:52:37 +0000 (11:52 +0100)]
po: remove obsolete zanata push/pull rules

We're no longer using Zanata, so remove the old push/pull rules.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: update docs to refer to Weblate instead of Zanata
Daniel P. Berrangé [Thu, 4 Jun 2020 22:01:25 +0000 (23:01 +0100)]
po: update docs to refer to Weblate instead of Zanata

The old information about managing PO files was outdated, as we're
managing files in a different way with Weblate. This also introduces a
badge showing the translation progress across languages.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agonews: Add information about old releases
Andrea Bolognani [Tue, 2 Jun 2020 13:07:00 +0000 (15:07 +0200)]
news: Add information about old releases

Until libvirt 2.5.0 we didn't have a real process for release
notes in place, and we just published the list of commits that
had made it into each release, dividing them into categories that
mostly matched the sections we use today. Those documents haven't
been relevant for years, but they're still in the git repository
and collectively take up almost 2 MiB of disk space.

Let's import the only valuable piece of information they contain,
the release date for each libvirt versions, into the current
document and then drop them for good.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agonews: Convert to reStructuredText
Andrea Bolognani [Tue, 2 Jun 2020 11:44:21 +0000 (13:44 +0200)]
news: Convert to reStructuredText

Instead of storing release notes as XML and then converting them
to HTML and ASCII at build time using XSLT and a custom script,
we can use reStructuredText as both the source and ASCII
representation and generate HTML from it using the same tooling
we already use for the rest of the documentation.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agonews: Output reStructuredText for the ASCII version
Andrea Bolognani [Tue, 2 Jun 2020 10:24:45 +0000 (12:24 +0200)]
news: Output reStructuredText for the ASCII version

The ASCII output our scripts produce is already very close to
reStructuredText, and with just a few extra tweaks we can get
almost all of the way there.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: backing chains: fix qemu-img invocation
Ján Tomko [Fri, 5 Jun 2020 14:01:06 +0000 (16:01 +0200)]
docs: backing chains: fix qemu-img invocation

The example was missing the 'create' command.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Roland Clobus <rclobus@rclobus.nl>
4 years agoqemu: fix typo s/readaehad/readahead/
Daniel P. Berrangé [Fri, 5 Jun 2020 12:33:00 +0000 (13:33 +0100)]
qemu: fix typo s/readaehad/readahead/

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: don't reject interface update when switching to/from bridged network
Laine Stump [Thu, 28 May 2020 22:04:24 +0000 (18:04 -0400)]
qemu: don't reject interface update when switching to/from bridged network

If virDomainUpdateDeviceFlags() was used to update an <interface>, and
the interface type changed from type='network' where the network was
an unmanaged bridge (so actualType == bridge) to type='bridge'
(i.e. actualType *also* == bridge), the update would fail due to the
perceived change in type.

In practice it is okay to switch between any interface types that end
up using a tap device, since libvirt just needs to attach the device
to a new bridge. But in this case we were erroneously rejecting it due
to a conditional that was too restrictive. This is what the code was doing:

  if (old->type != new->type)
     [allow update]
  else
     if ((oldActual == bridge and newActual == network)
         || (oldActual == network and newActual == bridge)) {
         [allow update]
     else
         [error]

In the case described above though, old->type and new->type don't match,
but oldActual and newActual are both 'bridge', so we get an error.

This patch changes the inner conditional so that any combination of
'network' and 'bridge' for oldActual and newActual, since they both
use a tap device connected to a bridge.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoUpdate translation files
Weblate [Thu, 4 Jun 2020 21:32:25 +0000 (23:32 +0200)]
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
4 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Thu, 4 Jun 2020 17:17:24 +0000 (19:17 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (9803 of 9803 strings)

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

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: dedupe authors in translations
Daniel P. Berrangé [Thu, 4 Jun 2020 19:44:38 +0000 (20:44 +0100)]
po: dedupe authors in translations

Weblate gets confused if the same email address is mentioned multiple
times in the translation headers. Dedupe authors so that each author
is mentioned only once, with a range of years listed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agogitlab: fix potfile job for new location
Daniel P. Berrangé [Thu, 4 Jun 2020 13:26:39 +0000 (14:26 +0100)]
gitlab: fix potfile job for new location

Since we're storing the libvirt.pot file in git now, we should pull from
the source dir, not the build dir.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: go back to storing the .pot file in git
Daniel P. Berrangé [Mon, 18 May 2020 17:11:15 +0000 (18:11 +0100)]
po: go back to storing the .pot file in git

To integrate with weblate the only practical option currently is to
store the .pot file in git. This is required so that it can add new
languages by cloning the .pot file. It also enables weblate to run
msgmerge on the languages whenever pulling in new changes from git.

The pot file will have to be the full content including the source
locations, so this is going to result in unpleasant diffs when it
is updated periodically.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: stop stripping non-translated strings from po files
Daniel P. Berrangé [Mon, 18 May 2020 16:49:03 +0000 (17:49 +0100)]
po: stop stripping non-translated strings from po files

We previously adopted a minimization technique for po files which
stripped source locations and non-translated msgids in order to save
space in the git repos and have saner commit diffs.

At this time it is not possible to integrate with weblate while having
non-translated msgids stripped, as it will immediately add them back
again.

By keeping all non-translated msgids, our .po files are about x2 the
size at 37 MB vs the original 18 MB. This is still way better than the
original po/ directory which was 109 MB. We're saving 38 MB by still
omitting source file locations, and another 34 MB are saved by the
dropping of all languages which are 100% untranslated.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: generate .pot file with strings in alphabetical order
Daniel P. Berrangé [Mon, 18 May 2020 16:46:31 +0000 (17:46 +0100)]
po: generate .pot file with strings in alphabetical order

The .po files are stored with strings in alphabetical order instead of
source file location order, because this minimizes the diffs created
when code moves around within or between files.

By default msgmerge will honour the order of strings in the .pot file
when creating a .po file, so it is useful if we also create the .pot
file with desired ordering.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: rename the .mini.po files to have just a .po suffix
Daniel P. Berrangé [Mon, 18 May 2020 16:43:38 +0000 (17:43 +0100)]
po: rename the .mini.po files to have just a .po suffix

A .mini.po file is exactly the same format as a .po file. We just used
the alternative extension as we wanted to be able to store both full and
minimized forms in the same directory.

This complicates integration with some translation tools, however, which
only really expect to see $LANG.po as a filename.

With this change we drop the rules for creating non-minimized po files,
and thus the po/*.po are always minimized. A useful side effect is that
we no longer run msgmerge during creation of the gmo files, and thus
don't need to have a date override to get reproducible builds.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: refresh to drop unused translations
Daniel P. Berrangé [Mon, 18 May 2020 16:34:56 +0000 (17:34 +0100)]
po: refresh to drop unused translations

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: delete empty translations
Daniel P. Berrangé [Mon, 18 May 2020 16:17:09 +0000 (17:17 +0100)]
po: delete empty translations

There is no need to keep .po files which are 100% untranslated in
git. New languages can be added on demand.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: switch to using LINGUAS file for list of languages
Daniel P. Berrangé [Mon, 18 May 2020 16:19:07 +0000 (17:19 +0100)]
po: switch to using LINGUAS file for list of languages

To enable translation management systems to add new languages they need
to be able to modify the supported language list. The LINGUAS file is a
simple standard format that can be used for the language list, as this
is easier than modifying make variables.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: fix alignment in virObjectEvent to be 8 not 4 bytes
Daniel P. Berrangé [Thu, 4 Jun 2020 10:14:21 +0000 (11:14 +0100)]
conf: fix alignment in virObjectEvent to be 8 not 4 bytes

The previous fix accidentally picked up a debug change that put
alignment back at 4, not 8, bytes as it claimed:

  commit 37ae0426420a2f682cc96ee457a8cae9c0db27d3
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Jun 3 11:18:23 2020 +0100

    conf: force 8 byte alignment for virObjectEvent

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agogitdm: Add missing entries
Andrea Bolognani [Tue, 2 Jun 2020 08:55:01 +0000 (10:55 +0200)]
gitdm: Add missing entries

A few new individuals have contributed to libvirt since the last
time the gitdm configuration was updated.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: force 8 byte alignment for virObjectEvent
Daniel P. Berrangé [Wed, 3 Jun 2020 10:18:23 +0000 (11:18 +0100)]
conf: force 8 byte alignment for virObjectEvent

We need to be able to cast from virObjectEventPtr to one of
its many subclasses. Some of these subclasses have 8 byte
alignment on 32-bit platforms, but virObjectEventPtr only
has 4 byte alignment.

Previously the virObject base class had 8 byte alignment
but this dropped to 4 byte when converted to inherit from
GObject. This introduces cast alignment warnings on 32-bit:

../../src/conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
../../src/conf/domain_event.c:1656:30: error: cast increases required alignment of target type [-Werror=cast-align]
 1656 |             rtcChangeEvent = (virDomainEventRTCChangePtr)event;
      |                              ^
../../src/conf/domain_event.c:1785:34: error: cast increases required alignment of target type [-Werror=cast-align]
 1785 |             balloonChangeEvent = (virDomainEventBalloonChangePtr)event;
      |                                  ^
../../src/conf/domain_event.c:1896:35: error: cast increases required alignment of target type [-Werror=cast-align]
 1896 |             blockThresholdEvent = (virDomainEventBlockThresholdPtr)event;
      |                                   ^
../../src/conf/domain_event.c: In function 'virDomainQemuMonitorEventDispatchFunc':
../../src/conf/domain_event.c:1974:24: error: cast increases required alignment of target type [-Werror=cast-align]
 1974 |     qemuMonitorEvent = (virDomainQemuMonitorEventPtr)event;
      |                        ^
../../src/conf/domain_event.c: In function 'virDomainQemuMonitorEventFilter':
../../src/conf/domain_event.c:2179:20: error: cast increases required alignment of target type [-Werror=cast-align]
 2179 |     monitorEvent = (virDomainQemuMonitorEventPtr) event;
      |                    ^

Forcing 8-byte alignment on virObjectEventPtr removes the
alignment increase during casts to subclasses.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemucapabilitiestest: Bump qemu-5.1 capabilities for x86_64
Peter Krempa [Wed, 20 May 2020 09:13:34 +0000 (11:13 +0200)]
qemucapabilitiestest: Bump qemu-5.1 capabilities for x86_64

QEMU added the machine types for the 5.1 release so let's update them.

Other notable changes are 'cpu-throttle-tailslow' migration property,
'zlib' compression for qcow2 images and absrtact socket support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoUse more of VIR_XPATH_NODE_AUTORESTORE
Michal Privoznik [Tue, 2 Jun 2020 20:06:41 +0000 (22:06 +0200)]
Use more of VIR_XPATH_NODE_AUTORESTORE

This is convenience macro, use it more. This commit was generated
using the following spatch:

  @@
  symbol node;
  identifier old;
  identifier ctxt;
  type xmlNodePtr;
  @@
  - xmlNodePtr old;
  + VIR_XPATH_NODE_AUTORESTORE(ctxt);
    ...
  - old = ctxt->node;
    ... when != old
  - ctxt->node = old;

  @@
  symbol node;
  identifier old;
  identifier ctxt;
  type xmlNodePtr;
  @@
  - xmlNodePtr old = ctxt->node;
  + VIR_XPATH_NODE_AUTORESTORE(ctxt);
    ... when != old
  - ctxt->node = old;

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirxml: Don't overwrite ctxt->node
Michal Privoznik [Wed, 3 Jun 2020 05:10:24 +0000 (07:10 +0200)]
virxml: Don't overwrite ctxt->node

This reverts b897973f2e0

Even though it may have been the case in the past, relative
XPaths don't overwrite the ctxt->node. Thus, there's no need to
save it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agolibxl: Normalize MAC address in device conf when hotplugging a netdev
Jim Fehlig [Wed, 27 May 2020 23:29:33 +0000 (17:29 -0600)]
libxl: Normalize MAC address in device conf when hotplugging a netdev

Similar to commits 55ce6564634 and 6c17606b7cc in the qemu driver, make
separate copies of persistent and live device config and normalize the MAC
address between the two. This avoids having different MAC address for the
persistent and live config, ensuring the device has the same address when
the persistent config takes affect after a VM restart.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoautogen.sh: Restore --no-git (avoid git submodule update)
Ian Jackson [Tue, 2 Jun 2020 15:47:45 +0000 (16:47 +0100)]
autogen.sh: Restore --no-git (avoid git submodule update)

Prior to 2621d48f005a "gnulib: delete all gnulib integration",
one could pass ./autogen.sh --no-git to prevent the libvirt build
system from running git submodule update.

This feature is needed by systems like the Xen Project CI which want
to explicitly control the revisions of every tree.  These will
typically arrange to initialise the submodules check out the right
version of everything, and then expect the build system not to mess
with it any more.

Despite to the old documentation comments referring only to gnulib,
the --no-git feature is required not only because of gnulib but also
because of the other submodule, src/keycodemapdb.

(And in any case, even if it were no longer required because all the
submodules were removed, it ought ideally to have been retained as a
no-op for compaibility reasons.)

So restore the --no-git feature.

Because of the way the argument parsing of autogen.sh works, it is
easiest to recognise this option only if it comes first.  This works
for the Xen Project CI, which has always passed this option first.

If something else is using this option (and hasn't introduced a
different workaround in the meantime), not in the first position,
then perhaps a more sophisticated approach will be needed.  But I
think this will do for now.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agonews: Point to GitLab for full git log
Andrea Bolognani [Tue, 2 Jun 2020 11:38:37 +0000 (13:38 +0200)]
news: Point to GitLab for full git log

The primary git repository is the one on GitLab these days.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: Fix dot_rst_html_in definition
Andrea Bolognani [Tue, 2 Jun 2020 11:59:30 +0000 (13:59 +0200)]
docs: Fix dot_rst_html_in definition

As the name clearly implies, it's supposed to list the .html.in
files that are generated from .rst files, but it mistakenly lists
the corresponding .html files instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agotools: libvirt-guests: correctly check shutdown value
Ján Tomko [Wed, 3 Jun 2020 11:53:13 +0000 (13:53 +0200)]
tools: libvirt-guests: correctly check shutdown value

The variable cleanup introduced a typo.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 08071ec0f113bb1fe8dcc263cb6bf87529e8b76b
Reported-by: Bronek Kozicki
Closes: https://gitlab.com/libvirt/libvirt/-/issues/27
4 years agodocs: point to GitLab as the primary git hosting
Ján Tomko [Wed, 3 Jun 2020 10:42:34 +0000 (12:42 +0200)]
docs: point to GitLab as the primary git hosting

We still point to git repositories hosted on libvirt.org in various
places. Replace the links to their gitlab.com equivalents.

Note that GitLab is trying to be smart here and
  https://gitlab.com/libvirt/libvirt
redirects to
  https://gitlab.com/libvirt/libvirt.git
when doing a 'git clone' and vice-versa when visiting from the
browser, so I only kept the .git suffix in places that explicitly
mentioned 'git clone'.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: virshcmdref: change repo URL to GitLab
Ján Tomko [Wed, 3 Jun 2020 10:40:09 +0000 (12:40 +0200)]
docs: virshcmdref: change repo URL to GitLab

Also note that it's archived, because it's definitely
not maintained anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: csharp: remove outdated comment
Ján Tomko [Wed, 3 Jun 2020 10:37:55 +0000 (12:37 +0200)]
docs: csharp: remove outdated comment

We've had no tarballs for almost 10 years.

Give up and delete the commented out links to them.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosrc: make virObject inherit from GObject
Daniel P. Berrangé [Tue, 19 May 2020 15:15:51 +0000 (16:15 +0100)]
src: make virObject inherit from GObject

To avoid bugs with mixing of g_object_(ref|unref) vs
virObject(Ref|Unref), we want every virObject to be
a GObject.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosrc: don't use VIR_FREE on an object allocation
Daniel P. Berrangé [Tue, 19 May 2020 14:55:55 +0000 (15:55 +0100)]
src: don't use VIR_FREE on an object allocation

Memory allocated using g_object_new must never be released using
VIR_FREE/g_free because g_object_new uses a special allocation
strategy internally.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosrc: don't include ref count in debug messages / probes
Daniel P. Berrangé [Tue, 19 May 2020 14:55:01 +0000 (15:55 +0100)]
src: don't include ref count in debug messages / probes

The ref count will be private to the GObject base class
and we must not peek at it, even for debugging messages.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotest: allocate numa cells separately from driver
Daniel P. Berrangé [Tue, 19 May 2020 14:51:49 +0000 (15:51 +0100)]
test: allocate numa cells separately from driver

GObject has an arbitrary limit on the object struct size of 0xffff
bytes. It is expected that any large fields be separately allocated.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosrc: make virObjectUnref return void
Daniel P. Berrangé [Fri, 15 May 2020 15:36:00 +0000 (16:36 +0100)]
src: make virObjectUnref return void

To prepare for a conversion to GObject, we need virObjectUnref
to have the same API design as g_object_unref, which means it
needs to be void.

A few places do actually care about the return value though,
and in these cases a thread local flag is used to determine
if the dispose method was invoked.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: stop checking virObjectUnref return value
Daniel P. Berrangé [Fri, 15 May 2020 15:33:43 +0000 (16:33 +0100)]
qemu: stop checking virObjectUnref return value

Some, but not all, of the monitor event handlers check
the virObjectUnref return value to see if the domain
was disposed.

It should not be possible for this to happen, since
the function already holds a lock on the domain and
has only just acquired an extra reference on the
domain a few lines earlier.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agolxc: replace VIR_ALLOC/REALLOC with g_new0/renew
Daniel P. Berrangé [Tue, 12 May 2020 17:31:16 +0000 (18:31 +0100)]
lxc: replace VIR_ALLOC/REALLOC with g_new0/renew

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agolxc: replace VIR_FREE with g_autofree / g_free
Daniel P. Berrangé [Tue, 12 May 2020 16:53:07 +0000 (17:53 +0100)]
lxc: replace VIR_FREE with g_autofree / g_free

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Skip pre-creation of NVMe disks
Michal Privoznik [Tue, 26 May 2020 14:26:25 +0000 (16:26 +0200)]
qemu: Skip pre-creation of NVMe disks

Upon migration with disks, libvirt determines if each disk exists
on the destination and tries to pre-create missing ones. Well,
NVMe disks can't be pre-created, but they can be checked for
presence.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: use multiple header levels in virtiofs doc
Daniel P. Berrangé [Mon, 1 Jun 2020 11:45:39 +0000 (12:45 +0100)]
docs: use multiple header levels in virtiofs doc

The heading overline should only be used for the overall document title,
any subsequent headings should be underline only.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agomaint: Post-release version bump to 6.5.0
Andrea Bolognani [Tue, 2 Jun 2020 09:20:16 +0000 (11:20 +0200)]
maint: Post-release version bump to 6.5.0

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agonews: Update for libvirt 6.4.0
Andrea Bolognani [Mon, 1 Jun 2020 18:43:26 +0000 (20:43 +0200)]
news: Update for libvirt 6.4.0

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoRelease of libvirt 6.4.0
Daniel Veillard [Tue, 2 Jun 2020 08:31:53 +0000 (10:31 +0200)]
Release of libvirt 6.4.0

* docs/news.xml: update for release date

Signed-off-by: Daniel Veillard <veillard@redhat.com>