]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agotest_driver: Fix testDomainSetMemoryFlags' behaviour on config change
Erik Skultety [Thu, 25 Jul 2019 07:29:36 +0000 (09:29 +0200)]
test_driver: Fix testDomainSetMemoryFlags' behaviour on config change

When commit 6ac402c456a added the API whenever VIR_DOMAIN_MEM_MAXIMUM
was passed the code always checked whether the domain was active and
therefore failed with an error even though only a config change was
requested. Fix the issue by replacing virDomainObjGetOneDef with
virDomainObjGetOneDefState which tells us what definition we're
performing the change on.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoutil: cgroup: Add missing parameter maxthreads to virCgroupNewMachine
Erik Skultety [Thu, 25 Jul 2019 07:51:50 +0000 (09:51 +0200)]
util: cgroup: Add missing parameter maxthreads to virCgroupNewMachine

Commit d5572f62e32 forgot to add maxthreads to the non-Linux definition
of the function, thus breaking the MinGW build.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agosnapshot: Documentation and comment improvements
Eric Blake [Fri, 12 Jul 2019 20:43:01 +0000 (15:43 -0500)]
snapshot: Documentation and comment improvements

Changes noticed while copying to similar aspects of checkpoints.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosnapshot: Saner error message for duplicate create
Eric Blake [Wed, 24 Jul 2019 05:03:24 +0000 (00:03 -0500)]
snapshot: Saner error message for duplicate create

Any message that is easy to trigger (as evidenced by the testsuite
update) should not use 'internal error' as its category.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosnapshot: Don't leak moment obj list metaroot to callers
Eric Blake [Wed, 24 Jul 2019 03:26:05 +0000 (22:26 -0500)]
snapshot: Don't leak moment obj list metaroot to callers

virDomainSnapshotFindByName(list, NULL) should return NULL, rather
than the internal-use-only metaroot.  Most existing callers pass in a
non-NULL name; the few external callers that don't are immediately
calling virDomainMomentSetParent (which indeed needs the metaroot
rather than NULL if the parent name is NULL); but as the leaky
abstraction is ugly, it is worth instead making
virDomainMomentSetParent static and adding a new function for
resolving the parent link of a brand new moment within its list.  The
existing external uses of virDomainMomentSetParent always succeed
(either the new moment has parent_name of NULL to become a new root,
or has parent_name set to a strdup of the previous current moment);
hence, our new function does not need a return value (but it still has
a VIR_WARN in case future uses break our assumptions about failure
being impossible).

Missed when commit 02c4e24d refactored things to attempt to remove
direct metaroot manipulations out of the qemu and test drivers into
internal-only details, and made more obvious when commit dc8d3dc6
factored it out into a separate file.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Add support for overriding max threads per process limit
Jim Fehlig [Wed, 22 May 2019 23:12:14 +0000 (17:12 -0600)]
qemu: Add support for overriding max threads per process limit

Some VM configurations may result in a large number of threads created by
the associated qemu process which can exceed the system default limit. The
maximum number of threads allowed per process is controlled by the pids
cgroup controller and is set to 16k when creating VMs with systemd's
machined service. The maximum number of threads per process is recorded
in the pids.max file under the machine's pids controller cgroup hierarchy,
e.g.

$cgrp-mnt/pids/machine.slice/machine-qemu\\x2d1\\x2dtest.scope/pids.max

Maximum threads per process is controlled with the TasksMax property of
the systemd scope for the machine. This patch adds an option to qemu.conf
which can be used to override the maximum number of threads allowed per
qemu process. If the value of option is greater than zero, it will be set
in the TasksMax property of the machine's scope after creating the machine.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agotest_driver: testDomainSetMaxMemory should simply forward the call
Ilias Stamatis [Fri, 12 Jul 2019 05:55:35 +0000 (07:55 +0200)]
test_driver: testDomainSetMaxMemory should simply forward the call

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: testDomainSetMemory should forward the call with VIR_DOMAIN_AFFECT_LIVE
Ilias Stamatis [Fri, 12 Jul 2019 05:55:34 +0000 (07:55 +0200)]
test_driver: testDomainSetMemory should forward the call with VIR_DOMAIN_AFFECT_LIVE

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: consider flags in testDomainSetMemoryFlags
Ilias Stamatis [Fri, 12 Jul 2019 05:55:33 +0000 (07:55 +0200)]
test_driver: consider flags in testDomainSetMemoryFlags

Update the current or max memory, on the persistent or live definition
depending on the flags which are currently ignored.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: implement virDomainSetNumaParameters
Ilias Stamatis [Wed, 24 Jul 2019 14:31:34 +0000 (16:31 +0200)]
test_driver: implement virDomainSetNumaParameters

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: implement virConnectSupportsFeature
Ilias Stamatis [Wed, 24 Jul 2019 14:31:33 +0000 (16:31 +0200)]
test_driver: implement virConnectSupportsFeature

