[PATCH] virnetdev: Use VIR_WITH_MUTEX_LOCK_GUARD in virNetDevGenerateName()

Pavel Hrdina phrdina at redhat.com
Thu Mar 17 08:32:03 UTC 2022

On Thu, Mar 17, 2022 at 09:23:40AM +0100, Michal Privoznik wrote:
> The virNetDevGenerateName() function uses a global array of
> virNetDevGenName structs to find next unused name for network
> device. This obviously needs some locking and in fact each member
> of the array has its own lock. However, these members are not
> virObjects, they are just plain structs, therefore
> VIR_WITH_MUTEX_LOCK_GUARD() must be used instead of
> VIR_WITH_OBJECT_LOCK_GUARD() to lock individual mutexes.
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/util/virnetdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220317/0ee242af/attachment.sig>

More information about the libvir-list mailing list