mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
util: add is_equal to UUID API
It's going to be useful, in particular, in VMBus code massively using uuids aka GUIDs. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> Message-Id: <20171127124355.26015-1-rkagan@virtuozzo.com> Signed-off-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
parent
dbd73b569b
commit
bfab1aede0
3 changed files with 15 additions and 2 deletions
|
@ -41,7 +41,12 @@ void qemu_uuid_generate(QemuUUID *uuid)
|
|||
int qemu_uuid_is_null(const QemuUUID *uu)
|
||||
{
|
||||
static QemuUUID null_uuid;
|
||||
return memcmp(uu, &null_uuid, sizeof(QemuUUID)) == 0;
|
||||
return qemu_uuid_is_equal(uu, &null_uuid);
|
||||
}
|
||||
|
||||
int qemu_uuid_is_equal(const QemuUUID *lhv, const QemuUUID *rhv)
|
||||
{
|
||||
return memcmp(lhv, rhv, sizeof(QemuUUID)) == 0;
|
||||
}
|
||||
|
||||
void qemu_uuid_unparse(const QemuUUID *uuid, char *out)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue