Skip to content

Commit

Permalink
Merge pull request #1534 from zmrow/vmwdev-fixup
Browse files Browse the repository at this point in the history
Fix VMware spelling and document user data sources
  • Loading branch information
zmrow authored Apr 29, 2021
2 parents dbdb31b + 1c9409e commit 96f2d33
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions sources/api/early-boot-config/src/provider/vmware.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The vmware module implements the `PlatformDataProvider` trait for gathering userdata on VMWare
//! The vmware module implements the `PlatformDataProvider` trait for gathering userdata on VMware
//! via mounted CDRom or the guestinfo interface

use super::{PlatformDataProvider, SettingsJson};
Expand Down Expand Up @@ -97,7 +97,7 @@ impl VmwareDataProvider {
}

/// Read and base64 decode user data contained in an OVF file
// In VMWare, user data is supplied to the host via an XML file. Within
// In VMware, user data is supplied to the host via an XML file. Within
// the XML file, there is a `PropertySection` that contains `Property` elements
// with attributes. User data is base64 encoded inside a `Property` element with
// the attribute "user-data".
Expand Down Expand Up @@ -143,7 +143,7 @@ impl VmwareDataProvider {
fn guestinfo_user_data() -> Result<Option<SettingsJson>> {
info!("Attempting to retrieve user data via guestinfo interface");

// It would be extremely odd to get here and not be on VMWare, but check anyway
// It would be extremely odd to get here and not be on VMware, but check anyway
ensure!(vmw_backdoor::is_vmware_cpu(), error::NotVmware);

// `guestinfo.userdata.encoding` informs us how to handle the data in the
Expand Down Expand Up @@ -209,7 +209,7 @@ impl VmwareDataProvider {

/// Request a key's value from guestinfo
fn backdoor_get_bytes(key: &str) -> Result<Option<Vec<u8>>> {
// Probe and access the VMWare backdoor. `kernel lockdown(7)` may block "privileged"
// Probe and access the VMware backdoor. `kernel lockdown(7)` may block "privileged"
// mode because of its use of `iopl()`. According the the bug report below, in theory
// "privileged" mode is more reliable than "unprivileged" but both provide access to
// the same data so we fall back to "unprivileged" if the first call fails.
Expand Down Expand Up @@ -337,7 +337,7 @@ mod error {
},

#[snafu(display(
"Unable to read user data from guestinfo, this is not a VMWare virtual CPU"
"Unable to read user data from guestinfo, this is not a VMware virtual CPU"
))]
NotVmware,

Expand Down
2 changes: 1 addition & 1 deletion sources/models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and
* [Model](src/aws-dev/mod.rs)
* [Default settings](src/aws-dev/defaults.d/)

### vmware-dev: VMWare development build
### vmware-dev: VMware development build

* [Model](src/vmware-dev/mod.rs)
* [Default settings](src/vmware-dev/defaults.d/)
Expand Down
2 changes: 1 addition & 1 deletion sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and
* [Model](src/aws-dev/mod.rs)
* [Default settings](src/aws-dev/defaults.d/)
## vmware-dev: VMWare development build
## vmware-dev: VMware development build
* [Model](src/vmware-dev/mod.rs)
* [Default settings](src/vmware-dev/defaults.d/)
Expand Down
7 changes: 4 additions & 3 deletions variants/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ The [aws-dev](aws-dev/Cargo.toml) variant has useful packages for local developm
It includes tools for troubleshooting as well as Docker for running containers.
User data will be read from IMDS.

### vmware-dev: VMWare development build
### vmware-dev: VMware development build

The [vmware-dev](vmware-dev/Cargo.toml) variant has useful packages for local development of the OS, and is intended to run as a VMWare guest.
The [vmware-dev](vmware-dev/Cargo.toml) variant has useful packages for local development of the OS, and is intended to run as a VMware guest.
It includes tools for troubleshooting as well as Docker for running containers.
User data will be read from a mounted CD-ROM, either from a file named "user-data" or from an OVF file.
User data will be read from a mounted CD-ROM (from a file named "user-data" or from an OVF file), and from VMware's guestinfo interface.
If user data exists at both places, settings read from guestinfo will override identical settings from CD-ROM.

### Deprecated variants

Expand Down

0 comments on commit 96f2d33

Please sign in to comment.