[libvirt] [PATCH 00/10] Pass correct qemuCaps to qemuDomainDefPostParse

Jiri Denemark posted 10 patches 4 years, 8 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1565271790.git.jdenemar@redhat.com
src/conf/checkpoint_conf.c              |   9 +-
src/conf/checkpoint_conf.h              |   1 +
src/conf/domain_conf.c                  |  41 ++++---
src/conf/domain_conf.h                  |  13 ++-
src/conf/snapshot_conf.c                |  11 +-
src/conf/snapshot_conf.h                |   2 +
src/esx/esx_driver.c                    |   2 +-
src/libxl/libxl_domain.c                |   2 +-
src/libxl/libxl_driver.c                |  22 ++--
src/libxl/libxl_migration.c             |   2 +-
src/lxc/lxc_driver.c                    |  18 +--
src/lxc/lxc_process.c                   |   2 +-
src/openvz/openvz_driver.c              |   2 +-
src/phyp/phyp_driver.c                  |   2 +-
src/qemu/qemu_domain.c                  |  53 +++++----
src/qemu/qemu_domain.h                  |   5 +
src/qemu/qemu_driver.c                  | 149 +++++++++++++++---------
src/qemu/qemu_migration.c               |  22 ++--
src/qemu/qemu_migration.h               |   1 +
src/qemu/qemu_migration_cookie.c        |  16 ++-
src/qemu/qemu_process.c                 |  13 ++-
src/test/test_driver.c                  |   7 +-
src/vbox/vbox_common.c                  |   8 +-
tests/qemudomaincheckpointxml2xmltest.c |   2 +-
tests/qemudomainsnapshotxml2xmltest.c   |   2 +-
tests/qemuhotplugtest.c                 |   4 +-
26 files changed, 256 insertions(+), 155 deletions(-)
[libvirt] [PATCH 00/10] Pass correct qemuCaps to qemuDomainDefPostParse
Posted by Jiri Denemark 4 years, 8 months ago
Since qemuDomain{Device,}DefPostParse callbacks require qemuCaps, we
need to make sure they get the capabilities stored in the domain's
private data if the domain is running. Passing NULL may cause QEMU
capabilities probing to be triggered in case the cached capabilities are
not valid anymore. When this happens while a running domain object is
locked, QMP event delivered to the domain before QEMU capabilities
probing finishes will deadlock the event loop.

The funny part is that qemuDomainDeviceDefPostParse and
qemuDomainDefPostParse are a callbacks for virDomainDeviceDefPostParse
and virDomainDefPostParse respectively and we need to make sure to
properly set the parseOpaque pointer in all paths which could eventually
go through these general APIs.

If you are interested, you can look at the called-by graph for
virDomainDeviceDefPostParse at
http://people.redhat.com/jdenemar/virDomainDeviceDefPostParse.svg
Only a few of those paths were correct.

Jiri Denemark (10):
  qemu: Pass qemuCaps to qemuDomainDefCopy
  qemu: Pass qemuCaps to qemuDomainDefFormatBufInternal
  qemu: Pass qemuCaps to qemuDomainSaveImageOpen
  qemu: Pass qemuCaps to qemuMigrationAnyPrepareDef
  qemu: Pass correct qemuCaps to virDomainDefParseString
  qemu: Pass qemuCaps to qemuMigrationCookieXMLParse
  qemu: Pass correct qemuCaps to virDomainDefCopy
  qemu: Pass correct qemuCaps to virDomainDefPostParse
  qemu: Pass correct qemuCaps to virDomainDefParseNode
  qemu: Pass correct qemuCaps to virDomainDeviceDefPostParse

 src/conf/checkpoint_conf.c              |   9 +-
 src/conf/checkpoint_conf.h              |   1 +
 src/conf/domain_conf.c                  |  41 ++++---
 src/conf/domain_conf.h                  |  13 ++-
 src/conf/snapshot_conf.c                |  11 +-
 src/conf/snapshot_conf.h                |   2 +
 src/esx/esx_driver.c                    |   2 +-
 src/libxl/libxl_domain.c                |   2 +-
 src/libxl/libxl_driver.c                |  22 ++--
 src/libxl/libxl_migration.c             |   2 +-
 src/lxc/lxc_driver.c                    |  18 +--
 src/lxc/lxc_process.c                   |   2 +-
 src/openvz/openvz_driver.c              |   2 +-
 src/phyp/phyp_driver.c                  |   2 +-
 src/qemu/qemu_domain.c                  |  53 +++++----
 src/qemu/qemu_domain.h                  |   5 +
 src/qemu/qemu_driver.c                  | 149 +++++++++++++++---------
 src/qemu/qemu_migration.c               |  22 ++--
 src/qemu/qemu_migration.h               |   1 +
 src/qemu/qemu_migration_cookie.c        |  16 ++-
 src/qemu/qemu_process.c                 |  13 ++-
 src/test/test_driver.c                  |   7 +-
 src/vbox/vbox_common.c                  |   8 +-
 tests/qemudomaincheckpointxml2xmltest.c |   2 +-
 tests/qemudomainsnapshotxml2xmltest.c   |   2 +-
 tests/qemuhotplugtest.c                 |   4 +-
 26 files changed, 256 insertions(+), 155 deletions(-)

