Merge ~raharper/curtin:fix/lp1785356-switch-to-uuid4 into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Scott Moser
Approved revision: 005d919a9c174d9a24e21a7188ac43952c310551
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:fix/lp1785356-switch-to-uuid4
Merge into: curtin:master
Diff against target: 41 lines (+7/-3)
2 files modified
curtin/block/mkfs.py (+2/-2)
tools/xkvm (+5/-1)
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+352472@code.launchpad.net

Commit message

block: use uuid4 (random) when autogenerating UUIDS for filesystems

The use of uuid1 (timebased) results in UUID values that are visually
hard to distingish. Instead use uuid4 which generates a random
UUID value to provide a more visually distinctive /etc/fstab.

Updated tools/xkvm to add a virtio-rng device when launching VMs

LP: #1785356

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/mkfs.py b/curtin/block/mkfs.py
2index a199d05..f39017c 100644
3--- a/curtin/block/mkfs.py
4+++ b/curtin/block/mkfs.py
5@@ -8,7 +8,7 @@ from curtin import block
6
7 import string
8 import os
9-from uuid import uuid1
10+from uuid import uuid4
11
12 mkfs_commands = {
13 "btrfs": "mkfs.btrfs",
14@@ -191,7 +191,7 @@ def mkfs(path, fstype, strict=False, label=None, uuid=None, force=False):
15
16 # If uuid is not specified, generate one and try to use it
17 if uuid is None:
18- uuid = str(uuid1())
19+ uuid = str(uuid4())
20 cmd.extend(get_flag_mapping("uuid", fs_family, param=uuid, strict=strict))
21
22 if fs_family == "fat":
23diff --git a/tools/xkvm b/tools/xkvm
24index deb769e..dbcba6f 100755
25--- a/tools/xkvm
26+++ b/tools/xkvm
27@@ -648,9 +648,13 @@ main() {
28
29 local bus_devices
30 bus_devices=( -device "$virtio_scsi_bus,id=virtio-scsi-xkvm" )
31- cmd=( "${kvmcmd[@]}" "${archopts[@]}"
32+ local rng_devices
33+ rng_devices=( -object "rng-random,filename=/dev/urandom,id=rng0"
34+ -device "virtio-rng-pci,rng=rng0" )
35+ cmd=( "${kvmcmd[@]}" "${archopts[@]}"
36 "${bios_opts[@]}"
37 "${bus_devices[@]}"
38+ "${rng_devices[@]}"
39 "${netargs[@]}"
40 "${diskargs[@]}" "${pt[@]}" )
41 local pcmd=$(quote_cmd "${cmd[@]}")

Subscribers

People subscribed via source and target branches