[libvirt PATCH 0/5] Some fixes in domain_conf.c: virDomainFeaturesDefParse
by Tim Wiederhake
Patches 1-4 are minor cleanups, patch 5 is the actual one that I want out
of the way before continuing down my rabbit hole of the week.
Tim Wiederhake (5):
domain_conf: Reduce scope of tmp in virDomainFeaturesDefParse
domain_conf: Reduce scope of gic_version in virDomainFeaturesDefParse
domain_conf: Reduce scope of node in virDomainFeaturesDefParse
domain_conf: Add missing break in switch
domain_conf: Fix check for hyperv stimer
src/conf/domain_conf.c | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
--
2.26.2
3 years, 9 months
[libvirt PATCH] cpu_map: Fix spelling of svme-addr-chk feature
by Jiri Denemark
Commit a208176ca1d9eedf8aa6bf12fde6a7a9579ab549 introduced this feature
with an incorrect "svme-addr-check" spelling.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu_map/sync_qemu_i386.py | 2 +-
src/cpu_map/x86_EPYC-Milan.xml | 2 +-
src/cpu_map/x86_features.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py
index 3febecdfd1..1a98fa70d7 100755
--- a/src/cpu_map/sync_qemu_i386.py
+++ b/src/cpu_map/sync_qemu_i386.py
@@ -142,7 +142,7 @@ def translate_feature(name):
"CPUID_SS": "ss",
"CPUID_SVM_NPT": "npt",
"CPUID_SVM_NRIPSAVE": "nrip-save",
- "CPUID_SVM_SVME_ADDR_CHK": "svme-addr-check",
+ "CPUID_SVM_SVME_ADDR_CHK": "svme-addr-chk",
"CPUID_TSC": "tsc",
"CPUID_VME": "vme",
"CPUID_XSAVE_XGETBV1": "xgetbv1",
diff --git a/src/cpu_map/x86_EPYC-Milan.xml b/src/cpu_map/x86_EPYC-Milan.xml
index 53f0cd6aac..3055e175fa 100644
--- a/src/cpu_map/x86_EPYC-Milan.xml
+++ b/src/cpu_map/x86_EPYC-Milan.xml
@@ -76,7 +76,7 @@
<feature name='sse4a'/>
<feature name='ssse3'/>
<feature name='svm'/>
- <feature name='svme-addr-check'/>
+ <feature name='svme-addr-chk'/>
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='umip'/>
diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
index c43520d08f..e98b84f3ef 100644
--- a/src/cpu_map/x86_features.xml
+++ b/src/cpu_map/x86_features.xml
@@ -554,7 +554,7 @@
<feature name='pfthreshold'>
<cpuid eax_in='0x8000000a' edx='0x00001000'/>
</feature>
- <feature name='svme-addr-check'>
+ <feature name='svme-addr-chk'>
<cpuid eax_in='0x8000000a' edx='0x10000000'/>
</feature>
--
2.30.0
3 years, 9 months
[PATCH 0/4] use g_autofree and g_autoptr
by Kristina Hanicova
This uses g_autofree (if possible) in files: vsh-table,
netdev_bandwidth_conf and g_autoptr instead of
virNetDevBandwidthFree where possible.
Kristina Hanicova (4):
vsh-table: Use g_autofree where possible
netdev_bandwidth_conf: Use g_autofree where possible
Use g_autoptr instead of virNetDevBandwidthFree where possible
netdev_bandwidth_conf: Remove redundant variables/labels
src/conf/netdev_bandwidth_conf.c | 67 ++++++++++++--------------------
src/network/bridge_driver.c | 6 +--
src/qemu/qemu_driver.c | 11 ++----
src/test/test_driver.c | 3 +-
src/util/virnetdevbandwidth.h | 2 +
tests/virnetdevbandwidthtest.c | 3 +-
tools/vsh-table.c | 16 +++-----
7 files changed, 40 insertions(+), 68 deletions(-)
--
2.29.2
3 years, 9 months
[PATCH 0/5] Clean up various places using strcpy()
by Peter Krempa
This series +
https://listman.redhat.com/archives/libvir-list/2021-March/msg00081.html
removes use of strcpy().
Peter Krempa (5):
virIndexToDiskName: Make 'idx' unsigned and remove check
virIndexToDiskName: Use g_string_prepend(_c) to improve readability
remote_daemon_dispatch: Replace g_new + strcpy with g_strdup
virHostCPUGetStatsLinux: Avoid 'strcpy'
commandhelper: printCwd: Print result directly instead of copying it
src/remote/remote_daemon_dispatch.c | 9 +++------
src/util/virhostcpu.c | 6 +++---
src/util/virutil.c | 29 +++++++----------------------
src/util/virutil.h | 2 +-
src/vmx/vmx.c | 12 ------------
src/vz/vz_sdk.c | 3 ---
tests/commandhelper.c | 7 ++++---
7 files changed, 18 insertions(+), 50 deletions(-)
--
2.29.2
3 years, 9 months
[libvirt PATCH 0/3] cgroup cpu.shares cleanup
by Pavel Hrdina
After the conversion to using systemd DBus APIs the behavior of changed
for values outside of valid range. This series fixes the issue by
enforcing the range on libvirt side instead of the previous magic
conversion done by kernel.
Pavel Hrdina (3):
vircgroup: enforce range limit for cpu.shares
cgroup: use virCgroupSetCpuShares instead of virCgroupSetupCpuShares
vircgroup: drop unused function virCgroupSetupCpuShares
docs/formatdomain.rst | 3 ++-
docs/manpages/virsh.rst | 5 +----
src/conf/domain_validate.c | 10 ++++++++++
src/libvirt_private.syms | 1 -
src/lxc/lxc_cgroup.c | 4 +---
src/lxc/lxc_driver.c | 6 ++----
src/qemu/qemu_cgroup.c | 21 +--------------------
src/qemu/qemu_driver.c | 7 +++----
src/util/vircgroup.c | 20 --------------------
src/util/vircgroup.h | 4 ++--
src/util/vircgroupv1.c | 10 ++++++++++
src/util/vircgroupv2.c | 10 ++++++++++
12 files changed, 42 insertions(+), 59 deletions(-)
--
2.29.2
3 years, 9 months
[PATCH] gitpublish: Drop custom prefix
by Andrea Bolognani
Now that all projects except the main library are using GitLab
merge requests, all the patches that end up on libvir-list are by
definition intended for libvirt itself rather than one of the
subprojects, and so it's no longer necessary to include additional
information in the mail subject.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.gitpublish | 1 -
1 file changed, 1 deletion(-)
diff --git a/.gitpublish b/.gitpublish
index d37bf4174a..857f0d552c 100644
--- a/.gitpublish
+++ b/.gitpublish
@@ -1,4 +1,3 @@
[gitpublishprofile "default"]
base = master
to = libvir-list(a)redhat.com
-prefix = libvirt PATCH
--
2.26.2
3 years, 9 months
[PATCH] build: Require glib >= 2.56
by Jim Fehlig
There are a few uses of g_autoslist in the qemu driver and likely
more will come throughout the codebase in the future. g_autoslist
first appeared in glib 2.56, so bump the minimum version.
https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#g-...
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
libvirt.spec.in | 2 +-
meson.build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 29b476184d..8d8b900fbb 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -278,7 +278,7 @@ BuildRequires: systemd-units
%if %{with_libxl}
BuildRequires: xen-devel
%endif
-BuildRequires: glib2-devel >= 2.48
+BuildRequires: glib2-devel >= 2.56
BuildRequires: libxml2-devel
BuildRequires: libxslt
BuildRequires: readline-devel
diff --git a/meson.build b/meson.build
index daa1475c99..c225df42d4 100644
--- a/meson.build
+++ b/meson.build
@@ -1038,7 +1038,7 @@ if fuse_dep.found()
conf.set('WITH_FUSE', 1)
endif
-glib_version = '2.48.0'
+glib_version = '2.56.0'
glib_dep = dependency('glib-2.0', version: '>=' + glib_version)
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_version)
if host_machine.system() == 'windows'
--
2.29.2
3 years, 9 months
Some confusion about lsilogic controller
by xingchaochao
Hello,
I have been confused by such a phenomenon recently.
Libvirt is the master branch , and the VM is centos8.2(kernel is 4.18.0-193.el8.aarch64).
When I hot-plug the scsi disk for a virtual machine without a virtio-scsi controller, libvirt will automatically generate an lsilogic controller for the scsi disk.
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native'/>
<source file='/Images/xcc/tmp.img'/>
<backingStore/>
<target dev='sdt' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
linux-upcHIq:/Images/xcc # virsh list
Id Name State
----------------------
12 g1 running
linux-upcHIq:/Images/xcc # virsh attach-device g1 disk.xml
Device attached successfully
linux-upcHIq:/Images/xcc # virsh dumpxml g1 | grep scsi
<target dev='sdt' bus='scsi'/>
<alias name='scsi0-0-0'/>
<controller type='scsi' index='0' model='lsilogic'>
<alias name='scsi0'/>
But this scsi disk cannot be found through the lsblk command inside the virtual machine.
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 20G 0 disk
├─vda1 252:1 0 600M 0 part /boot/efi
├─vda2 252:2 0 1G 0 part /boot
└─vda3 252:3 0 18.4G 0 part
├─cl-root 253:0 0 16.4G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
After hot unplugging the scsi disk, I performed the hot unplug operation of the lsilogic controller. libvirt shows "Device detached successfully", but in fact, the lsilogic controller is not removed from the live XML and persistent XML. Through "virsh dumpxml vmname" and "virsh edit vmname", I can see <controller type='scsi' index='0' model='lsilogic'> is always there.
linux-upcHIq:/Images/xcc # virsh detach-device g1 disk.xml
Device detached successfully
linux-upcHIq:/Images/xcc # virsh dumpxml g1 | grep scsi
<controller type='scsi' index='0' model='lsilogic'>
<alias name='scsi0'/>
linux-upcHIq:/Images/xcc #
linux-upcHIq:/Images/xcc # cat lsi.xml
<controller type='scsi' index='0' model='lsilogic'>
<alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x05' function='0x0'/>
</controller>
linux-upcHIq:/Images/xcc # virsh detach-device g1 lsi.xml
Device detached successfully
linux-upcHIq:/Images/xcc # virsh dumpxml g1 | grep scsi
<controller type='scsi' index='0' model='lsilogic'>
<alias name='scsi0'/>
I am confused, why libvirt chooses to generate an lsilogic controller for the scsi disk when there is no scsi controller, instead of directly reporting an error and exiting the hot plug operation. After all, the scsi disk based on the lsilogic controller is not perceived inside the virtual machine, and lsilogic will remain in the XML file of the virtual machine.
3 years, 9 months
[PATCH v2 00/31] qapi/qom: QAPIfy --object and object-add
by Kevin Wolf
This series adds a QAPI type for the properties of all user creatable
QOM types and finally makes the --object command line option (in all
binaries) and the object-add monitor commands (in QMP and HMP) use the
new ObjectOptions union.
This change improves things in more than just one way:
1. Documentation for QOM object types has always been lacking. Adding
the schema, we get documentation for every property.
2. It prevents bugs by performing parts of the input validation (e.g.
checking presence of mandatory properties) already in QAPI instead of
relying on separate manual implementations in each class.
3. It provides QAPI introspection for user creatable objects.
4. Non-scalar properties are now supported everywhere because the
command line parsers (including HMP) use the keyval parser now.
If you are in the CC list and didn't expect this series, it's probably
because you're the maintainer of one of the objects for which I'm adding
a QAPI schema description. Please just have a look at the specific patch
for your object and check whether the schema and its documentation make
sense to you. You can ignore all other patches.
In a next step after this series, we can add make use of the QAPI
structs in the implementation of the object and separate their
configuration from the runtime state. Specifically, the plan is to
add a .configure() callback to ObjectClass that allows configuring the
object in one place at creation time and keeping QOM property setters
only for properties that can actually be changed at runtime. Paolo made
an example of what the state could look like after this:
https://wiki.qemu.org/Features/QOM-QAPI_integration
Finally, the intention is to extend the QAPI schema to have separate
'object' entities and generate some of the code that was written
manually in the intermediate state before.
This series is available as a git tag at:
https://repo.or.cz/qemu/kevin.git qapi-object-v2
v2:
- Convert not only object-add, but all external interfaces so that the
schema will always be enforced and mismatch between implementation and
schema can't go unnoticed.
- Rebased, covering properties and object types added since v1 (yes,
things do become outdated rather quickly when you touch all user
creatable objects)
- Changed the "Since:" version number in the schema documentation to
refer to the version when the object was introduced rather than 6.0
where the schema will (hopefully) be added
- Probably some other minor changes
Kevin Wolf (31):
tests: Drop 'props' from object-add calls
qapi/qom: Drop deprecated 'props' from object-add
qapi/qom: Add ObjectOptions for iothread
qapi/qom: Add ObjectOptions for authz-*
qapi/qom: Add ObjectOptions for cryptodev-*
qapi/qom: Add ObjectOptions for dbus-vmstate
qapi/qom: Add ObjectOptions for memory-backend-*
qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'
qapi/qom: Add ObjectOptions for throttle-group
qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'
qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'
qapi/qom: Add ObjectOptions for can-*
qapi/qom: Add ObjectOptions for colo-compare
qapi/qom: Add ObjectOptions for filter-*
qapi/qom: Add ObjectOptions for pr-manager-helper
qapi/qom: Add ObjectOptions for confidential-guest-support
qapi/qom: Add ObjectOptions for input-*
qapi/qom: Add ObjectOptions for x-remote-object
qapi/qom: QAPIfy object-add
qom: Make "object" QemuOptsList optional
qemu-storage-daemon: Implement --object with qmp_object_add()
qom: Remove user_creatable_add_dict()
qom: Factor out user_creatable_process_cmdline()
qemu-io: Use user_creatable_process_cmdline() for --object
qemu-img: Use user_creatable_process_cmdline() for --object
qemu-nbd: Use user_creatable_process_cmdline() for --object
qom: Add user_creatable_add_from_str()
hmp: QAPIfy object_add
qom: Add user_creatable_parse_str()
vl: QAPIfy -object
qom: Drop QemuOpts based interfaces
qapi/authz.json | 62 +++
qapi/block-core.json | 27 ++
qapi/common.json | 52 +++
qapi/crypto.json | 159 +++++++
qapi/machine.json | 22 +-
qapi/net.json | 20 -
qapi/qom.json | 639 ++++++++++++++++++++++++++-
qapi/ui.json | 13 +-
docs/system/deprecated.rst | 25 +-
docs/system/removed-features.rst | 5 +
include/qom/object_interfaces.h | 106 ++---
hw/block/xen-block.c | 16 +-
monitor/hmp-cmds.c | 17 +-
monitor/misc.c | 2 -
qemu-img.c | 239 ++--------
qemu-io.c | 33 +-
qemu-nbd.c | 34 +-
qom/object_interfaces.c | 168 +++----
qom/qom-qmp-cmds.c | 28 +-
softmmu/vl.c | 109 +++--
storage-daemon/qemu-storage-daemon.c | 25 +-
tests/check-qom-proplist.c | 42 +-
tests/qtest/qmp-cmd-test.c | 16 +-
tests/qtest/test-netfilter.c | 54 +--
hmp-commands.hx | 2 +-
storage-daemon/qapi/qapi-schema.json | 1 +
tests/qemu-iotests/087 | 8 +-
tests/qemu-iotests/184 | 18 +-
tests/qemu-iotests/218 | 2 +-
tests/qemu-iotests/235 | 2 +-
tests/qemu-iotests/245 | 4 +-
tests/qemu-iotests/258 | 6 +-
tests/qemu-iotests/258.out | 4 +-
tests/qemu-iotests/295 | 2 +-
tests/qemu-iotests/296 | 2 +-
35 files changed, 1270 insertions(+), 694 deletions(-)
--
2.29.2
3 years, 9 months
[PATCH] build-aux: require GNU grep on FreeBSD
by Roman Bogorodskiy
FreeBSD 13.x and newer ship BSD grep which apparently has some
performance issues causing certain syntax check tests to run longer than
the default 30 seconds timeout used by meson.
However, GNU grep is still available through the textproc/gnugrep port,
so require it on FreeBSD if /usr/bin/grep is a BSD grep to make checks
pass in a reasonable time.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
build-aux/Makefile.in | 1 +
build-aux/meson.build | 24 +++++++++++++++++++-----
build-aux/syntax-check.mk | 1 -
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in
index 0424ff39fc..415a8df305 100644
--- a/build-aux/Makefile.in
+++ b/build-aux/Makefile.in
@@ -5,6 +5,7 @@ top_builddir = @top_builddir@
FLAKE8 = @flake8_path@
RUNUTF8 = @runutf8@
PYTHON = @PYTHON3@
+GREP = @GREP@
# include syntax-check.mk file
include $(top_srcdir)/build-aux/syntax-check.mk
diff --git a/build-aux/meson.build b/build-aux/meson.build
index c506feefd2..c44ed6821c 100644
--- a/build-aux/meson.build
+++ b/build-aux/meson.build
@@ -10,18 +10,32 @@ syntax_check_conf.set('flake8_path', flake8_path)
syntax_check_conf.set('runutf8', ' '.join(runutf8))
syntax_check_conf.set('PYTHON3', python3_prog.path())
-configure_file(
- input: 'Makefile.in',
- output: '@BASENAME@',
- configuration: syntax_check_conf,
-)
+
+grep_prog = find_program('grep')
if host_machine.system() == 'freebsd'
make_prog = find_program('gmake')
+
+ grep_cmd = run_command(grep_prog, '--version')
+ if grep_cmd.stdout().startswith('grep (BSD grep')
+ grep_prog = find_program('/usr/local/bin/grep')
+ grep_cmd = run_command(grep_prog, '--version')
+ if grep_cmd.stdout().startswith('grep (BSD grep')
+ error('GNU grep not found')
+ endif
+ endif
else
make_prog = find_program('make')
endif
+syntax_check_conf.set('GREP', grep_prog.path())
+
+configure_file(
+ input: 'Makefile.in',
+ output: '@BASENAME@',
+ configuration: syntax_check_conf,
+)
+
rc = run_command(
'sed', '-n',
's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p',
diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index e51877648a..6f6603fa6f 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -27,7 +27,6 @@ ME := build-aux/syntax-check.mk
# of the module description. But some packages import this file directly,
# ignoring the module description.
AWK ?= awk
-GREP ?= grep
# FreeBSD (and probably some other OSes too) ships own version of sed(1), not
# compatible with the GNU sed. GNU sed is available as gsed(1), so use this
# instead
--
2.30.0
3 years, 9 months