Make the test driver only support the VIR_TYPED_PARAM_STRING flag for
now.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: implement virDomainSetInterfaceParameters
Ilias Stamatis [Wed, 24 Jul 2019 14:07:29 +0000 (16:07 +0200)]
test_driver: implement virDomainSetInterfaceParameters

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: implement virDomainInjectNMI
Ilias Stamatis [Thu, 18 Jul 2019 10:29:53 +0000 (12:29 +0200)]
test_driver: implement virDomainInjectNMI

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest_driver: implement virDomainSetMemoryStatsPeriod
Ilias Stamatis [Thu, 11 Jul 2019 11:22:02 +0000 (13:22 +0200)]
test_driver: implement virDomainSetMemoryStatsPeriod

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotests: Avoid possible error in testExecRestart
John Ferlan [Tue, 23 Jul 2019 12:14:50 +0000 (08:14 -0400)]
tests: Avoid possible error in testExecRestart

If the dup2 fails, then we aren't going to get the correct result.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoutil: Avoid possible error in virCommandMassClose
John Ferlan [Tue, 23 Jul 2019 12:12:48 +0000 (08:12 -0400)]
util: Avoid possible error in virCommandMassClose

Avoid the chance that sysconf(_SC_OPEN_MAX) returns -1 and thus
would cause virBitmapNew would attempt to allocate a very large
bitmap.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
5 years agotest: Return early in testQueryJobs
John Ferlan [Tue, 23 Jul 2019 12:09:19 +0000 (08:09 -0400)]
test: Return early in testQueryJobs

Avoid the chance that qemuMonitorTestNewSimple could return NULL

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: Remove unnecessary check in qemuMonitorJSONGetJobInfoOne
John Ferlan [Tue, 23 Jul 2019 12:03:21 +0000 (08:03 -0400)]
qemu: Remove unnecessary check in qemuMonitorJSONGetJobInfoOne

It's already dereffed in the initialization and shouldn't be NULL
unless virJSONValueArraySize after a virJSONValueObjectGetArray
could return a NULL data entry.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
5 years agovirsh migrate: Properly check for --parallel-connections
Jiri Denemark [Fri, 19 Jul 2019 13:46:33 +0000 (15:46 +0200)]
virsh migrate: Properly check for --parallel-connections

Ever since --parallel-connections option for virsh migrate was
introduced we did not properly check the return value of
vshCommandOptInt. We would set VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
parameter even if vshCommandOptInt returned 0 (which means
--parallel-connections was not specified) when another int option which
was checked earlier was specified with a nonzero value.

Specifically, running virsh migrate with either
--auto-converge-increment, --auto-converge-initial, --comp-mt-dthreads,
--comp-mt-threads, or --comp-mt-level would set
VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS parameter and if --parallel
option was not used, libvirt would complain

    error: invalid argument: Turn parallel migration on to tune it

even though --parallel-connections option was not used at all.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: driver: Add debug message when we conjure block job data object
Peter Krempa [Thu, 18 Jul 2019 16:17:50 +0000 (18:17 +0200)]
qemu: driver: Add debug message when we conjure block job data object

Report in logs when we don't find existing block job data and create it
just to handle the job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: driver: Don't use qemuBlockJobStartupFinalize in processBlockJobEvent
Peter Krempa [Thu, 18 Jul 2019 16:14:44 +0000 (18:14 +0200)]
qemu: driver: Don't use qemuBlockJobStartupFinalize in processBlockJobEvent

While this function does start a block job in case when we'd not be able
to get our internal data for it, the handler sets the job state to
QEMU_BLOCKJOB_STATE_RUNNING anyways, thus qemuBlockJobStartupFinalize
would just unref the job.

Since the other usage of qemuBlockJobStartupFinalize in the other part
of the event handler was a bug replace this one anyways even if it would
not cause problems.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: process: Don't use qemuBlockJobStartupFinalize in qemuProcessHandleBlockJob
Peter Krempa [Thu, 18 Jul 2019 16:08:11 +0000 (18:08 +0200)]
qemu: process: Don't use qemuBlockJobStartupFinalize in qemuProcessHandleBlockJob

The block job event handler qemuProcessHandleBlockJob looks at the block
job data to see whether the job requires synchronous handling. Since the
block job event may arrive before we continue the job handling (if the
job has no data to copy) we could hit the state when the job is still
set as QEMU_BLOCKJOB_STATE_NEW (as we move it to the
QEMU_BLOCKJOB_STATE_RUNNING state only after returning from monitor).

If the event handler uses qemuBlockJobStartupFinalize it would
unregister and free the job. Thankfully this is not a big problem for
legacy blockjobs as we don't need much data for them but since we'd
re-instantiate the job data structure we'd report wrong job type for
active commit as qemu reports it as a regular commit job.

