Commit Graph

42669 Commits

Author SHA1 Message Date
Kristina Hanicova
e27e22585a conf: domcaps: Report <memoryBacking>
We need to report via domcapabilities if specifying shared memory
is supported without hugepages or numa config in order to find
out if domain has suitable setup to make virtiofs work.
The solution is to report source types of memory backing to
determine if memfd is a valid option.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-15 15:13:04 +02:00
Martin Kletzander
439eaf6399 whitespace clean-ups
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-07-15 14:50:48 +02:00
Martin Kletzander
e2bc2dfa1e util: Make one debug message nicer
This was bothering someone as the debug message looked like there was an issue
despite it being just a debug message.  Change it to what is actually happening
and why the name is being skipped.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-07-15 14:50:48 +02:00
Daniel P. Berrangé
b9533b5ecf ci: refresh cirrus variables for FreeBSD python rename
All the python packages got renamed from py37- to py38-

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-15 11:10:52 +01:00
Kristina Hanicova
c39757f700 qemu: Do not erase duplicate devices from namespace if error occurs
If the attempt to attach a device failed, we erased the
unattached device from the namespace. This resulted in erasing an
already attached device in case of a duplicate. We need to check
for existing file in the namespace in order to determine erasing
it in case of a failure.

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

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-15 12:00:24 +02:00
Kristina Hanicova
cbcde4df3b virprocess: Return retval of the child on success, not 0
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-15 12:00:21 +02:00
Kristina Hanicova
b0ef407c65 qemu: Check for existing file in namespace
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-15 12:00:17 +02:00
Jim Fehlig
3c18bc304e Apparmor: Add profile for virtxend
A new apparmor profile initially derived from the libvirtd profile.
All rules were prefixed with the 'audit' qualifier to verify they
are actually used by virtxend. It turns out that several, beyond
the obvious ones, can be dropped in the resulting virtxend profile.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2021-07-14 09:16:58 -06:00
Jim Fehlig
ccba72b414 Apparmor: Add profile for virtqemud
A new apparmor profile derived from the libvirtd profile, with non-QEMU
related rules removed. Adopt the libvirt-qemu abstraction to work with
the new profile.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2021-07-14 09:16:58 -06:00
Olaf Hering
75803d16ee apparmor: Allow /usr/libexec for private xen-tools binaries
This is a followup for commit e906c4d02b
("apparmor: Allow /usr/libexec for libxl-save-helper and pygrub"):

In recent rpm versions --libexecdir changed from /usr/lib64 to
/usr/libexec. A plain rpmbuild %configure in xen.git will install all
files, including the private copies of qemu, into /usr/libexec/xen/bin.
Expand the existing pattern to cover also this libexecdir variant.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-14 17:07:22 +02:00
Michal Privoznik
bfca889122 virfile: Update example use of virDirRead()
We have an example in virDirRead() documentation on how to use
the function. In there, the directory structure is plain DIR, but
that won't work anymore. Switch over to g_autoptr(DIR) which is
what we use now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 17:03:19 +02:00
Michal Privoznik
1678a34f47 syntax-check: s/VIR_DIR_CLOSE/g_autoptr(DIR)/
We have a syntax-check rule that forbids explicit closedir().
However, the error message suggest using VIR_DIR_CLOSE() which
was removed a few releases ago (v6.10.0-rc1~389).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 17:03:12 +02:00
Tim Wiederhake
a856f5d0fc testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
70f32d5ece testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Remove superfluous gotos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
831568e831 testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
091f22223b testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
92c35f5590 testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Remove superfluous gotos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
cca44e5298 testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
5866c30c40 testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
6356ff86ae testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Remove superfluous gotos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
efb30a055c testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
531a1fa84f nwfilterxml2firewalltest.c: testCompareXMLToArgvFiles: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:37:07 +02:00
Tim Wiederhake
00f4820951 qemuMonitorGetMemoryDeviceInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:44 +02:00
Tim Wiederhake
0ed26fca81 qemuMonitorGetMemoryDeviceInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:41 +02:00
Tim Wiederhake
927c9969b9 qemuMonitorGetMemoryDeviceInfo: Assign hash table only on success
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
78f47cba9b iptablesPrivateChainCreate: Remove superfluous gotos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
534874f705 iptablesPrivateChainCreate: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
7bf435fbb0 iptablesPrivateChainCreate: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
1ae0067c77 virNWFilterRuleDefToRuleInst: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
0c209b39c9 virNWFilterCreateVarsFrom: Remove superfluous gotos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
b658836529 virNWFilterCreateVarsFrom: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
a51af3d030 virNWFilterCreateVarsFrom: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 15:36:27 +02:00
Tim Wiederhake
8a7c2f9936 AUTHORS: Add myself to the list of commiters
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-14 14:51:19 +02:00
Stefan Berger
1c78675c6c virt-aa-helper: Allow swtpm to fsync on dir
Allow swtpm (0.7.0 or later) to fsync on the directory where it writes
its state files into so that "the entry in the directory containing the
file has also reached disk" (fsync(2)).

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-14 13:29:59 +02:00
Tim Wiederhake
772a9875f7 qemuMonitorGetChardevInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
c30410a0c4 qemuMonitorGetChardevInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
9a4402dd91 qemuMonitorGetChardevInfo: Remove superfluous variable "ret"
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
317938165c qemuMonitorGetBlockInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
e2f27936f1 qemuMonitorGetBlockInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
b1dd164b1a qemuMonitorGetBlockInfo: Remove superfluous variable "ret"
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
1067bf55fe qemuMonitorGetAllBlockStatsInfo: virHashNew cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
389049a4db qemuMonitorGetAllBlockStatsInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
00a7e385f1 qemuMonitorGetAllBlockStatsInfo: Assign hash table only on success
`virHashNew` cannot return NULL, the check is not needed.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
31678663b3 qemuMonitorGetAllBlockStatsInfo: Remove superfluous variable initialization
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Tim Wiederhake
952bf22ea1 qemuMonitorGetAllBlockStatsInfo: Clean up line break
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-13 14:40:28 +02:00
Han Han
78b1a53df1 virsh: Fix the order of format arguments in doDump
According to definition of virDomainCoreDumpFormat, the "elf" should be
the first argument in VIR_ENUM_*.

Fixes: 84cc4543be

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

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-07-13 11:21:23 +02:00
Jim Fehlig
0d1ccad240 libxl: Add helper function for running the hook script
The same pattern of retrieving the domXML, running the hook script, and
checking for error is used throughout the libxl driver. Remove some
repetitive code by adding a helper function to perform these tasks.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-07-12 14:02:18 -06:00
Jim Fehlig
fc94e5c1c2 libxl: Introduce libxlDomainStartPerform
Introduce libxlDomainStartPerform as part of decomposing libxlDomainStart.
Perform all operations that are part of starting a domain. On error the
domain is destroyed from libxl's perspective, but the operations perfomed
in libxlDomainStartPrepare must be unwound by libxlDomainStart.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-07-12 14:02:18 -06:00
Jim Fehlig
b84d6ed2fe libxl: Introduce libxlDomainStartPrepare
Introduce libxlDomainStartPrepare as part of decomposing libxlDomainStart.
Perform all prepratory operations such as hostdevs, network devs, etc.
Also ensure all such operations are properly unwound on error.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-07-12 14:02:18 -06:00
Jim Fehlig
caed469ef5 libxl: Add a helper function to unprepare network devices
Move network device cleanup code from libxlDomainCleanup to a helper
function for use in a subsequent patch.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-07-12 14:02:18 -06:00