[libvirt] [RFC PATCH 00/12] Add block write threshold event

Peter Krempa posted 12 patches 156 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1487877253.git.pkrempa@redhat.com
daemon/remote.c                                    |  43 +++++++++
examples/object-events/event-test.c                |  19 ++++
include/libvirt/libvirt-domain.h                   |  36 +++++++
src/conf/domain_event.c                            |  97 +++++++++++++++++++
src/conf/domain_event.h                            |  15 +++
src/driver-hypervisor.h                            |   8 ++
src/libvirt-domain.c                               |  51 ++++++++++
src/libvirt_private.syms                           |   4 +
src/libvirt_public.syms                            |   1 +
src/qemu/qemu_capabilities.c                       |   2 +
src/qemu/qemu_capabilities.h                       |   1 +
src/qemu/qemu_domain.c                             | 103 ++++++++++++++++++++
src/qemu/qemu_domain.h                             |  14 +++
src/qemu/qemu_driver.c                             |  64 +++++++++++++
src/qemu/qemu_monitor.c                            |  42 ++++++++-
src/qemu/qemu_monitor.h                            |  19 ++++
src/qemu/qemu_monitor_json.c                       |  65 ++++++++++++-
src/qemu/qemu_monitor_json.h                       |   6 ++
src/qemu/qemu_process.c                            |  41 ++++++++
src/remote/remote_driver.c                         |  34 +++++++
src/remote/remote_protocol.x                       |  33 ++++++-
src/remote_protocol-structs                        |  16 ++++
src/util/virstoragefile.c                          | 105 ++++++++++++++++++---
src/util/virstoragefile.h                          |  14 +++
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml   |   1 +
.../caps_2.6.0-gicv2.aarch64.xml                   |   1 +
.../caps_2.6.0-gicv3.aarch64.xml                   |   1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml  |   1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml   |   1 +
tools/virsh-domain.c                               |  84 +++++++++++++++++
tools/virsh.pod                                    |   8 ++
37 files changed, 922 insertions(+), 14 deletions(-)

[libvirt] [RFC PATCH 00/12] Add block write threshold event

Posted by Peter Krempa 156 weeks ago
Since I'm a procrastinator and I wanted to do this after full node-name support
is added I'm kind of late for this release here. Since oVirt is asking for this
feature for a very long time I would like to deliver it ASAP though.

This series adds a event which is fired once a guest writes beyond a configured
offset in the backing file. The threshold offset is configurable via a new API.

This series is in RFC state since I did not manage to polish few details mostly
connected to node names:

- currently only the top level image can be selected
- some blockjobs may clear the remembered node names and thus break this
  ( re-detection of the backing chain needs to be connected with node name
    detection )
- the node name detection code is VERY crude
- I'm not sure how well it plays with qcow images, since I select only the top
  level node (qcow protocol) rather than the file backing it
- the documentation probably sucks since I did not proof-read

Any feedback is welcome.

Peter Krempa (12):
  util: storage: Split out useful bits of virStorageFileParseChainIndex
  util: storage: Add preliminary storage for node names into
    virStorageSource
  lib: Introduce event for tracking disk backing file write threshold
  qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event
  qemu: domain: Add helper to lookup disk by node name
  qemu: domain: Add helper to generate indexed backing store names
  qemu: process: Wire up firing of the
    VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event
  lib: Add API for setting the threshold size for
    VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
  virsh: Implement 'blockthreshold' command to call
    virDomainSetBlockThreshold
  qemu: domain: Add helper to look up disk soruce by the backing store
    string
  qemu: implement qemuDomainSetBlockThreshold
  qemu: WIP: lookup nodenames

 daemon/remote.c                                    |  43 +++++++++
 examples/object-events/event-test.c                |  19 ++++
 include/libvirt/libvirt-domain.h                   |  36 +++++++
 src/conf/domain_event.c                            |  97 +++++++++++++++++++
 src/conf/domain_event.h                            |  15 +++
 src/driver-hypervisor.h                            |   8 ++
 src/libvirt-domain.c                               |  51 ++++++++++
 src/libvirt_private.syms                           |   4 +
 src/libvirt_public.syms                            |   1 +
 src/qemu/qemu_capabilities.c                       |   2 +
 src/qemu/qemu_capabilities.h                       |   1 +
 src/qemu/qemu_domain.c                             | 103 ++++++++++++++++++++
 src/qemu/qemu_domain.h                             |  14 +++
 src/qemu/qemu_driver.c                             |  64 +++++++++++++
 src/qemu/qemu_monitor.c                            |  42 ++++++++-
 src/qemu/qemu_monitor.h                            |  19 ++++
 src/qemu/qemu_monitor_json.c                       |  65 ++++++++++++-
 src/qemu/qemu_monitor_json.h                       |   6 ++
 src/qemu/qemu_process.c                            |  41 ++++++++
 src/remote/remote_driver.c                         |  34 +++++++
 src/remote/remote_protocol.x                       |  33 ++++++-
 src/remote_protocol-structs                        |  16 ++++
 src/util/virstoragefile.c                          | 105 ++++++++++++++++++---
 src/util/virstoragefile.h                          |  14 +++
 tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml   |   1 +
 .../caps_2.6.0-gicv2.aarch64.xml                   |   1 +
 .../caps_2.6.0-gicv3.aarch64.xml                   |   1 +
 tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml  |   1 +
 tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   1 +
 tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   1 +
 tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml   |   1 +
 tools/virsh-domain.c                               |  84 +++++++++++++++++
 tools/virsh.pod                                    |   8 ++
 37 files changed, 922 insertions(+), 14 deletions(-)

