Skip to content

Commit

Permalink
udev: add 'conf-virt' constant for confidential virtualization tech
Browse files Browse the repository at this point in the history
Related: systemd/systemd#27604
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 6e2e83b)

Related: RHEL-50651
  • Loading branch information
berrange authored and dtardon committed Aug 1, 2024
1 parent 27a7bd2 commit e580333
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions man/udev.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@
for possible values.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>cvm</literal></term>
<listitem>
<para>System's confidential virtualization technology. See
<citerefentry><refentrytitle>systemd-detect-virt</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for possible values.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Unknown keys will never match.</para>
</listitem>
Expand Down
3 changes: 3 additions & 0 deletions src/udev/udev-rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "architecture.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "confidential-virt.h"
#include "def.h"
#include "device-private.h"
#include "device-util.h"
Expand Down Expand Up @@ -1681,6 +1682,8 @@ static int udev_rule_apply_token_to_event(
val = architecture_to_string(uname_architecture());
else if (streq(k, "virt"))
val = virtualization_to_string(detect_virtualization());
else if (streq(k, "cvm"))
val = confidential_virtualization_to_string(detect_confidential_virtualization());
else
assert_not_reached();
return token_match_string(token, val);
Expand Down

0 comments on commit e580333

Please sign in to comment.