Fix it by not using qemuBlockJobStartupFinalize function in
qemuProcessHandleBlockJob as it is not starting the job anyways.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: change the return value of virCgroupRemove if failed
Wang Yechao [Fri, 19 Jul 2019 03:19:38 +0000 (11:19 +0800)]
util: change the return value of virCgroupRemove if failed

virCgroupRemove return -1 when removing cgroup failed.
But there are retry code to remove cgroup in QemuProcessStop:

 retry:
    if ((ret = qemuRemoveCgroup(vm)) < 0) {
        if (ret == -EBUSY && (retries++ < 5)) {
            usleep(200*1000);
            goto retry;
        }
        VIR_WARN("Failed to remove cgroup for %s",
                 vm->def->name);
    }

The return value of qemuRemoveCgroup will never be equal to "-EBUSY",
so change the return value of virCgroupRemove if failed.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoremote: increase daemon shutdown timer to 2 minutes
Daniel P. Berrangé [Thu, 18 Jul 2019 14:50:42 +0000 (15:50 +0100)]
remote: increase daemon shutdown timer to 2 minutes

Shutting down the daemon after 30 seconds of being idle is a little bit
too aggressive. Especially when using 'virsh' in single-shot mode, as
opposed to interactive shell mode, it would not be unusual to have
more than 30 seconds between commands. This will lead to the daemon
shutting down and starting up between a series of commands.

Increasing the shutdown timer to 2 minutes will make it less likely that
the daemon will shutdown while the user is in the middle of a series of
commands.

Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agologging: pass binary name not logfile name when enabling logging
Daniel P. Berrangé [Fri, 21 Jun 2019 15:40:02 +0000 (16:40 +0100)]
logging: pass binary name not logfile name when enabling logging

Instead of having each caller pass in the desired logfile name, pass in
the binary name instead. The logging code can then just derive a logfile
name by appending ".log".

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonews: mention new bochs display device
Jonathon Jongsma [Thu, 18 Jul 2019 19:16:46 +0000 (14:16 -0500)]
news: mention new bochs display device

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirfile: Add Quobyte as a shared fs
Silvan Kaiser [Tue, 28 May 2019 12:55:29 +0000 (14:55 +0200)]
virfile: Add Quobyte as a shared fs

This adds detection of a Quobyte as a shared file system for live
migration.

Signed-off-by: Silvan Kaiser <silvan@quobyte.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirpci: Drop duplicate function
Michal Privoznik [Thu, 18 Jul 2019 18:28:15 +0000 (20:28 +0200)]
virpci: Drop duplicate function

We have two functions: virPCIDeviceAddressIsEqual() defined only
on Linux and virPCIDeviceAddressEqual() defined everywhere. And
both of them do the same. Drop the former in favour of the
latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu: blockjob: Adjust ATTRIBUTE_NONNULL statements for qemuBlockJobDiskNew
Peter Krempa [Fri, 19 Jul 2019 06:47:39 +0000 (08:47 +0200)]
qemu: blockjob: Adjust ATTRIBUTE_NONNULL statements for qemuBlockJobDiskNew

Commit 5ff46aaa7f added a new parameter but neglected to fix the NONNULL
declarations.

Reported-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 years agoutil: Fix broken MinGW builds caused by commit 9bc01ad8
Erik Skultety [Fri, 19 Jul 2019 06:10:12 +0000 (08:10 +0200)]
util: Fix broken MinGW builds caused by commit 9bc01ad8

virPCIGetSysfsFile is conditionally compiled only on Linux platforms.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu: hotplug: Transfer ownership of backing chain to block job on disk unplug
Peter Krempa [Mon, 25 Mar 2019 15:30:28 +0000 (16:30 +0100)]
qemu: hotplug: Transfer ownership of backing chain to block job on disk unplug

When removing the disk fronted while any block job is still active we
need to transfer the ownership of the backing chain to the job itself as
the job still holds the reference to the chain members and thus attempts
to remove them would fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Unplug inherited storage chains when concluding blockjob
Peter Krempa [Fri, 29 Mar 2019 07:47:38 +0000 (08:47 +0100)]
qemu: blockjob: Unplug inherited storage chains when concluding blockjob

In cases when the disk frontend was unplugged while a blockjob was
running the blockjob inherits the backing chain. When the blockjob is
then terminated we need to unplug the chain as it will not be used any
more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Detect managed persistent reservations in block job orphan chains
Peter Krempa [Thu, 21 Mar 2019 12:54:20 +0000 (13:54 +0100)]
qemu: Detect managed persistent reservations in block job orphan chains

The PR manager is a property of the format layer in qemu so we need to
be able to track it also in the chains of orphaned block jobs.

Add a helper for qemu to look also into the blockjob state.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Track orphaned backing chains in blockjob status XML
Peter Krempa [Tue, 19 Mar 2019 06:54:12 +0000 (07:54 +0100)]
qemu: blockjob: Track orphaned backing chains in blockjob status XML

