On 1/5/23 10:29 AM, Peter Krempa wrote:
The function can't fail so there's no point in returning anything.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.c | 7 ++-
src/conf/virdomainobjlist.h | 2 +-
src/qemu/qemu_driver.c | 7 +++
src/test/test_driver.c | 4
On 1/5/23 10:29 AM, Peter Krempa wrote:
Introduce a helper which will return a list of all domain objects inside
of the list without filtering and thus without the need to lock
individual members.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.c | 32
On 1/5/23 10:29 AM, Peter Krempa wrote:
Use the new style which doesn't require re-aligning the argument list
once you change the return type.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.h | 156
1 file changed, 86 insertions(+), 70
On 1/5/23 10:29 AM, Peter Krempa wrote:
Remove extraneous spaces and put comment on a single line.
Signed-off-by: Peter Krempa
---
src/datatypes.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/datatypes.h b/src/datatypes.h
index 0f9730d9e8..f8b1a83407 100644
On 1/5/23 10:29 AM, Peter Krempa wrote:
'virObjectNew' can't return NULL. If we pre-check the arguments we don't
need a cleanup label.
Signed-off-by: Peter Krempa
---
src/datatypes.c | 14 --
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/datatypes.c
Signed-off-by: Jim Fehlig
---
NEWS.rst | 6 ++
1 file changed, 6 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 39f508a6ce..a799ee4529 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -23,6 +23,12 @@ v9.0.0 (unreleased)
With sufficiently new QEMU (v7.1.0) screenshots change format from
On 1/5/23 6:26 AM, Jiang Jiacheng wrote:
Use g_autofree more often and remove unnecessary cleanup/error
labels.
Jiang Jiacheng (9):
conf: use g_autofree and remove unnecessary label
interface: use g_autofree and remove unnecessary label
locking: use g_autofree and remove unnecessary
On 1/5/23 6:26 AM, Jiang Jiacheng wrote:
...
@@ -476,33 +459,29 @@ AppArmorGetSecurityProcessLabel(virSecurityManager *mgr
G_GNUC_UNUSED,
{
int rc = -1;
'rc' variable doesn't seem to be used anymore.
int status;
-char *profile_name = NULL;
+g_autofree char
On 1/5/23 6:26 AM, Jiang Jiacheng wrote:
Signed-off-by: Jiang Jiacheng
...
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 9a95ae6c12..39f36ca29d 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
...
@@ -2571,8 +2564,8 @@
On Thu, Jan 05, 2023 at 10:05:01AM -0700, Jim Fehlig wrote:
> On 1/4/23 02:14, Andrea Bolognani wrote:
> > On Tue, Jan 03, 2023 at 02:22:14PM -0700, Jim Fehlig wrote:
> > > Remove the libvirt-daemon dependency from the various
> > > libvirt-daemon- subpackages, replacing it with a set of the
> > >
On 1/4/23 02:14, Andrea Bolognani wrote:
On Tue, Jan 03, 2023 at 02:22:14PM -0700, Jim Fehlig wrote:
Remove the libvirt-daemon dependency from the various
libvirt-daemon- subpackages, replacing it with a set of the
new sub subpackages providing the same functionality.
Maybe we could add
Signed-off-by: Peter Krempa
---
src/remote/remote_driver.c | 31 +--
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 8310326ad0..7946e9d9bd 100644
--- a/src/remote/remote_driver.c
+++
The test is superseded by 'disk-backing-chains-(no)index' cases.
Signed-off-by: Peter Krempa
---
.../qemuxml2argvdata/disk-backing-chains.xml | 98
.../disk-backing-chains-active.xml| 110 --
.../disk-backing-chains-inactive.xml | 110
Unfortunately unlike with DAC we can't simply ignore labelling for the
FD and it also influences the on-disk state.
Thus we need to relabel the FD and we also store the existing label in
cases when the user will request best-effort label replacement.
Signed-off-by: Peter Krempa
---
Introduce a new argument type for testQemuInfoSetArgs named ARG_FD_GROUP
which allows users to instantiate tests with populated FD passing hash
table.
Signed-off-by: Peter Krempa
---
src/conf/storage_source_conf.c | 1 +
src/conf/storage_source_conf.h | 1 +
tests/qemuxml2argvtest.c |
The API can be used to associate one or more (e.g. a RO and RW fd for a
disk backend image) FDs to a VM. They can be then used per definition.
The primary use case for now is for complex deployment where
libvirtd/virtqemud may be run inside a container and getting the image
into the container is
Commit da9f3cd84b250088 added the seclabel example into the
'disk-backing-chains' case.
Since the only thing that 'disk-backing-chains' tests which
'disk-backing-chains-(no)index' don't test is the seclabel we'll be able
to remove the test case if we add the seclabel example.
Signed-off-by:
Probing stats and block copy to a FD passed image is not yet supported.
Signed-off-by: Peter Krempa
---
src/qemu/qemu_driver.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c086d4069b..4df7f42ae4 100644
---
Require check of return value of the ACL checking functions.
Signed-off-by: Peter Krempa
---
src/rpc/gendispatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 5f2b163ea0..54d55d91e7 100755
---
Signed-off-by: Peter Krempa
---
docs/manpages/virsh.rst | 22 +++
tools/virsh-domain.c| 83 +
2 files changed, 105 insertions(+)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index c85bc8151d..7e57796384 100644
---
Signed-off-by: Peter Krempa
---
src/qemu/qemu_cgroup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 9cf2d6474a..aac7c70054 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -206,7 +206,9 @@
The qemu driver uses connection close callbacks in more places requiring
more changes than other drivers, but luckily the changes are very
straightforward. The migration code was written in a way ensuring that
there's just one callback present so this can be preserved directly.
Signed-off-by:
The helper will be used in various places that need to check that a disk
source struct is using FD passing.
Signed-off-by: Peter Krempa
---
src/conf/storage_source_conf.c | 7 +++
src/conf/storage_source_conf.h | 3 +++
src/libvirt_private.syms | 1 +
3 files changed, 11 insertions(+)
Remove extraneous spaces and put comment on a single line.
Signed-off-by: Peter Krempa
---
src/datatypes.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/datatypes.h b/src/datatypes.h
index 0f9730d9e8..f8b1a83407 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
The new helper qemuDomainStartupCleanup is used to perform cleanup after
a startup of a VM (successful or not). The initial implementation just
calls qemuDomainSecretDestroy, which can be un-exported.
Signed-off-by: Peter Krempa
---
src/qemu/qemu_domain.c | 15 ++-
DAC security label is irrelevant once you have the FD. Disable all
labelling for such images.
Signed-off-by: Peter Krempa
---
src/security/security_dac.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/security/security_dac.c
Assert support for VIR_DOMAIN_DEF_FEATURE_DISK_FD in the qemu driver
now that all code paths are adapted.
Signed-off-by: Peter Krempa
---
src/qemu/qemu_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index
Prepare the internal data for passing FDs instead of having qemu open
the file internally.
Signed-off-by: Peter Krempa
---
src/qemu/qemu_block.c | 31 ---
src/qemu/qemu_command.c | 22 ++
2 files changed, 50 insertions(+), 3 deletions(-)
diff
Enable the qemuxml2xml variant and add output data for qemuxml2argvtest.
Signed-off-by: Peter Krempa
---
.../disk-source-fd.x86_64-latest.args | 49 +
tests/qemuxml2argvtest.c | 4 ++
.../disk-source-fd.x86_64-latest.xml | 52
We assume that FD passed images already exist so all existance checks
are skipped.
For the case that a FD-passed image is passed without a terminated
backing chain (thus forcing us to detect) we attempt to read the header
from the FD.
Signed-off-by: Peter Krempa
---
src/qemu/qemu_domain.c
When starting up a VM with FD-passed images we need to look up the
corresponding named FD set and associate it with the virStorageSource
based on the name.
The association is brought into virStorageSource as security labelling
code will need to access the FD to perform selinux labelling.
Implement passing and storage of FDs for the qemu driver. The FD tuples
are g_object instances stored in a per-domain hash table and are
automatically removed once the connection is closed.
In the future we can consider supporting also to not tie the lifetime of
the passed FDs bound to the
The function currently didn't have a return value. Returning the
'virLockGuard' struct allows the callers to use automatic unlocking of
the mutex.
Signed-off-by: Peter Krempa
---
src/remote/remote_driver.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git
The 'fdgroup' will allow users to specify a passed FD (via the
'virDomainFDAssociate()' API) use instead of opening a path. This is
useful in cases when e.g. the file is not accessible from inside a
container.
Since this uses the same disk type as when we open files via names this
patch also
For FD-passing of disk sources we'll need to keep the FDs around.
Introduce a data type helper based on a g_object so that we get
reference counting.
One instance will (due to security labelling) will need to be part of
the virStorageSource struct thus it's declared in the storage_source_conf
Convert to a switch instead of a bunch of 'if (type == ...).
Signed-off-by: Peter Krempa
---
src/conf/storage_source_conf.c | 23 ++-
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c
index
Now that all code was refactored to use the new version we can remove
the old code.
For now the new close callbacks code has no error messages so
syntax-check forced me to remove the POTFILES entry for
virclosecallbacks.c
Signed-off-by: Peter Krempa
---
po/POTFILES| 1
The new APIs store the list of callbacks for a VM inside the
virDomainObj and also allow registering multiple callbacks for a single
domain and also for multiple connections.
For now this code is dormant until each driver using the old APIs is not
refactored to use the new APIs.
Signed-off-by:
Signed-off-by: Peter Krempa
---
src/qemu/qemu_driver.c| 4 ++--
src/qemu/qemu_migration.c | 8 +++-
src/qemu/qemu_migration.h | 3 +--
src/qemu/qemu_snapshot.c | 4 ++--
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index
Signed-off-by: Peter Krempa
---
src/qemu/qemu_migration.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a561e1bc63..54626bd851 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2733,7
The rewrite is straightforward as bhyve registers only the
'bhyveProcessAutoDestroy' callback which by design doesn't need any
special handling (there's just one caller which can start the VM thus
implicitly there's only one possible registration for that function).
Signed-off-by: Peter Krempa
The rewrite is straightforward as LXC registers only the
'lxcProcessAutoDestroy' callback which by design doesn't need any
special handling (there's just one caller which can start the VM thus
implicitly there's only one possible registration for that function).
Signed-off-by: Peter Krempa
---
The new connect close callbacks for domains will be represented by a
virObject associated with the domain object itself.
To simplify handling the pointer to the close callback data will be done
by an immutable pointer allocated directly when allocating the
corresponding virDomainObj struct.
This
'virObjectNew' can't return NULL. If we pre-check the arguments we don't
need a cleanup label.
Signed-off-by: Peter Krempa
---
src/datatypes.c | 14 --
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/datatypes.c b/src/datatypes.c
index da8a9970f1..c83a74edd5
The function can't fail so there's no point in returning anything.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.c | 7 ++-
src/conf/virdomainobjlist.h | 2 +-
src/qemu/qemu_driver.c | 7 +++
src/test/test_driver.c | 4 +---
src/vz/vz_driver.c | 7 +++
Use the new style which doesn't require re-aligning the argument list
once you change the return type.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.h | 156
1 file changed, 86 insertions(+), 70 deletions(-)
diff --git
Introduce a helper which will return a list of all domain objects inside
of the list without filtering and thus without the need to lock
individual members.
Signed-off-by: Peter Krempa
---
src/conf/virdomainobjlist.c | 32
src/conf/virdomainobjlist.h | 4
First part of the series refactors close callbacks to allow having more
of them and then implements new API virDomainFDAssociate and plumbs it
to pass to qemu.
Peter Krempa (36):
datatypes: Simplify error path of 'virGetDomain'
datatypes: Clean up whitespace in definition of struct
On 1/5/23 16:37, Michal Privoznik wrote:
> In a recent commit I've introduced an umount() call. But the
> function where the call lives is compiled on all OSes, not just
> Linux. But umount() is Linux specific. Other OSes have unmount
> (FreeBSD), or maybe something else. But since namespaces are
In a recent commit I've introduced an umount() call. But the
function where the call lives is compiled on all OSes, not just
Linux. But umount() is Linux specific. Other OSes have unmount
(FreeBSD), or maybe something else. But since namespaces are
Linux specific, we can wrap the call in #ifdef
On Tue, Nov 29, 2022 at 09:54:52PM +0600, Oleg Vasilev wrote:
Previous commit has introduced the config option to enable append=on for
serial files. Here we test it.
Signed-off-by: Oleg Vasilev
---
tests/qemuxml2argvdata/serial-append.xml | 56 +++
On Tue, Nov 29, 2022 at 09:54:51PM +0600, Oleg Vasilev wrote:
Serial log file contains lots of useful information for debugging
configuration problems. It makes sense to preserve the log in between
restarts, so that one can later figure out what was going on.
I don't understand why is the
Signed-off-by: Jiang Jiacheng
---
src/locking/lock_driver_lockd.c | 36 +---
src/locking/lock_driver_sanlock.c | 46 ---
2 files changed, 31 insertions(+), 51 deletions(-)
diff --git a/src/locking/lock_driver_lockd.c
Signed-off-by: Jiang Jiacheng
---
src/util/virconf.c | 27 ---
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/src/util/virconf.c b/src/util/virconf.c
index 8a96805642..c39489973b 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -716,7 +716,7 @@
Signed-off-by: Jiang Jiacheng
---
src/rpc/virnetclientprogram.c | 6 ++
src/rpc/virnettlscontext.c| 16 +---
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c
index 5da118bfd3..b93c495347 100644
---
Signed-off-by: Jiang Jiacheng
---
src/vz/vz_utils.c | 18 --
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
index fcf6d363a9..219d13823b 100644
--- a/src/vz/vz_utils.c
+++ b/src/vz/vz_utils.c
@@ -151,7 +151,8 @@
Signed-off-by: Jiang Jiacheng
---
src/interface/interface_backend_udev.c | 22 --
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/interface/interface_backend_udev.c
b/src/interface/interface_backend_udev.c
index 979f187d87..54b43fb999 100644
---
Signed-off-by: Jiang Jiacheng
---
src/vmware/vmware_conf.c | 28 ++--
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 80a85f4d0f..5703ce717e 100644
--- a/src/vmware/vmware_conf.c
+++
Signed-off-by: Jiang Jiacheng
---
src/remote/remote_driver.c | 22 +++---
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index b0dba9057b..316a11b10f 100644
--- a/src/remote/remote_driver.c
+++
Signed-off-by: Jiang Jiacheng
---
src/security/security_apparmor.c | 91 +++-
1 file changed, 31 insertions(+), 60 deletions(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 36e8ce42b5..64b57f6a22 100644
---
Signed-off-by: Jiang Jiacheng
---
src/conf/domain_audit.c | 121 ++-
src/conf/node_device_util.c | 49 +
src/conf/nwfilter_conf.c | 51 -
src/conf/virnetworkobj.c | 85 --
Use g_autofree more often and remove unnecessary cleanup/error
labels.
Jiang Jiacheng (9):
conf: use g_autofree and remove unnecessary label
interface: use g_autofree and remove unnecessary label
locking: use g_autofree and remove unnecessary label
remote: use g_autofree and remove
On Thu, Dec 22, 2022 at 01:00:06PM +0100, Michal Privoznik wrote:
When calling virConnectGetDomainCapabilities() (exposed as virsh
domcapabilities) users have option to specify whatever sub-set of
{ emulatorbin, arch, machine, virttype } they want. Then we have
a logic (hidden in
Jiang Jiacheng (3):
qemu:fix a misspelling in log
remote: fix misspelling in the documation of
'daemonCreateClientStream'
storage/util: replace unnecessary while loop by if
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_stream.c | 4 ++--
src/storage/storage_util.c
These while loops exit directly due to break after entering.
Use if instead of these while loops.
Signed-off-by: Jiang Jiacheng
---
src/storage/storage_util.c | 4 +---
src/util/virutil.c | 6 +-
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git
Fix a misspelling in the documation of 'daemonCreateClientStream'.
Signed-off-by: Jiang Jiacheng
---
src/remote/remote_daemon_stream.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/remote/remote_daemon_stream.c
b/src/remote/remote_daemon_stream.c
index
Signed-off-by: Jiang Jiacheng
---
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b6adcf2f2a..04d14e7eb0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7590,7 +7590,7 @@
On Fri, Dec 16, 2022 at 04:04:01PM +0100, Michal Privoznik wrote:
Our code relies on mount events propagating into the namespace we
create for a domain. However, there's one caveat. In v8.8.0-rc1~8
I've tried to make us detect differences in mount tables between
the namespace in which libvirtd
Currently, the ThreadContext object is generated whenever we see
.host-nodes attribute for a memory-backend-* object. The idea was
that when the backend is pinned to a specific set of host NUMA
nodes, then the allocation could be happening on CPUs from those
nodes too. But this may not be always
If the daemon crashes or is restarted while the snapshot delete is in
progress we have to handle it gracefully to not leave any block jobs
active.
For now we will simply abort the snapshot delete operation so user can
start it again. We need to refuse deleting external snapshots if there
is
In order to save some CPU cycles we will collect all the necessary data
to delete external snapshot before we even start. They will be later
used by code that deletes the snapshots and updates metadata when
needed.
With external snapshots we need data that libvirt gets from running QEMU
process
Deleting external snapshots will require to run it as async domain job,
the same way as we do for snapshot creation.
For internal snapshots modify the job mask in order to forbid any other
job to be started.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c |
The created job will be needed by external snapshot delete code so
rework qemuBlockCommit to return that pointer.
Signed-off-by: Pavel Hrdina
---
src/qemu/qemu_block.c | 57 ++
src/qemu/qemu_block.h | 2 +-
src/qemu/qemu_driver.c | 5 +++-
3 files
Previously the reparent happened before the actual snapshot deletion.
This change moves the code closer to the rest of the code handling
snapshot metadata when deletion happens. This makes the metadate
deletion happen after the data files are deleted.
Following patch will extract it into separate
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index f5b88daa5d..4f83eb6bf9 100644
--- a/src/qemu/qemu_snapshot.c
+++
When deleting external snapshots the operation may fail at any point
which could lead to situation that some disks finished the block commit
operation but for some disks it failed and the libvirt job ends.
In order to make sure that the qcow2 images are in consistent state
introduce new element
With external snapshots we need to modify the metadata bit more then
what is required for internal snapshots. Mainly the storage source
location changes with every external snapshot.
This means that if we delete non-leaf snapshot we need to update all
children snapshots and modify the disk
Now that deletion of external snapshot is implemented document the
current virDomainSnapshotDelete supported state.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/libvirt-domain-snapshot.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/src/libvirt-domain-snapshot.c
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
NEWS.rst | 6 ++
1 file changed, 6 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 39f508a6ce..fecca64344 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,12 @@ v9.0.0 (unreleased)
* **New features**
+ * QEMU: implement
When deleting snapshot we are starting block-commit job over all disks
that are part of the snapshot.
This operation may fail as it writes data changes to the backing qcow2
image so we need to wait for all the disks to finish the operation and
wait for correct signal from QEMU. If deleting active
This simplifies the code a bit by reusing existing parts that deletes
a single snapshot.
The drawback of this change is that we will now call the re-parent bits
to keep the metadata in sync for every child even though it will get
deleted as well.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 42 ++--
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 3051e5c8df..cb4e0dcb78 100644
---
Deleting internal snapshot when the currently active disk image is
different than where the internal snapshot was taken doesn't work
correctly.
This applies to a running VM only as we are using QMP command and
talking to the QEMU process that is using different disk.
This works correctly when
Prepare the validation function for external snapshot delete support.
There is one exception when deleting `children-only` snapshots. If the
snapshot tree is like this example:
snap1 (external)
|
+- snap2 (internal)
|
+- snap3 (internal)
|
Extract the code deleting external snapshot metadata to separate
function.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 88 +++-
1 file changed, 50 insertions(+), 38 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c
Looks up disk storage source within storage source chain using storage
source object instead of path to make it work with all disk types.
Signed-off-by: Pavel Hrdina
---
src/libvirt_private.syms | 1 +
src/storage_file/storage_source.c | 39 +++
Extract code that deletes children of specific snapshot to separate
function.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 109 ---
1 file changed, 68 insertions(+), 41 deletions(-)
diff --git
Move code around to make it clear what is called when deleting single
snapshot or children snapshots.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 37 -
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git
Extract code that deletes single snapshot to separate function.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_snapshot.c | 47 ++--
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c
Deleting external snapshots will require configuring autofinalize to
synchronize the block jobs for disks withing single snapshot in order to
be able safely abort of one of the jobs fails.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c| 3 ++-
External snapshots will use this to synchronize qemu block jobs.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c | 9 -
src/qemu/qemu_block.h | 1 +
src/qemu/qemu_driver.c | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_domain.c | 95 +--
src/qemu/qemu_domain.h | 9
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_snapshot.c | 96 +++-
src/qemu/qemu_snapshot.h
QEMU emits this signal when the job finished its work and is about to be
finalized. If the job is started with autofinalize disabled the job
waits for user input to finalize the job.
This will be used by snapshot delete code.
Signed-off-by: Pavel Hrdina
---
src/qemu/qemu_backup.c | 1 +
This will allow to use it while having async domain job active which we
will use when deleting external snapshots.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c | 4 +++-
src/qemu/qemu_block.h | 1 +
src/qemu/qemu_driver.c | 2 +-
3 files changed, 5
This will be used by snapshot delete async domain job.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
include/libvirt/libvirt-domain.h | 1 +
tools/virsh-domain.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/include/libvirt/libvirt-domain.h
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c | 32
src/qemu/qemu_block.h | 5 +
2 files changed, 37 insertions(+)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index da3a1e8557..70811aa861 100644
---
Upcoming snapshot deletion code will require that multiple commit jobs
are finished in sync. To allow aborting then if one fails we will need
to use manual finalization of the jobs.
This commit implements the monitor code for `job-finalize`.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
This will allow to use it while having async domain job active which we
will use when deleting external snapshots. At the same time we will need
to have the block job started as synchronous.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c | 23
Move the code for finishing a job in the ready state to qemu_block.c.
Signed-off-by: Pavel Hrdina
Reviewed-by: Peter Krempa
---
src/qemu/qemu_block.c | 121
src/qemu/qemu_block.h | 5 ++
src/qemu/qemu_driver.c | 123
Signed-off-by: Pavel Hrdina
---
src/qemu/qemu_block.c | 177 +
src/qemu/qemu_block.h | 9 +++
src/qemu/qemu_driver.c | 162 +
3 files changed, 187 insertions(+), 161 deletions(-)
diff --git a/src/qemu/qemu_block.c
1 - 100 of 114 matches
Mail list logo