[PATCH v2 1/2] docs: Fix typo in qemu-nbd -P replacement
by Eric Blake
The suggested replacement for the deprecated 'qemu-nbd -P' referw to
'file.backing.opt' instead of 'file.file.opt'; using the example
verbatim results in:
qemu-nbd: Failed to blk_new_open 'driver=raw,offset=1m,size=100m,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file4': A block device must be specified for "file"
Correct this text, prior to actually finishing the deprecation process.
Fixes: 0ae2d54645eb
Reported-by: Max Reitz <mreitz(a)redhat.com>
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
qemu-deprecated.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 0968d37c745a..358eb6deebdc 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -335,7 +335,7 @@ top of any other existing blockdev. For example, if partition 1 is
can be rewritten as:
-@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file.qcow2}
+@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2}
Alternatively, the @code{nbdkit} project provides a more powerful
partition filter on top of its nbd plugin, which can be used to select
--
2.24.1
4 years, 8 months
[libvirt PATCH v2 00/56] the gnulib saga: the season finale
by Daniel P. Berrangé
This is a followup to
v1: https://www.redhat.com/archives/libvir-list/2020-January/msg00900.html
At the end of this series we have 100% eliminated use of GNULIB
from libvirt.
The first 10 or so patches have been reviewed by Pavel already
but I include them here anyway. Rather than wait for all of
the series to be review, it is probably more productive to
push patches in batches of 10 or so.
Some things to note
- I have build tested this on Travis platforms and manually
via FreeBSD 11/12. This covers make, make syntax-check &
make check
- I've validated that virsh still works with mingw64 builds
on Windows 2008r2.
- I've done basic functional testing on Fedora 31, starting
and stopping VMs & other other simple APIs
The config.h we generate is much much smaller than before as we
eliminated alot of gnulib macros.
The risk here is that we are no longer setting some HAVE_XXX
in config.h that we rely on. To mitigate this I did a diff
of config.h before & after this series to determinw which
HAVE_XXX we no longer set. I then grepped the source to see
if we actually use any of them. This identified a few mistakes
which I fixed in testing this series.
The builds times for libvirt after applying this series have
some significant gains, improving speed of all stages (autogen,
configure & make).
Overall while this was time consuming work (due to massive number
of builds for testing each step), it is surprising just how easy
it was eliminate need for GNULIB. GLib helped a little bit in
this respect, but the biggest factor is simply that a large
number of issues GNULIB fixes only matter for ancient / obsolete
OS platforms.
With libvirt only targetting modern Linux, FreeBSD, macOS & MinGW,
the only really hard stuff where GNULIB was a big help is the
Windows sockets portability.
GNULIB was a pretty valuable approach when there were countless
flavours of UNIX to worry about with poor levels of POSIX API
compatibility. With a typical modern set of platforms, I think
it is better to just use a library like GLib and deal with any
other portability problems explicitly.
Almost certainly someone will appear after next release and
complain that libvirt no longer builds on some platform that
we don't officially support. My expectation is that when this
happens it will be reasonably easy to fix whatever problem
they report. Also at that time we can also consider whether
the platform needs to be added to CI.
Daniel P. Berrangé (56):
tests: stop setting $SHELL env variable
util: add a virArchFromHost() impl for Windows
util: add API for reading password from the console
src: remove usage of strchrnul function
build: generate configmake.h in root directory
util: use getgrouplist() directly instead of mgetgroups
tools: replace wcwidth() with g_unichar_* APIs
src: remove unused sys/utsname.h includes
util: explicitly include windows.h
storage: remove use of stat-time.h headers
src: implement APIs for passing FDs over UNIX sockets
rpc: conditionalize signal handling
src: only import sys/uio.h when journald is built
src: replace mkdir() with g_mkdir()
m4: disable polkit build on Windows
util: conditionalize more of virCommand on WIN32
src: remove all traces of Cygwin support
util: conditionalize virProcess APIs on Windows
src: conditionalize use of net/if.h
configure: add check for sys/ioctl.h
src: conditionalize use of S_ISSOCK macro
configure: request system specific extensions
src: stop using O_DIRECTORY in resctrl
src: ensure O_CLOEXEC is defined on Windows
src: conditionalize use of F_DUPFD_CLOEXEC
src: conditionalize use of O_DIRECT
src: conditionalize use of O_BINARY
src: conditionalize use of chown & stat constants
src: convert all code to use virsocket.h
tests: conditionalize use of SIGPIPE
src: conditionalize EAI_ADDRFAMILY
bootstrap: remove 18 more gnulib modules
src: introduce helper API for creating GSource for socket
rpc: convert RPC client to use GMainLoop instead of poll
tests: convert eventtest to use public event APIs
tests: remove event loop from command test
tests: refactor event test to not run lock step
tools: convert to use g_poll instead of poll
util: import an event loop impl based on GMainContext
util: switch to use the GLib event loop impl
util: delete the poll() based event loop impl
src: conditionalize / remove use of poll.h
util: conditionalize FD stream to exclude WIN32
src: remove sys/wait.h from many files
configure: request 64-bit APIs on 32-bit platforms
examples: remove obsolete workaround for mingw
src: introduce a wrapper for the pipe2() system call
src: convert code to use virPipe APIs
tools: conditionalize use of O_SYNC flag
m4: add check for pthread library
src: assume sys/sysmacros.h always exists on Linux
src: add define of ENOMSG for MinGW
src: optionally include xlocale.h header
src: ensure use of g_printf / g_fprintf functions
src: remove virFilePrintf in favour of g_fprintf
gnulib: delete all gnulib integration
.color_coded.in | 2 -
.gitignore | 9 +-
.gitmodules | 3 -
.gnulib | 1 -
.ycm_extra_conf.py.in | 2 -
Makefile.am | 46 +-
README-hacking | 9 +-
autogen.sh | 219 +----
bootstrap | 1073 -------------------------
bootstrap.conf | 136 ----
build-aux/syntax-check.mk | 132 +--
ci/build.sh | 4 +-
config-post.h | 5 +-
configure.ac | 49 +-
docs/compiling.html.in | 25 -
docs/hacking.html.in | 5 +-
examples/c/domain/domtop.c | 15 -
examples/c/domain/suspend.c | 14 -
gnulib/lib/Makefile.am | 30 -
libvirt.spec.in | 2 -
m4/virt-compile-pie.m4 | 2 +-
m4/virt-compile-warnings.m4 | 18 +-
m4/virt-polkit.m4 | 4 +
m4/virt-pthread.m4 | 26 +-
m4/virt-win-common.m4 | 8 +-
m4/virt-win-cygwin.m4 | 32 -
m4/virt-win-symbols.m4 | 4 +-
m4/virt-win-windres.m4 | 4 +-
m4/virt-xdr.m4 | 9 +-
po/POTFILES.in | 3 +-
src/Makefile.am | 17 +-
src/admin/Makefile.inc.am | 2 -
src/bhyve/Makefile.inc.am | 1 -
src/conf/domain_audit.c | 4 +-
src/conf/network_conf.c | 2 -
src/esx/esx_util.c | 3 +-
src/esx/esx_util.h | 1 -
src/interface/Makefile.inc.am | 1 -
src/internal.h | 30 +
src/libvirt-domain.c | 2 +
src/libvirt.c | 10 +-
src/libvirt_private.syms | 24 +-
src/libxl/Makefile.inc.am | 1 -
src/libxl/libxl_conf.c | 2 -
src/libxl/libxl_migration.c | 6 +-
src/locking/Makefile.inc.am | 9 +-
src/locking/lock_daemon.c | 2 +-
src/logging/Makefile.inc.am | 2 -
src/logging/log_daemon.c | 2 +-
src/logging/log_handler.c | 6 +-
src/lxc/Makefile.inc.am | 2 -
src/lxc/lxc_container.c | 1 -
src/lxc/lxc_controller.c | 8 +-
src/lxc/lxc_driver.c | 8 +-
src/lxc/lxc_process.c | 5 +-
src/network/Makefile.inc.am | 3 +-
src/network/bridge_driver.c | 1 -
src/node_device/Makefile.inc.am | 2 -
src/nwfilter/Makefile.inc.am | 1 -
src/nwfilter/nwfilter_dhcpsnoop.c | 3 -
src/nwfilter/nwfilter_learnipaddr.c | 4 +-
src/openvz/openvz_conf.c | 5 +-
src/openvz/openvz_driver.c | 1 -
src/qemu/Makefile.inc.am | 1 -
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_capabilities.c | 1 -
src/qemu/qemu_conf.c | 4 +-
src/qemu/qemu_domain.c | 4 +-
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_interface.c | 4 +-
src/qemu/qemu_migration.c | 28 +-
src/qemu/qemu_monitor.c | 3 +-
src/qemu/qemu_monitor_json.c | 4 +-
src/qemu/qemu_tpm.c | 5 +-
src/remote/Makefile.inc.am | 1 -
src/remote/qemu_protocol.x | 1 -
src/remote/remote_daemon.c | 3 +-
src/remote/remote_protocol.x | 2 +-
src/rpc/Makefile.inc.am | 3 -
src/rpc/genprotocol.pl | 2 +-
src/rpc/virnetclient.c | 248 +++---
src/rpc/virnetdaemon.c | 44 +-
src/rpc/virnetdaemon.h | 4 +
src/rpc/virnetprotocol.x | 2 +-
src/rpc/virnetsocket.c | 44 +-
src/secret/Makefile.inc.am | 1 -
src/security/Makefile.inc.am | 1 -
src/security/security_dac.c | 4 +
src/security/security_manager.c | 2 +
src/security/security_selinux.c | 16 +-
src/storage/Makefile.inc.am | 16 -
src/storage/storage_backend_iscsi.c | 1 -
src/storage/storage_backend_logical.c | 1 -
src/storage/storage_util.c | 25 +-
src/util/Makefile.inc.am | 6 +-
src/util/iohelper.c | 4 +
src/util/viralloc.h | 3 +-
src/util/virarch.c | 52 +-
src/util/virarptable.c | 1 -
src/util/virbitmap.c | 4 +-
src/util/vircgroup.c | 18 +-
src/util/vircommand.c | 183 +++--
src/util/virdevmapper.c | 4 +-
src/util/virdnsmasq.c | 9 +-
src/util/virevent.c | 21 +-
src/util/vireventglib.c | 455 +++++++++++
src/util/vireventglib.h | 28 +
src/util/vireventglibwatch.c | 248 ++++++
src/util/vireventglibwatch.h | 48 ++
src/util/vireventpoll.c | 772 ------------------
src/util/vireventpoll.h | 126 ---
src/util/virfdstream.c | 131 ++-
src/util/virfile.c | 102 +--
src/util/virfile.h | 3 -
src/util/virgettext.c | 3 +
src/util/virhook.c | 1 -
src/util/virhostcpu.c | 1 -
src/util/virhostmem.c | 1 -
src/util/viriptables.c | 1 -
src/util/virlog.c | 8 +-
src/util/virnetdev.c | 1 -
src/util/virnetdev.h | 4 +-
src/util/virnetdevbridge.c | 8 +-
src/util/virnetdevip.c | 4 +-
src/util/virnetdevmacvlan.c | 3 +-
src/util/virnetdevtap.c | 4 +-
src/util/virnetdevveth.c | 2 -
src/util/virnetdevvportprofile.c | 3 +-
src/util/virnetlink.c | 3 +-
src/util/virpolkit.c | 4 +-
src/util/virprocess.c | 108 ++-
src/util/virresctrl.c | 2 +-
src/util/virsocket.c | 139 +++-
src/util/virsocket.h | 21 +-
src/util/virsocketaddr.c | 2 -
src/util/virsocketaddr.h | 20 +-
src/util/virstring.c | 3 +
src/util/virsysinfo.c | 15 +-
src/util/virsystemd.c | 9 +-
src/util/virutil.c | 146 +++-
src/util/virutil.h | 36 +
src/util/virxdrdefs.h | 12 +-
src/vbox/Makefile.inc.am | 1 -
src/vbox/vbox_MSCOMGlue.c | 6 +-
src/vz/Makefile.inc.am | 1 -
src/vz/vz_driver.c | 1 -
tests/Makefile.am | 26 +-
tests/commanddata/test27.log | 6 +-
tests/commanddata/test3.log | 2 +-
tests/commandhelper.c | 5 +-
tests/commandtest.c | 115 +--
tests/eventtest.c | 219 +++--
tests/fdstreamtest.c | 42 +-
tests/libxlmock.c | 2 +-
tests/nsstest.c | 3 +-
tests/qemusecuritytest.c | 2 +-
tests/shunloadtest.c | 2 +-
tests/ssh.c | 3 +-
tests/testutils.c | 5 +-
tests/testutils.h | 6 -
tests/testutilsqemu.c | 4 +-
tests/virauthconfigtest.c | 2 +
tests/vircgroupmock.c | 8 +-
tests/virkeyfiletest.c | 2 +
tests/virlockspacetest.c | 4 +-
tests/virnetmessagetest.c | 2 +
tests/virnetsockettest.c | 3 +-
tests/virnettlscontexttest.c | 3 +-
tests/virnettlshelpers.c | 1 -
tests/virnettlssessiontest.c | 3 +-
tests/virportallocatormock.c | 5 +-
tests/virstringtest.c | 37 +-
tests/virtestmock.c | 9 +-
tests/virtimetest.c | 2 +
tests/viruritest.c | 2 +
tests/vshtabletest.c | 4 +
tools/Makefile.am | 9 +-
tools/nss/libvirt_nss.c | 7 +-
tools/virsh-domain.c | 72 +-
tools/virsh.c | 6 -
tools/virt-admin.c | 5 -
tools/virt-login-shell.c | 6 +-
tools/vsh-table.c | 2 +-
tools/vsh.c | 31 +-
184 files changed, 2295 insertions(+), 3708 deletions(-)
delete mode 160000 .gnulib
delete mode 100755 bootstrap
delete mode 100644 bootstrap.conf
delete mode 100644 gnulib/lib/Makefile.am
delete mode 100644 m4/virt-win-cygwin.m4
create mode 100644 src/util/vireventglib.c
create mode 100644 src/util/vireventglib.h
create mode 100644 src/util/vireventglibwatch.c
create mode 100644 src/util/vireventglibwatch.h
delete mode 100644 src/util/vireventpoll.c
delete mode 100644 src/util/vireventpoll.h
--
2.24.1
4 years, 8 months
[libvirt] Designing XML for HMAT
by Michal Privoznik
Dear list,
QEMU gained support for configuring HMAT recently (see
v4.2.0-415-g9b12dfa03a
and friends). HMAT stands for Heterogeneous Memory Attribute Table and
defines
various attributes to NUMA. Guest OS/app can read these information and fine
tune optimization. See [1] for more info (esp. links in the transcript).
QEMU defines so called initiator, which is an attribute to a NUMA node
and if
specified points to another node that has the best performance to this node.
For instance:
-machine hmat=on \
-m 2G,slots=2,maxmem=4G \
-object memory-backend-ram,size=1G,id=m0 \
-object memory-backend-ram,size=1G,id=m1 \
-numa node,nodeid=0,memdev=m0 \
-numa node,nodeid=1,memdev=m1,initiator=0 \
-smp 2,sockets=2,maxcpus=2 \
-numa cpu,node-id=0,socket-id=0 \
-numa cpu,node-id=0,socket-id=1
creates a machine with 2 NUMA nodes, node 0 has CPUs and node 1 has
memory only
and it's initiator is node 0 (yes, HMAT allows you to create CPU-less "NUMA"
nodes). The initiator of node 0 is not specified, but since the node has at
least one CPU it is initiator to itself (and has to be per specs).
This could be represented by an attribute to our /domain/cpu/numa/cell
element.
For instance like this:
<domain>
<vcpu>2</vcpu>
<cpu>
<numa>
<cell id='0' cpus='0,1' memory='1' unit='GiB'/>
<cell id='1' memory='1' unit='GiB' initiator='0'/>
</numa>
</cpu>
</domain>
Then, QEMU allows us to control two other important memory attributes:
1) hmat-lb for Latency and Bandwidth
2) hmat-cache for cache attributes
For example:
-machine hmat=on \
-m 2G,slots=2,maxmem=4G \
-object memory-backend-ram,size=1G,id=m0 \
-object memory-backend-ram,size=1G,id=m1 \
-smp 2,sockets=2,maxcpus=2 \
-numa node,nodeid=0,memdev=m0 \
-numa node,nodeid=1,memdev=m1,initiator=0 \
-numa cpu,node-id=0,socket-id=0 \
-numa cpu,node-id=0,socket-id=1 \
-numa
hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5
\
-numa
hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M
\
-numa
hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10
\
-numa
hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M
\
-numa
hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8
\
-numa
hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
This extends previous example by defining some latencies and cache
attributes.
The node 0 has access latency of 5 ns and bandwidth of 200MB/s and node
1 has
access latency of 10ns and bandwidth of only 100MB/s. The memory cache
level 1
on both nodes is 10KB, cache line is 8B long with write-back policy and
direct
associativity (whatever that means).
For better future extensibility I'd express these as separate elements,
rather
than attributes to <cell/> element. For instance like this:
<domain>
<vcpu>2</vcpu>
<cpu>
<numa>
<cell id='0' cpus='0,1' memory='1' unit='GiB'>
<latencies>
<latency type='access' value='5'/>
<bandwidth type='access' unit='MiB' value='200'/>
</latencies>
<caches>
<cache level='1' associativity='direct' policy='write-back'>
<size unit='KiB' value='10'/>
<line unit='B' value='8'/>
</cache>
</caches>
</cell>
<cell id='1' memory='1' unit='GiB' initiator='0'>
<latencies>
<latency type='access' value='10'/>
<bandwidth type='access' unit='MiB' value='100'/>
</latencies>
<caches>
<cache level='1' associativity='direct' policy='write-back'>
<size unit='KiB' value='10'/>
<line unit='B' value='8'/>
</cache>
</caches>
</cell>
</numa>
</cpu>
</domain>
Thing is, the @hierarchy argument accepts: memory (referring to whole
memory),
or first-level|second-level|third-level (referring to side caches for each
domain). I haven't figured out yet, how to express the levels in XML yet.
The @data-type argument accepts access|read|write (this is expressed by
@type
attribute to <latency/> and <bandwidth/> elements). Latency and
bandwidth can
be combined with each type: access-latency, read-latency, write-latency,
access-bandwidth, read-bandwidth, write-bandwidth. And these 6 can then be
combined with aforementioned @hierarchy, producing 24 combinations (if I
read
qemu cmd line specs correctly [2]).
What are your thoughts?
Michal
1: https://bugzilla.redhat.com/show_bug.cgi?id=1786303
2:
https://git.qemu.org/?p=qemu.git;a=blob;f=qemu-options.hx;h=d4b73ef60c1d4...
4 years, 8 months
[libvirt PATCH 00/12] virtio failover / vfio auto-plug-on-migrate
by Laine Stump
https://bugzilla.redhat.com/1693587
'QEMU 4.2.0 and later, combined with a sufficiently recent guest
virtio-net driver, supports setting up a simple network bond device
comprised of one virtio emulated NIC and one hostdev NIC (which must
be an SRIOV VF). The allure of this setup is that the bond will always
favor the hostdev device, providing better performance, until the
guest is migrated - at that time QEMU will automatically unplug the
hostdev NIC and the bond will send all traffic via the virtio NIC
until migration is completed, then QEMU on the destination side will
hotplug a new hostdev NIC and the bond will switch back to using the
hostdev for network traffic. The result is that guests desiring the
extra performance of a hostdev NIC are now migratable without network
downtime (performance is just degraded during migration) and without
requiring a complicated bonding configuration in the guest OS network
config and complicated unplug/replug logic in the management
application on the host - it can instead all be accomplished in
libvirt with the interface <driver> subelement "failover" and
"backupAlias" attributes.
Patches 1-4 are just simple refactoring with no functional change,
5-10 are the new functionality, patch 11 is documentation, and Patch
12 is an RFC for a method to solve a problem that oVirt has when
trying to use this feature - while the virtio guest driver requires
the pair of interfaces to have matching MAC addresses, oVirt requires
every network interface to have a unique MAC. I'm not sure that I like
having this hackishness in libvirt (see the commit log message), but
it does solve oVirt's problem, and also makes direct config with
libvirt XML simpler (since it removes the need to manually specify any
MAC addresses in order to arrive at a working config, which is
something that has always been the case before now). I'll leave it up to the jury to decide whether or not it's acceptable :-)
Laine Stump (12):
conf: refactor hostdev driver subelement format for simpler additions
conf: change virDomainVirtioNet*Format() to return void
conf: rename two static functions
conf: refactor <interface>'s <driver> subelement parse/format
qemu: add capabilities flag for failover feature
conf: add failover attribute to <driver> subelement of <interface>
qemu: add backupAlias attribute to <driver> subelement of hostdev
devices
conf: add backupAlias attribute to <interface> driver subelement
qemu: allow migration with assigned PCI hostdev if backupAlias is set
qemu: add wait-unplug to qemu migration status enum
docs: document virtio failover / QEMU auto-plug of hostdev during
migration
conf/qemu: new <driver> attribute "useBackupMAC"
docs/formatdomain.html.in | 74 +++
docs/news.xml | 27 +
docs/schemas/domaincommon.rng | 15 +
src/conf/domain_conf.c | 559 ++++++++++--------
src/conf/domain_conf.h | 57 +-
src/libxl/libxl_driver.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 +
src/qemu/qemu_domain.c | 21 +-
src/qemu/qemu_hostdev.c | 5 +-
src/qemu/qemu_hostdev.h | 1 +
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 49 +-
src/qemu/qemu_monitor.c | 1 +
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 1 +
src/util/virhostdev.c | 47 +-
src/util/virhostdev.h | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../net-virtio-failover-network.xml | 37 ++
.../qemuxml2argvdata/net-virtio-failover.args | 40 ++
.../qemuxml2argvdata/net-virtio-failover.xml | 50 ++
tests/qemuxml2argvtest.c | 4 +
.../net-virtio-failover-network.xml | 51 ++
.../net-virtio-failover.xml | 66 +++
tests/qemuxml2xmltest.c | 6 +
tests/virhostdevtest.c | 18 +-
29 files changed, 856 insertions(+), 289 deletions(-)
create mode 100644 tests/qemuxml2argvdata/net-virtio-failover-network.xml
create mode 100644 tests/qemuxml2argvdata/net-virtio-failover.args
create mode 100644 tests/qemuxml2argvdata/net-virtio-failover.xml
create mode 100644 tests/qemuxml2xmloutdata/net-virtio-failover-network.xml
create mode 100644 tests/qemuxml2xmloutdata/net-virtio-failover.xml
--
2.24.1
4 years, 8 months
[libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev
by Xu Yandong
In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree
free data structure avoid potential memory leak.
Signed-off-by: Xu Yandong <xuyandong2(a)huawei.com>
---
src/conf/domain_conf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 848c831330..8fb9480827 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16504,7 +16504,8 @@ virDomainDeviceDefParse(const char *xmlStr,
return dev;
error:
- VIR_FREE(dev);
+ virDomainDeviceDefFree(dev);
+ dev = NULL;
goto cleanup;
}
--
2.18.1
4 years, 8 months
[PATCH] docs: domaincaps: Mention VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA
by Peter Krempa
The flag for the virDomainUndefine API is supported even if we report
that <backup supported='no'/>. Mention it in the docs.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/formatdomaincaps.html.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index aa4dece220..66e758501b 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -566,7 +566,10 @@
<p>Reports whether the hypervisor supports the backup, checkpoint, and
related features. (<code>virDomainBackupBegin</code>,
- <code>virDomainCheckpointCreateXML</code> etc).
+ <code>virDomainCheckpointCreateXML</code> etc). The presence of the
+ <code>backup</code> element even if <code>supported='no'</code> implies that
+ the <code>VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA</code> flag for
+ <code>virDomainUndefine</code> is supported.
</p>
<h4><a id="elementsSEV">SEV capabilities</a></h4>
--
2.24.1
4 years, 8 months
[PATCH v3 0/3] Couple of apparmor fixes
by Michal Privoznik
v3 of:
https://www.redhat.com/archives/libvir-list/2020-January/msg01321.html
diff to v2:
- Instead of hard coding libexec path, generate it according to
configure arguments
*** BLURB HERE ***
Michal Prívozník (3):
apparmor: Reflect paths from configure in profiles
apparmor: Allow libvirt to spawn virt-aa-helper and libvirt_lxc
docs: Fix virt-aa-helper location
docs/drvqemu.html.in | 3 +-
src/security/Makefile.inc.am | 29 +++++++++++++++----
...lper => usr.lib.libvirt.virt-aa-helper.in} | 10 +++----
...usr.sbin.libvirtd => usr.sbin.libvirtd.in} | 14 +++++----
4 files changed, 39 insertions(+), 17 deletions(-)
rename src/security/apparmor/{usr.lib.libvirt.virt-aa-helper => usr.lib.libvirt.virt-aa-helper.in} (85%)
rename src/security/apparmor/{usr.sbin.libvirtd => usr.sbin.libvirtd.in} (93%)
--
2.24.1
4 years, 8 months
[PATCH 0/5] Add support for SPAPR vTPM for pSeries VM
by Stefan Berger
QEMU 5.0 will have SPAPR vTPM support. This series of patches
adds support for the XML and command line creation of the
SPAPR vTPM for pSeries VMs along with test cases.
Regards,
Stefan
Stefan Berger (5):
conf: Add support for tpm-spapr to domain XML
qemu: Extend QEMU capabilities with 'tpm-spapr'
qemu: Extend QEMU with tpm-spapr support
tests: Extend ppc64 capabilities data with TPM related XML and
responses
tests: Add test for domain XML with tpm-spapr TPM device model
docs/formatdomain.html.in | 4 +-
docs/schemas/domaincommon.rng | 4 +
src/conf/domain_conf.c | 24 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 15 +-
src/qemu/qemu_domain.c | 8 +-
src/qemu/qemu_domain_address.c | 10 +
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 115 +
.../caps_5.0.0.ppc64.replies | 24695 ++++++++++++++++
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1128 +
.../tpm-emulator-spapr.ppc64-latest.args | 45 +
tests/qemuxml2argvdata/tpm-emulator-spapr.xml | 60 +
tests/qemuxml2argvtest.c | 4 +
15 files changed, 26105 insertions(+), 15 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_5.0.0.ppc64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.ppc64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-spapr.ppc64-latest.args
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-spapr.xml
--
2.17.1
4 years, 8 months
[PATCH] lib: Prohibit parallel connections with tunneled migration
by Jim Fehlig
As discussed on the developer list, parallel migration connections
are not compatible with tunneled migration
https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html
Prohibit the concurrent use of parallel and tunneled migration options.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
I added the check to all migration entry points except virDomainMigrate3,
where the p2p and tunneled options are already prohibitied.
src/libvirt-domain.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 4074397b30..b910ba6b4d 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3546,6 +3546,10 @@ virDomainMigrate(virDomainPtr domain,
VIR_MIGRATE_NON_SHARED_INC,
error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (flags & VIR_MIGRATE_OFFLINE) {
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -3701,6 +3705,10 @@ virDomainMigrate2(virDomainPtr domain,
VIR_MIGRATE_NON_SHARED_INC,
error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (flags & VIR_MIGRATE_OFFLINE) {
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -4087,6 +4095,10 @@ virDomainMigrateToURI(virDomainPtr domain,
virCheckReadOnlyGoto(domain->conn->flags, error);
virCheckNonNullArgGoto(duri, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
@@ -4159,6 +4171,10 @@ virDomainMigrateToURI2(virDomainPtr domain,
virCheckDomainReturn(domain, -1);
virCheckReadOnlyGoto(domain->conn->flags, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
@@ -4232,6 +4248,10 @@ virDomainMigrateToURI3(virDomainPtr domain,
virCheckDomainReturn(domain, -1);
virCheckReadOnlyGoto(domain->conn->flags, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
--
2.24.1
4 years, 8 months
[PATCH 00/19] qemu: backup: Add support for checkpoint deletion and block copy with checkpoints
by Peter Krempa
The first 7 patches are technically v2 of
[libvirt] [RFC PATCH 00/16] qemu: checkpoint: Add support for deleting checkpoints accross snapshots
https://www.redhat.com/archives/libvir-list/2020-January/msg00430.html
as they were not reviewed, but the handling of block copy would conflict
with them I'm reposting them with two simple bugfixes.
The rest of the series implements handling of bitmaps when doing a block
copy.
Peter Krempa (19):
tests: qemublock: Add test for checkpoint deletion bitmap merge
tests: qemublock: Add few more test cases for checkpoint deletion
tests: qemublock: Add synthetic snapshot+checkpoint test data
qemu: checkpoint: Introduce support for deleting checkpoints accross
snapshots
tests: qemublock: Add checkpoint deletion test for deep backing chain
tests: qemublock: Add checkpoint deletion tests for some special cases
qemu: checkpoint: Track and relabel images for bitmap merging
qemu: block: Extract calls of qemuBlockGetNamedNodeData into a helper
function
util: json: Introduce virJSONValueArrayConcat
virJSONValueNewArray: Use g_new0 to allocate and remove NULL checks
from callers
virhash: Make sure that hash key is always copied
virHashAddOrUpdateEntry: Simplify allocation of new entry
qemu: blockjob: Store 'jobflags' with block job data
qemu: blockjob: Store 'flags' for all the block job types
qemu: block: Add validator for bitmap chains accross backing chains
tests: qemublocktest: Add another synthetic test case for broken
bitmaps
qemu: block: Introduce function to calculate bitmap handling for
block-copy
tests: qemublock: Add tests for qemuBlockBitmapsHandleBlockcopy
qemuDomainBlockPivot: Copy bitmaps backing checkpoints for
virDomainBlockCopy
src/conf/domain_addr.c | 5 +-
src/libvirt_private.syms | 1 +
src/locking/lock_daemon.c | 4 +-
src/logging/log_handler.c | 3 +-
src/network/leaseshelper.c | 6 +-
src/qemu/qemu_agent.c | 6 +-
src/qemu/qemu_backup.c | 11 +-
src/qemu/qemu_block.c | 208 ++++-
src/qemu/qemu_block.h | 16 +
src/qemu/qemu_blockjob.c | 16 +-
src/qemu/qemu_blockjob.h | 12 +-
src/qemu/qemu_checkpoint.c | 146 +++-
src/qemu/qemu_checkpoint.h | 6 +-
src/qemu/qemu_domain.c | 7 +
src/qemu/qemu_driver.c | 54 +-
src/qemu/qemu_firmware.c | 12 +-
src/qemu/qemu_migration_params.c | 3 +-
src/qemu/qemu_monitor_json.c | 3 +-
src/rpc/virnetserver.c | 6 +-
src/rpc/virnetserverservice.c | 3 +-
src/util/virhash.c | 13 +-
src/util/virhash.h | 3 +-
src/util/virjson.c | 44 +-
src/util/virjson.h | 2 +
src/util/virlockspace.c | 6 +-
src/util/virmacmap.c | 8 +-
tests/qemublocktest.c | 250 +++++-
.../bitmap/snapshots-synthetic-broken.json | 819 +++++++++++++++++
.../bitmap/snapshots-synthetic-broken.out | 12 +
.../snapshots-synthetic-checkpoint.json | 827 ++++++++++++++++++
.../bitmap/snapshots-synthetic-checkpoint.out | 13 +
.../bitmapblockcopy/basic-deep-out.json | 117 +++
.../bitmapblockcopy/basic-shallow-out.json | 117 +++
.../bitmapblockcopy/snapshots-deep-out.json | 133 +++
.../snapshots-shallow-out.json | 48 +
.../checkpointdelete/basic-current-out.json | 29 +
.../basic-intermediate1-out.json | 22 +
.../basic-intermediate2-out.json | 22 +
.../basic-intermediate3-out.json | 22 +
.../checkpointdelete/basic-noparent-out.json | 9 +
.../snapshots-current-out.json | 29 +
.../snapshots-intermediate1-out.json | 24 +
.../snapshots-intermediate2-out.json | 62 ++
.../snapshots-intermediate3-out.json | 61 ++
.../snapshots-noparent-out.json | 27 +
...hots-synthetic-checkpoint-current-out.json | 29 +
...ynthetic-checkpoint-intermediate1-out.json | 31 +
...ynthetic-checkpoint-intermediate2-out.json | 34 +
...ynthetic-checkpoint-intermediate3-out.json | 61 ++
...ots-synthetic-checkpoint-noparent-out.json | 27 +
tests/qemumonitorjsontest.c | 5 +-
.../qemustatusxml2xmldata/backup-pull-in.xml | 2 +-
.../blockjob-blockdev-in.xml | 8 +-
53 files changed, 3293 insertions(+), 151 deletions(-)
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.out
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json
--
2.24.1
4 years, 8 months