When the guest unplugs the disk frontend libvirt is responsible for
deleting the backend. Since a blockjob may still have a reference to the
backing chain when it is running we'll have to store the metadata for
the unplugged disk for future reference.

This patch adds 'chain' and 'mirrorChain' fields to 'qemuBlockJobData'
to keep them around with the job along with status XML machinery and
tests. Later patches will then add code to change the ownership of the
chain when unplugging the disk backend.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: export virDomainDiskBackingStoreFormat
Peter Krempa [Thu, 21 Mar 2019 09:29:53 +0000 (10:29 +0100)]
conf: export virDomainDiskBackingStoreFormat

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: export virDomainDiskBackingStoreParse
Peter Krempa [Thu, 21 Mar 2019 09:16:36 +0000 (10:16 +0100)]
conf: export virDomainDiskBackingStoreParse

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: process: Refresh -blockdev based blockjobs on reconnect to qemu
Peter Krempa [Tue, 11 Dec 2018 17:13:35 +0000 (18:13 +0100)]
qemu: process: Refresh -blockdev based blockjobs on reconnect to qemu

Refresh the state of the jobs and process any events that might have
happened while libvirt was not running.

The job state processing requires some care to figure out if a job
needs to be bumped.

For any invalid job try doing our best to cancel it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Add modern block job event handler
Peter Krempa [Fri, 7 Dec 2018 09:21:22 +0000 (10:21 +0100)]
qemu: blockjob: Add modern block job event handler

Add the infrastructure to handle block job events in the -blockdev era.

Some complexity is required as qemu does not bother to notify whether
the job was concluded successfully or failed. Thus it's necessary to
re-query the monitor.

To minimize the possibility of stuck jobs save the state into the XML
prior to handling everything so that the reconnect code can potentially
continue with the cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Add handler for job state change event
Peter Krempa [Wed, 5 Dec 2018 09:40:45 +0000 (10:40 +0100)]
qemu: Add handler for job state change event

Add support for handling the event either synchronously or
asynchronously using the event thread.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Add helper to convert monitor job status to internal state
Peter Krempa [Mon, 10 Dec 2018 15:56:53 +0000 (16:56 +0100)]
qemu: blockjob: Add helper to convert monitor job status to internal state

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: process: Don't trigger BLOCK_JOB* events with -blockdev
Peter Krempa [Wed, 5 Sep 2018 14:16:17 +0000 (16:16 +0200)]
qemu: process: Don't trigger BLOCK_JOB* events with -blockdev

With blockdev we'll need to use the JOB_STATUS_CHANGE so gate the old
events by the blockdev capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Add 'concluded' state for a block job
Peter Krempa [Fri, 7 Dec 2018 16:40:30 +0000 (17:40 +0100)]
qemu: blockjob: Add 'concluded' state for a block job

This new state is entered when qemu finished the job but libvirt does
not know whether it was successful or not.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemustatusxml2xml: Add test case for block job tracking
Peter Krempa [Fri, 30 Nov 2018 16:40:40 +0000 (17:40 +0100)]
tests: qemustatusxml2xml: Add test case for block job tracking

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: driver: Remove unnecessary saving of status XML
Peter Krempa [Wed, 15 May 2019 09:07:53 +0000 (11:07 +0200)]
qemu: driver: Remove unnecessary saving of status XML

Now that the blockjob handling code deals with the status XML we don't
need to save it explicitly when starting blockjobs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Save status XML when modifying job state
Peter Krempa [Wed, 15 May 2019 08:58:42 +0000 (10:58 +0200)]
qemu: blockjob: Save status XML when modifying job state

Now that block job data is stored in the status XML portion we need to
make sure that everything which changes the state also saves the status
XML. The job registering function is used while parsing the status XML
so in that case we need to skip the XML saving.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Store blockjob data in the status XML
Peter Krempa [Fri, 30 Nov 2018 09:36:22 +0000 (10:36 +0100)]
qemu: domain: Store blockjob data in the status XML

We need to store the block job state in the status XML so that we can
properly recover any data when reconnecting after startup and also in
the end to be able to do any transition of the backing chain that
happened while libvirt was not connected to the monitor.

First step is to note the name, type, state and corresponding disk into
the status XML.

We also need to make sure that a broken blockjob does not make libvirt
lose the VM, thus many of the errors just mark the job as invalid.
Later on we'll cancel all invalid jobs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Add flag for invalid block job data
Peter Krempa [Fri, 5 Jul 2019 07:02:21 +0000 (09:02 +0200)]
qemu: blockjob: Add flag for invalid block job data

The job data saved in the XML may be partially invalid e.g. if something
is missing. To prevent losing a domain with such a job add a flag to the
job data so that job APIs can ignore such a job and we can just cancel
it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Export functions for allocating and registering job data
Peter Krempa [Mon, 1 Jul 2019 15:36:38 +0000 (17:36 +0200)]
qemu: blockjob: Export functions for allocating and registering job data