-- 
2.11.1

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

Re: [libvirt] [RFC PATCH 00/12] Add block write threshold event

Posted by Eric Blake 156 weeks ago
On 02/23/2017 01:21 PM, Peter Krempa wrote:
> Since I'm a procrastinator and I wanted to do this after full node-name support
> is added I'm kind of late for this release here. Since oVirt is asking for this
> feature for a very long time I would like to deliver it ASAP though.

Thanks for picking up on this. I tried once a long time ago:
https://www.redhat.com/archives/libvir-list/2015-June/msg01111.html

and got stalled on node name weirdness, so it never went in.

> 
> This series adds a event which is fired once a guest writes beyond a configured
> offset in the backing file. The threshold offset is configurable via a new API.
> 
> This series is in RFC state since I did not manage to polish few details mostly
> connected to node names:
> 
> - currently only the top level image can be selected
> - some blockjobs may clear the remembered node names and thus break this
>   ( re-detection of the backing chain needs to be connected with node name
>     detection )
> - the node name detection code is VERY crude

Indeed, that's where I got stalled, but I think you may already be
further along than my attempt. (It may also be that the QMP side from
qemu is easier to use now than when I first tried)

> - I'm not sure how well it plays with qcow images, since I select only the top
>   level node (qcow protocol) rather than the file backing it

That may be a deal-breaker - my recollection is that you HAVE to use the
node-name of the file backing the qcow2 to get the useful threshold, and
not the node-name of the qcow2 protocol.

> - the documentation probably sucks since I did not proof-read
> 
> Any feedback is welcome.
> 
> Peter Krempa (12):
>   util: storage: Split out useful bits of virStorageFileParseChainIndex
>   util: storage: Add preliminary storage for node names into
>     virStorageSource
>   lib: Introduce event for tracking disk backing file write threshold
>   qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event
>   qemu: domain: Add helper to lookup disk by node name
>   qemu: domain: Add helper to generate indexed backing store names
>   qemu: process: Wire up firing of the
>     VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event
>   lib: Add API for setting the threshold size for
>     VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
>   virsh: Implement 'blockthreshold' command to call
>     virDomainSetBlockThreshold
>   qemu: domain: Add helper to look up disk soruce by the backing store
>     string
>   qemu: implement qemuDomainSetBlockThreshold
>   qemu: WIP: lookup nodenames

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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

Re: [libvirt] [RFC PATCH 00/12] Add block write threshold event

Posted by Peter Krempa 156 weeks ago
On Thu, Feb 23, 2017 at 13:50:03 -0600, Eric Blake wrote:
> On 02/23/2017 01:21 PM, Peter Krempa wrote:
> > Since I'm a procrastinator and I wanted to do this after full node-name support
> > is added I'm kind of late for this release here. Since oVirt is asking for this
> > feature for a very long time I would like to deliver it ASAP though.
> 
> Thanks for picking up on this. I tried once a long time ago:
> https://www.redhat.com/archives/libvir-list/2015-June/msg01111.html
> 
> and got stalled on node name weirdness, so it never went in.
> 
> > 
> > This series adds a event which is fired once a guest writes beyond a configured
> > offset in the backing file. The threshold offset is configurable via a new API.
> > 
> > This series is in RFC state since I did not manage to polish few details mostly
> > connected to node names:
> > 
> > - currently only the top level image can be selected
> > - some blockjobs may clear the remembered node names and thus break this
> >   ( re-detection of the backing chain needs to be connected with node name
> >     detection )
> > - the node name detection code is VERY crude
> 
> Indeed, that's where I got stalled, but I think you may already be
> further along than my attempt. (It may also be that the QMP side from
> qemu is easier to use now than when I first tried)
> 
> > - I'm not sure how well it plays with qcow images, since I select only the top
> >   level node (qcow protocol) rather than the file backing it
> 
> That may be a deal-breaker - my recollection is that you HAVE to use the
> node-name of the file backing the qcow2 to get the useful threshold, and

Yes, that's what I expect as well.

> not the node-name of the qcow2 protocol.

For -blockdev support we will need full node-name detection anyways.
I plan to keep two node-names per virStorageSource, one that describes
the format layer and one that describes the protocol/backing layer. The
last patch is just a very dirty hack to see that the rest was wired up
properly.

> 
> > - the documentation probably sucks since I did not proof-read
> > 
> > Any feedback is welcome.
> > 
> > Peter Krempa (12):
> >   util: storage: Split out useful bits of virStorageFileParseChainIndex
> >   util: storage: Add preliminary storage for node names into
> >     virStorageSource
> >   lib: Introduce event for tracking disk backing file write threshold
> >   qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event
> >   qemu: domain: Add helper to lookup disk by node name
> >   qemu: domain: Add helper to generate indexed backing store names
> >   qemu: process: Wire up firing of the
> >     VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event
> >   lib: Add API for setting the threshold size for
> >     VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
> >   virsh: Implement 'blockthreshold' command to call
> >     virDomainSetBlockThreshold
> >   qemu: domain: Add helper to look up disk soruce by the backing store
> >     string
> >   qemu: implement qemuDomainSetBlockThreshold
> >   qemu: WIP: lookup nodenames
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 




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

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