[libvirt] [PATCH] qemu: Fix domain ID numbering race condition

Eric Blake eblake at redhat.com
Thu Nov 8 16:21:27 UTC 2012

On 11/08/2012 06:09 AM, Peter Krempa wrote:
> When the libvirt daemon is restarted it tries to reconnect to running
> qemu domains. Since commit d38897a5d4b1880e1998394b2a37bba979bbdff1 the
> re-connection code runs in separate threads. In the original
> implementation the maximum of domain ID's (that is used as an
> initializer for numbering guests created next) while libvirt was
> reconnecting to the guest.

> +    /* find the maximum ID from active and transient configs to initialize
> +     * the driver with. This is to avoid race between autostart and reconnect
> +     * threads */
> +    virHashForEach(qemu_driver->domains.objs,
> +                   qemuDomainFindMaxID,
> +                   &(qemu_driver->nextvmid));

Spurious parens; this can be just &qemu_driver->nextvmid.


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121108/60d645b7/attachment-0001.sig>

More information about the libvir-list mailing list