When parsing the status XML we need to register all existing jobs.
Export the functions so that they are usable in other modules.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Add string convertors for blockjob type and state enums
Peter Krempa [Fri, 30 Nov 2018 15:55:08 +0000 (16:55 +0100)]
qemu: blockjob: Add string convertors for blockjob type and state enums

Later on we'll format these values into the status XML so the from/to
string functions will come handy. The implementation also notes that
these will be used in the status XML to avoid somebody changing the
values.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Register new and running blockjobs in the global table
Peter Krempa [Thu, 29 Nov 2018 16:35:52 +0000 (17:35 +0100)]
qemu: blockjob: Register new and running blockjobs in the global table

Add the job structure to the table when instantiating a new job and
remove it when it terminates/fails.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Add global table of blockjobs
Peter Krempa [Thu, 29 Nov 2018 11:50:09 +0000 (12:50 +0100)]
qemu: domain: Add global table of blockjobs

Block jobs currently belong to disks only so we can look up the block
job data for them in the corresponding disks. This won't be the case
when using blockdev as certain jobs don't even correspond to a disk and
most of them can run on a part of the backing chain.

Add a global table of blockjobs which can be used to look up the data
for the blockjobs when the job events need to be processed.

The table is a hash table organized by job name and has a reference to
the job. New and running jobs will later be added to this table.
Reference counting will allow to reap job state for synchronous callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Update new job state earlier in qemuBlockJobEventProcessLegacy
Peter Krempa [Wed, 17 Jul 2019 14:00:32 +0000 (16:00 +0200)]
qemu: blockjob: Update new job state earlier in qemuBlockJobEventProcessLegacy

The legacy job handler does not look at the old job state so we can
update it earlier.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Save config only in qemuBlockJobEventProcessLegacyCompleted
Peter Krempa [Wed, 17 Jul 2019 13:39:57 +0000 (15:39 +0200)]
qemu: blockjob: Save config only in qemuBlockJobEventProcessLegacyCompleted

There's no need to do it if the job is not completed. The new helper
allows to do this with much less hassle in the correct place.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Separate and unify block job (un)registration
Peter Krempa [Thu, 27 Jun 2019 15:54:24 +0000 (17:54 +0200)]
qemu: blockjob: Separate and unify block job (un)registration

Rename and move qemuBlockJobTerminate to qemuBlockJobUnregister and
separate bits from qemuBlockJobDiskNew which register the job with the
disk. This creates an unified interface for other APIs to use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Use VIR_AUTOUNREF in qemuBlockJobDataNew
Peter Krempa [Wed, 26 Jun 2019 12:50:25 +0000 (14:50 +0200)]
qemu: blockjob: Use VIR_AUTOUNREF in qemuBlockJobDataNew

Simplify error paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Add helper for saving config XML
Peter Krempa [Thu, 4 Jul 2019 16:51:36 +0000 (18:51 +0200)]
qemu: domain: Add helper for saving config XML

Similarly to qemuDomainSaveStatus add a helper to save the config XML
named qemuDomainSaveConfig.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Repurpose and export helper for saving domain status XML
Peter Krempa [Thu, 27 Jun 2019 13:40:39 +0000 (15:40 +0200)]
qemu: domain: Repurpose and export helper for saving domain status XML

Rename qemuDomainObjSaveJob and create a wrapper for it which does not
require 'driver' to be passed and export it so that other palces can
easily save the status XML without having to invoke virDomainSaveStatus
which has unpleasing parameters.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemublock: Add testing of 'blockdev-create' generators
Peter Krempa [Tue, 4 Sep 2018 11:40:01 +0000 (13:40 +0200)]
tests: qemublock: Add testing of 'blockdev-create' generators

Test the output against the schema and also against what we expect.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: snapshot: Provide a function to free virDomainSnapshotDiskDefPtr
Peter Krempa [Tue, 4 Sep 2018 14:02:43 +0000 (16:02 +0200)]
conf: snapshot: Provide a function to free virDomainSnapshotDiskDefPtr

Tests will need to parse such a definition so it also needs to be freed.
Provide a function for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: snapshot: Export virDomainSnapshotDiskDefParseXML
Peter Krempa [Tue, 4 Sep 2018 13:42:42 +0000 (15:42 +0200)]
conf: snapshot: Export virDomainSnapshotDiskDefParseXML

Allow using it from the tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Export qemuDomainPrepareStorageSourceBlockdev
Peter Krempa [Tue, 9 Oct 2018 09:06:39 +0000 (11:06 +0200)]
qemu: domain: Export qemuDomainPrepareStorageSourceBlockdev

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Add generator for creating storage with blockdev-create
Peter Krempa [Thu, 6 Sep 2018 07:09:55 +0000 (09:09 +0200)]
qemu: block: Add generator for creating storage with blockdev-create

