[libvirt] [PATCH 2/4] lib: Grab write lock when modifying list of domains

Ján Tomko jtomko at redhat.com
Fri Sep 6 15:38:23 UTC 2019


On Fri, Sep 06, 2019 at 04:25:17PM +0200, Michal Privoznik wrote:
>In some places where virDomainObjListForEach() is called the
>passed callback calls virDomainObjListRemoveLocked(). Well, this
>is unsafe, because the former only grabs a read lock but the
>latter modifies the list.
>I've identified the following unsafe calls:
>
>- qemuProcessReconnectAll()
>- libxlReconnectDomains()
>
>The rest seem to be safe.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/bhyve/bhyve_driver.c    |  2 +-
> src/bhyve/bhyve_process.c   |  2 +-
> src/conf/virdomainobjlist.c | 12 ++++++++++--
> src/conf/virdomainobjlist.h |  1 +
> src/libxl/libxl_driver.c    | 11 +++++++----
> src/lxc/lxc_process.c       |  4 ++--
> src/qemu/qemu_process.c     |  3 ++-
> src/vmware/vmware_driver.c  |  2 +-
> 8 files changed, 25 insertions(+), 12 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190906/b688824b/attachment-0001.sig>


More information about the libvir-list mailing list