[libvirt] [PATCH 00/12] qemu: Refactor image permission/lock setting (blockdev-add saga)

Peter Krempa posted 12 patches 5 years ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1555598422.git.pkrempa@redhat.com
src/qemu/qemu_domain.c  | 212 +++++++++++++++++++++++++++++++---------
src/qemu/qemu_domain.h  |  23 +++--
src/qemu/qemu_driver.c  |  24 ++---
src/qemu/qemu_hotplug.c |  80 ++-------------
4 files changed, 200 insertions(+), 139 deletions(-)
[libvirt] [PATCH 00/12] qemu: Refactor image permission/lock setting (blockdev-add saga)
Posted by Peter Krempa 5 years ago
With new blockjob handling we'll need to modify permissions for chains
and individual images. The individual image code was universally
accessible but the chain setting code reimplemented it mostly only in
qemu_hotplug.h.

Refactor the handling by moving the code to qemu_domain.c and making it
universal.

Peter Krempa (12):
  qemu: Rename qemuDomainDiskChainElement(Revoke|Prepare)
  qemu: Move and rename qemuHotplugPrepareDiskSourceAccess
  qemu: Split entry points to qemuDomainStorageSourceChainAccessPrepare
  qemu: domain: Rename qemuDomainStorageSourceChainAccessPrepare
  qemu: Convert boolean flags to enum flags in
    qemuDomainStorageSourceAccessModify
  qemu: Allow using qemuDomainStorageSourceAccessModify on singe images
  qemu: Refactor/simplify qemuDomainStorageSourceAccessRevoke
  qemu: Allow forcing read-only mode in
    qemuDomainStorageSourceAccessModify
  qemu: Use bools rather than labels in
    qemuDomainStorageSourceAccessModify
  qemu: Allow skipping the revoke step in
    qemuDomainStorageSourceAccessModify
  qemu: Mark when modifying access to existing source in
    qemuDomainStorageSourceAccessModify
  qemu: Refactor/simplify qemuDomainStorageSourceAccessAllow

 src/qemu/qemu_domain.c  | 212 +++++++++++++++++++++++++++++++---------
 src/qemu/qemu_domain.h  |  23 +++--
 src/qemu/qemu_driver.c  |  24 ++---
 src/qemu/qemu_hotplug.c |  80 ++-------------
 4 files changed, 200 insertions(+), 139 deletions(-)

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/12] qemu: Refactor image permission/lock setting (blockdev-add saga)
Posted by Eric Blake 5 years ago
On 4/18/19 9:42 AM, Peter Krempa wrote:
> With new blockjob handling we'll need to modify permissions for chains
> and individual images. The individual image code was universally
> accessible but the chain setting code reimplemented it mostly only in
> qemu_hotplug.h.
> 
> Refactor the handling by moving the code to qemu_domain.c and making it
> universal.

Oh fun - competes with my work to get incremental backup in. But from
the subject lines alone, it seems reasonable; I can see how hard it is
to rebase my code on top of yours.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/12] qemu: Refactor image permission/lock setting (blockdev-add saga)
Posted by Peter Krempa 5 years ago
On Thu, Apr 18, 2019 at 14:30:04 -0500, Eric Blake wrote:
> On 4/18/19 9:42 AM, Peter Krempa wrote:
> > With new blockjob handling we'll need to modify permissions for chains
> > and individual images. The individual image code was universally
> > accessible but the chain setting code reimplemented it mostly only in
> > qemu_hotplug.h.
> > 
> > Refactor the handling by moving the code to qemu_domain.c and making it
> > universal.
> 
> Oh fun - competes with my work to get incremental backup in. But from
> the subject lines alone, it seems reasonable; I can see how hard it is
> to rebase my code on top of yours.

These are the necessary changes which are needed in:

backup: Wire up qemu full pull backup commands over QMP

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c9f1996b2a..d3307bfc4f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17796,7 +17796,7 @@ qemuDomainBackupDiskCleanup(virQEMUDriverPtr driver, virDomainObjPtr vm,
         ret = -1;
     }
     if (disk->state >= VIR_DOMAIN_BACKUP_DISK_STATE_LABEL)
-        qemuDomainDiskChainElementRevoke(driver, vm, disk->store);
+        qemuDomainStorageSourceAccessRevoke(driver, vm, disk->store);
     if ((!push || !completed) &&
         disk->state >= VIR_DOMAIN_BACKUP_DISK_STATE_CREATED &&
         disk->store->detected && unlink(disk->store->path) < 0) {
@@ -17997,8 +17997,8 @@ qemuDomainBackupBegin(virDomainPtr domain, const char *diskXml,
             }
             disk->state = VIR_DOMAIN_BACKUP_DISK_STATE_CREATED;
         }
-        if (qemuDomainDiskChainElementPrepare(driver, vm, disk->store, false,
-                                              true) < 0)
+        if (qemuDomainStorageSourceAccessAllow(driver, vm, disk->store, false,
+                                               true) < 0)
             goto endmon;
         disk->state = VIR_DOMAIN_BACKUP_DISK_STATE_LABEL;
         if (disk->store->detected) {
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/12] qemu: Refactor image permission/lock setting (blockdev-add saga)
Posted by Peter Krempa 4 years, 11 months ago
On Thu, Apr 18, 2019 at 16:42:55 +0200, Peter Krempa wrote:
> With new blockjob handling we'll need to modify permissions for chains
> and individual images. The individual image code was universally
> accessible but the chain setting code reimplemented it mostly only in
> qemu_hotplug.h.
> 
> Refactor the handling by moving the code to qemu_domain.c and making it
> universal.

Ping?
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list