QEMU allows us to create storage on certain network protocols which
allow image creation through their API. Wire up the generator for using
it with libvirt as well as for local files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Add generator for image format creation properties
Peter Krempa [Mon, 3 Sep 2018 18:08:07 +0000 (20:08 +0200)]
qemu: block: Add generator for image format creation properties

'blockdev-add' allows us to use qemu to format images to our desired
format. This patch implements helpers which convert a
virStorageSourcePtr into JSON objects describing the required
configuration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Use 'auto-read-only' instead of 'read-only' for backing chain
Peter Krempa [Tue, 4 Sep 2018 17:29:10 +0000 (19:29 +0200)]
qemu: block: Use 'auto-read-only' instead of 'read-only' for backing chain

To allow using -blockdev with blockjobs QEMU needs to reopen files in
read-write mode when modifying the backing chain. To achieve this we
need to use 'auto-read-only' for the backing files rather than the
normal 'read-only' property. That way qemu knows that the files need to
be reopened.

Note that the format drivers (e.g. qcow2) are still opened with the
read-only property enabled when being a member of the backing chain
since they are supposed to be immutable unless a block job is started.

QEMU v4.0 (since commit 23dece19da4) allows also dynamic behaviour for
auto-read-only which allows us to use sVirt as we only grant write
permissions to files when doing a blockjob.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Extract formatting of 'driver' attribute from child formatters
Peter Krempa [Tue, 5 Feb 2019 15:03:39 +0000 (16:03 +0100)]
qemu: block: Extract formatting of 'driver' attribute from child formatters

To allow reusing the formatters in the code for creating JSON properties
for 'blockdev-create' we need to create everything except the 'driver'
attribute.

Use the new helper virJSONValueObjectPrependString to put the driver at
the same place so that we don't change any output.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: json: Introduce helper to prepend string into a virJSONValueObject
Peter Krempa [Tue, 5 Feb 2019 17:45:05 +0000 (18:45 +0100)]
util: json: Introduce helper to prepend string into a virJSONValueObject

Libvirt treats the JSON objects as lists thus the values appear in the
order they were added. To avoid too much changes introduce a helper
which allows to prepend a string which will allow to keep certain
outputs in order.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemublock: Add testing of pure disk source specification JSON generator
Peter Krempa [Mon, 17 Dec 2018 15:29:05 +0000 (16:29 +0100)]
tests: qemublock: Add testing of pure disk source specification JSON generator

Add testing of the host specification part so that we can be sure that
no image/host specific data will be present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Allow skipping non-target related data when formating disk JSON
Peter Krempa [Tue, 4 Sep 2018 16:52:02 +0000 (18:52 +0200)]
qemu: block: Allow skipping non-target related data when formating disk JSON

When formatting new qcow2 images we need to provide the backing store
string which should not contain any authentication or irrelevant data.

Add a flag for qemuBlockStorageSourceGetBackendProps which allows to
skip the irrelevant data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add APIs for 'blockdev-create'
Peter Krempa [Mon, 3 Sep 2018 12:45:16 +0000 (14:45 +0200)]
qemu: monitor: Add APIs for 'blockdev-create'

The 'blockdev-create' starts a job which creates a storage volume using
the given protocol or formats an existing (added) volume with one of the
supported storage formats.

This patch adds the monitor interaction bits.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Implement support for 'JOB_STATUS_CHANGE' event
Peter Krempa [Tue, 4 Dec 2018 16:57:23 +0000 (17:57 +0100)]
qemu: monitor: Implement support for 'JOB_STATUS_CHANGE' event

This new event is a superset of the BLOCK_JOB* events and also covers
jobs which don't bind to a VM disk.

In this patch the monitor part is implemented.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add infrastructure for 'query-jobs'
Peter Krempa [Tue, 4 Dec 2018 16:58:38 +0000 (17:58 +0100)]
qemu: monitor: Add infrastructure for 'query-jobs'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add support for 'job-complete' command
Peter Krempa [Thu, 16 Aug 2018 09:48:41 +0000 (11:48 +0200)]
qemu: monitor: Add support for 'job-complete' command

This belongs to the new job management API which can manage also
non-block based jobs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add support for 'job-cancel' command
Peter Krempa [Thu, 16 Aug 2018 09:48:41 +0000 (11:48 +0200)]
qemu: monitor: Add support for 'job-cancel' command

This belongs to the new job management API which can manage also
non-block based jobs. Since we'll need to be able to attempt to cancel
jobs which potentially were not started (during reconnect) the 'quiet'
flag allows to suppress errors reported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add support for 'job-dismiss' command
Peter Krempa [Thu, 16 Aug 2018 09:48:41 +0000 (11:48 +0200)]
qemu: monitor: Add support for 'job-dismiss' command

This belongs to the new job management API for generic jobs.

The dismiss command is meant to remove a concluded job after we were
able to get the final status.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add new fields for 'blockdev-mirror' command
Peter Krempa [Thu, 16 Aug 2018 16:47:20 +0000 (18:47 +0200)]
qemu: monitor: Add new fields for 'blockdev-mirror' command

Allow using the delayed dismiss of the job so that we can reap the state
even if libvirtd was not running when qemu emitted the job completion
event.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add new fields for 'block-commit' command
Peter Krempa [Thu, 16 Aug 2018 16:20:25 +0000 (18:20 +0200)]
qemu: monitor: Add new fields for 'block-commit' command

Allow using the node name to specify the base and top of the 'commit'
operation, allow specifying explicit job name and add support for
delayed dismiss of the job so that we can reap the state even if
libvirtd was not running when qemu emitted the job completion event.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Add new fields for 'block-stream' command
Peter Krempa [Wed, 15 Aug 2018 11:13:53 +0000 (13:13 +0200)]
qemu: monitor: Add new fields for 'block-stream' command

Allow using the node name to specify the base of the 'stream' operation,
allow specifying explicit job name and add support for delayed dismiss
of the job so that we can reap the state even if libvirtd was not
running when qemu emitted the job completion event.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: storage: Don't leak metadata on repeated calls of virStorageFileGetMetadata
Peter Krempa [Thu, 18 Jul 2019 14:32:44 +0000 (16:32 +0200)]
util: storage: Don't leak metadata on repeated calls of virStorageFileGetMetadata

When querying storage metadata after a block job we re-run
virStorageFileGetMetadata on the top level storage file. This means that
the workers (virStorageFileGetMetadataInternal) must not overwrite any
pointers without freeing them.

This was not considered for src->compat and src->features. Fix it and
add a comment mentioning that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: storage: Clean up label use in virStorageFileGetMetadataInternal
Peter Krempa [Thu, 18 Jul 2019 14:30:18 +0000 (16:30 +0200)]
util: storage: Clean up label use in virStorageFileGetMetadataInternal

The function does not do any cleanup, so replace the 'cleanup' label
with return of -1 and the 'done' label with return of 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonetwork: Link with libxml2
Michal Privoznik [Thu, 18 Jul 2019 14:00:54 +0000 (16:00 +0200)]
network: Link with libxml2

Since fb9f6ce6253 we are including a libxml header file in the
network driver but never link with it. This hasn't caused an
immediate problem because in the end the network driver links
with libvirt.la. But apparently, it's causing a build issue on
old Ubuntu.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotools: Introduce virshNodedevCapabilityNameCompleter
Michal Privoznik [Fri, 14 Jun 2019 12:27:13 +0000 (14:27 +0200)]
tools: Introduce virshNodedevCapabilityNameCompleter

This is a very simple completer for completing --cap argument of
nodedev-list command.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirsh-completer: Separate comma list construction into a function
Michal Privoznik [Tue, 18 Jun 2019 10:16:17 +0000 (12:16 +0200)]
virsh-completer: Separate comma list construction into a function

There are more arguments than 'shutdown --mode' that accept a
list of strings separated by commas. 'nodedev-list --cap' is one
of them. To avoid duplicating code, let's separate interesting
bits of virshDomainShutdownModeCompleter() into a function that
can then be reused.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoutil: command: Ignore bitmap errors when enumerating file descriptors to close
Peter Krempa [Thu, 18 Jul 2019 13:05:35 +0000 (15:05 +0200)]
util: command: Ignore bitmap errors when enumerating file descriptors to close

virCommandMassCloseGetFDsLinux fails when running libvird on valgrind
with the following message:

libvirt:  error : internal error: unable to set FD as open: 1024

This is because valgrind opens few file descriptors beyond the limit:

65701125 lr-x------. 1 root root 64 Jul 18 14:48 1024 -> /home/pipo/build/libvirt/gcc/src/.libs/libvirtd
65701126 lrwx------. 1 root root 64 Jul 18 14:48 1025 -> '/tmp/valgrind_proc_3849_cmdline_186612e3 (deleted)'
65701127 lrwx------. 1 root root 64 Jul 18 14:48 1026 -> '/tmp/valgrind_proc_3849_auxv_186612e3 (deleted)'
65701128 lrwx------. 1 root root 64 Jul 18 14:48 1027 -> /dev/pts/11
65701129 lr-x------. 1 root root 64 Jul 18 14:48 1028 -> 'pipe:[65689522]'
65701130 l-wx------. 1 root root 64 Jul 18 14:48 1029 -> 'pipe:[65689522]'
65701131 lr-x------. 1 root root 64 Jul 18 14:48 1030 -> /tmp/vgdb-pipe-from-vgdb-to-3849-by-root-on-angien

Ignore bitmap errors in this case since we'd leak those FD's anyways in
the previous scenario.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolibvirt_private.syms: Properly expose virPCI* function from virpci.h
Michal Privoznik [Thu, 18 Jul 2019 13:18:09 +0000 (15:18 +0200)]
libvirt_private.syms: Properly expose virPCI* function from virpci.h

