]> git.ipfire.org Git - thirdparty/libvirt.git/commit
viruuid: Rework virUUIDIsValid()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Nov 2020 10:12:27 +0000 (11:12 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Dec 2020 15:24:19 +0000 (16:24 +0100)
commit32217bb7090c1ea949a6bc16860f3b5387f6b5e3
treed852db20dcdadc2fb295c9e05b3ef7d3e63de657
parentabf12f071b17d8be51ce5fe368175f2f5612eafe
viruuid: Rework virUUIDIsValid()

The only test we do when checking for UUID validity is that
whether all bytes are the same (invalid UUID) or not (valid
UUID). The algorithm we use is needlessly complicated.

Also, the checked UUID is not modified and hence the argument can
be of 'const' type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Tested-by: Han Han <hhan@redhat.com>
src/util/viruuid.c
src/util/viruuid.h