Skip to content
Snippets Groups Projects
  • Fam Zheng's avatar
    cea25275
    util: Add UUID API · cea25275
    Fam Zheng authored
    
    A number of different places across the code base use CONFIG_UUID. Some
    of them are soft dependency, some are not built if libuuid is not
    available, some come with dummy fallback, some throws runtime error.
    
    It is hard to maintain, and hard to reason for users.
    
    Since UUID is a simple standard with only a small number of operations,
    it is cleaner to have a central support in libqemuutil. This patch adds
    qemu_uuid_* functions that all uuid users in the code base can
    rely on. Except for qemu_uuid_generate which is new code, all other
    functions are just copy from existing fallbacks from other files.
    
    Note that qemu_uuid_parse is moved without updating the function
    signature to use QemuUUID, to keep this patch simple.
    
    Signed-off-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
    Message-Id: <1474432046-325-2-git-send-email-famz@redhat.com>
    cea25275
    History
    util: Add UUID API
    Fam Zheng authored
    
    A number of different places across the code base use CONFIG_UUID. Some
    of them are soft dependency, some are not built if libuuid is not
    available, some come with dummy fallback, some throws runtime error.
    
    It is hard to maintain, and hard to reason for users.
    
    Since UUID is a simple standard with only a small number of operations,
    it is cleaner to have a central support in libqemuutil. This patch adds
    qemu_uuid_* functions that all uuid users in the code base can
    rely on. Except for qemu_uuid_generate which is new code, all other
    functions are just copy from existing fallbacks from other files.
    
    Note that qemu_uuid_parse is moved without updating the function
    signature to use QemuUUID, to keep this patch simple.
    
    Signed-off-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
    Message-Id: <1474432046-325-2-git-send-email-famz@redhat.com>