There are couple of functions that are meant to be exposed but
are missing syms file adjustment.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirSecurityManagerMetadataLock: Skip over duplicate paths
Michal Privoznik [Thu, 18 Jul 2019 08:59:08 +0000 (10:59 +0200)]
virSecurityManagerMetadataLock: Skip over duplicate paths

If there are two paths on the list that are the same we need to
lock it only once. Because when we try to lock it the second time
then open() fails. And if it didn't, locking it the second time
would fail for sure. After all, it is sufficient to lock all
paths just once satisfy the caller.

Reported-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirSecurityManagerMetadataLock: Expand the comment on deadlocks
Michal Privoznik [Thu, 18 Jul 2019 08:58:19 +0000 (10:58 +0200)]
virSecurityManagerMetadataLock: Expand the comment on deadlocks

Document why we need to sort paths while it's still fresh in my
memory.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: Fix uninitalized variable to avoid garbage value.
Julio Faracco [Thu, 18 Jul 2019 03:44:56 +0000 (00:44 -0300)]
util: Fix uninitalized variable to avoid garbage value.

This commit is similar with 596aa144. It fixes an uninitialized
variable to avoid garbage value. This case, it uses time 't' 0 if
an error occurs with virTimeMillisNowRaw.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: formatnetwork: Document xmlns:dnsmasq
Cole Robinson [Sun, 14 Jul 2019 23:46:15 +0000 (19:46 -0400)]
docs: formatnetwork: Document xmlns:dnsmasq

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agonetwork: wire up dnsmasq option xmlns
Cole Robinson [Sun, 14 Jul 2019 22:25:12 +0000 (18:25 -0400)]
network: wire up dnsmasq option xmlns

This maps to XML like:

  <network xmlns:dnsmasq='http://libvirt.org/schemas/network/dnsmasq/1.0'>
    ...
    <dnsmasq:options>
      <dnsmasq:option value="foo=bar"/>
      <dnsmasq:option value="cname=*.foo.example.com,master.example.com"/>
    </dnsmasq:options>
  </network>

To dnsmasq config options

  ...
  foo=bar
  cname=*.foo.example.com,master.example.com

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agoconf: Add virNetworkXMLNamespace
Cole Robinson [Sun, 14 Jul 2019 11:36:44 +0000 (07:36 -0400)]
conf: Add virNetworkXMLNamespace

Just the plumbing, no real implementation yet

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agoconf: Add network xmlopt argument
Cole Robinson [Sun, 14 Jul 2019 16:15:12 +0000 (12:15 -0400)]
conf: Add network xmlopt argument

Pass an xmlopt argument through all the needed network conf
functions, like is done for domain XML handling. No functional
change for now

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agoconf: Add virNetworkXMLOption
Cole Robinson [Sun, 14 Jul 2019 16:11:06 +0000 (12:11 -0400)]
conf: Add virNetworkXMLOption

Just a stub for now that is unused. Add init+cleanup plumbing and
demostrate it in bridge_driver.c

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agodocs: news: add per-release links
Ján Tomko [Wed, 17 Jul 2019 14:29:09 +0000 (16:29 +0200)]
docs: news: add per-release links

Wrap each release headline in an <a> element with the id set
to the release value and page.xsl will take care of the rest.

Reported-by: Kashyap Chamarthy <kchamart@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: news: remove sed sorcery
Ján Tomko [Wed, 17 Jul 2019 14:28:54 +0000 (16:28 +0200)]
docs: news: remove sed sorcery

Set a default namespace in the stylesheet instead.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: formatdomain: tsc is supported by QEMU
Ján Tomko [Wed, 17 Jul 2019 13:01:37 +0000 (15:01 +0200)]
docs: formatdomain: tsc is supported by QEMU

As of commit 7373c4e48 the QEMU driver also supports TSC.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: formatdomain: remove stray nbsp
Ján Tomko [Wed, 17 Jul 2019 13:01:08 +0000 (15:01 +0200)]
docs: formatdomain: remove stray nbsp

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: drvqemu: remove relative time reference
Ján Tomko [Wed, 17 Jul 2019 11:56:13 +0000 (13:56 +0200)]
docs: drvqemu: remove relative time reference

It has not aged well.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: drvqemu: fix a typo
Ján Tomko [Wed, 17 Jul 2019 11:46:37 +0000 (13:46 +0200)]
docs: drvqemu: fix a typo

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: link to networkportformat.html in format.html
Ján Tomko [Tue, 16 Jul 2019 15:39:30 +0000 (17:39 +0200)]
docs: link to networkportformat.html in format.html

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: command: remove qemuDomainFSDriver
Ján Tomko [Tue, 16 Jul 2019 10:31:03 +0000 (12:31 +0200)]
qemu: command: remove qemuDomainFSDriver

Having a translation enum full of empty strings seems excessive.
Now that the validiation is performed in qemuDomainDeviceDefValidateFS,
remove it completely and open-code the two allowed cases.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>