-- 
2.22.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/10] Pass correct qemuCaps to qemuDomainDefPostParse
Posted by Michal Privoznik 4 years, 8 months ago
On 8/8/19 4:26 PM, Jiri Denemark wrote:
> Since qemuDomain{Device,}DefPostParse callbacks require qemuCaps, we
> need to make sure they get the capabilities stored in the domain's
> private data if the domain is running. Passing NULL may cause QEMU
> capabilities probing to be triggered in case the cached capabilities are
> not valid anymore. When this happens while a running domain object is
> locked, QMP event delivered to the domain before QEMU capabilities
> probing finishes will deadlock the event loop.
> 
> The funny part is that qemuDomainDeviceDefPostParse and
> qemuDomainDefPostParse are a callbacks for virDomainDeviceDefPostParse
> and virDomainDefPostParse respectively and we need to make sure to
> properly set the parseOpaque pointer in all paths which could eventually
> go through these general APIs.
> 
> If you are interested, you can look at the called-by graph for
> virDomainDeviceDefPostParse at
> http://people.redhat.com/jdenemar/virDomainDeviceDefPostParse.svg
> Only a few of those paths were correct.
> 
> Jiri Denemark (10):
>    qemu: Pass qemuCaps to qemuDomainDefCopy
>    qemu: Pass qemuCaps to qemuDomainDefFormatBufInternal
>    qemu: Pass qemuCaps to qemuDomainSaveImageOpen
>    qemu: Pass qemuCaps to qemuMigrationAnyPrepareDef
>    qemu: Pass correct qemuCaps to virDomainDefParseString
>    qemu: Pass qemuCaps to qemuMigrationCookieXMLParse
>    qemu: Pass correct qemuCaps to virDomainDefCopy
>    qemu: Pass correct qemuCaps to virDomainDefPostParse
>    qemu: Pass correct qemuCaps to virDomainDefParseNode
>    qemu: Pass correct qemuCaps to virDomainDeviceDefPostParse
> 
>   src/conf/checkpoint_conf.c              |   9 +-
>   src/conf/checkpoint_conf.h              |   1 +
>   src/conf/domain_conf.c                  |  41 ++++---
>   src/conf/domain_conf.h                  |  13 ++-
>   src/conf/snapshot_conf.c                |  11 +-
>   src/conf/snapshot_conf.h                |   2 +
>   src/esx/esx_driver.c                    |   2 +-
>   src/libxl/libxl_domain.c                |   2 +-
>   src/libxl/libxl_driver.c                |  22 ++--
>   src/libxl/libxl_migration.c             |   2 +-
>   src/lxc/lxc_driver.c                    |  18 +--
>   src/lxc/lxc_process.c                   |   2 +-
>   src/openvz/openvz_driver.c              |   2 +-
>   src/phyp/phyp_driver.c                  |   2 +-
>   src/qemu/qemu_domain.c                  |  53 +++++----
>   src/qemu/qemu_domain.h                  |   5 +
>   src/qemu/qemu_driver.c                  | 149 +++++++++++++++---------
>   src/qemu/qemu_migration.c               |  22 ++--
>   src/qemu/qemu_migration.h               |   1 +
>   src/qemu/qemu_migration_cookie.c        |  16 ++-
>   src/qemu/qemu_process.c                 |  13 ++-
>   src/test/test_driver.c                  |   7 +-
>   src/vbox/vbox_common.c                  |   8 +-
>   tests/qemudomaincheckpointxml2xmltest.c |   2 +-
>   tests/qemudomainsnapshotxml2xmltest.c   |   2 +-
>   tests/qemuhotplugtest.c                 |   4 +-
>   26 files changed, 256 insertions(+), 155 deletions(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

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