mirror of
https://github.com/systemd/systemd
synced 2024-07-21 18:24:38 +00:00
Merge pull request #31067 from RA-Kooi/xen-uuid
machine-id-setup: Generate stable machine IDs on Xen virtual machines.
This commit is contained in:
commit
ed4498a193
|
@ -101,7 +101,8 @@
|
|||
to use the D-Bus machine ID from <filename>/var/lib/dbus/machine-id</filename>, the
|
||||
value of the kernel command line option <varname>container_uuid</varname>, the KVM DMI
|
||||
<filename>product_uuid</filename> or the devicetree <filename>vm,uuid</filename>
|
||||
(on KVM systems), and finally a randomly generated UUID.</para>
|
||||
(on KVM systems), the Xen hypervisor <filename>uuid</filename>, and finally a randomly
|
||||
generated UUID.</para>
|
||||
|
||||
<para>After the machine ID is established,
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
|
|
|
@ -234,6 +234,8 @@ int id128_get_product(sd_id128_t *ret) {
|
|||
r = id128_read("/sys/class/dmi/id/product_uuid", ID128_FORMAT_UUID, &uuid);
|
||||
if (r == -ENOENT)
|
||||
r = id128_read("/proc/device-tree/vm,uuid", ID128_FORMAT_UUID, &uuid);
|
||||
if (r == -ENOENT)
|
||||
r = id128_read("/sys/hypervisor/uuid", ID128_FORMAT_UUID, &uuid);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
} else if (IN_SET(detect_vm(), VIRTUALIZATION_KVM, VIRTUALIZATION_AMAZON, VIRTUALIZATION_QEMU)) {
|
||||
} else if (IN_SET(detect_vm(), VIRTUALIZATION_KVM, VIRTUALIZATION_AMAZON, VIRTUALIZATION_QEMU, VIRTUALIZATION_XEN)) {
|
||||
|
||||
/* If we are not running in a container, see if we are running in a VM that provides
|
||||
* a system UUID via the SMBIOS/DMI interfaces. Such environments include QEMU/KVM
|
||||
|
|
Loading…
Reference in a new issue