diff options
| author | Fam Zheng | 2014-12-04 00:28:29 +0100 |
|---|---|---|
| committer | Kevin Wolf | 2014-12-10 10:31:21 +0100 |
| commit | e5dc64b8ff09cc4c186273e4461c7479739db2ae (patch) | |
| tree | 058e90cb948f0d65a1af2959a815c2d95620c6b3 /scripts | |
| parent | block: Use g_new0() for a bit of extra type checking (diff) | |
| download | qemu-e5dc64b8ff09cc4c186273e4461c7479739db2ae.tar.gz qemu-e5dc64b8ff09cc4c186273e4461c7479739db2ae.tar.xz qemu-e5dc64b8ff09cc4c186273e4461c7479739db2ae.zip | |
vmdk: Use g_random_int to generate CID
This replaces two "time(NULL)" invocations with "g_random_int()".
According to VMDK spec, CID "is a random 32‐bit value updated the first
time the content of the virtual disk is modified after the virtual disk
is opened". Using "seconds since epoch" is just a "lame way" to generate
it, and not completely safe because of the low precision.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1417649314-13704-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
