Commit Graph

1969 Commits

Author SHA1 Message Date
dependabot-preview[bot]
1d9ad9e7b0 build(deps): bump autocfg from 0.1.5 to 0.1.6
Bumps [autocfg](https://github.com/cuviper/autocfg) from 0.1.5 to 0.1.6.
- [Release notes](https://github.com/cuviper/autocfg/releases)
- [Commits](https://github.com/cuviper/autocfg/compare/0.1.5...0.1.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-20 10:55:23 +00:00
dependabot-preview[bot]
55f01b2180 build(deps): bump remain from 0.1.3 to 0.1.4
Bumps [remain](https://github.com/dtolnay/remain) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/dtolnay/remain/releases)
- [Commits](https://github.com/dtolnay/remain/compare/0.1.3...0.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 10:18:09 +00:00
dependabot-preview[bot]
49a129f3d3 build(deps): bump serde from 1.0.98 to 1.0.99
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 10:17:57 +00:00
dependabot-preview[bot]
1c23a09cc6 build(deps): bump getrandom from 0.1.9 to 0.1.10
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.9 to 0.1.10.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.9...v0.1.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 10:17:45 +00:00
dependabot-preview[bot]
7245cf7c5e build(deps): bump rust-argon2 from 0.5.0 to 0.5.1
Bumps [rust-argon2](https://github.com/sru-systems/rust-argon2) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/sru-systems/rust-argon2/releases)
- [Changelog](https://github.com/sru-systems/rust-argon2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sru-systems/rust-argon2/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-16 07:49:03 +00:00
dependabot-preview[bot]
7adb9d55ec build(deps): bump libc from 0.2.61 to 0.2.62
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.61 to 0.2.62.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.61...0.2.62)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-16 07:22:34 +00:00
dependabot-preview[bot]
760791abbe build(deps): bump openssl-sys from 0.9.48 to 0.9.49
Bumps [openssl-sys](https://github.com/sfackler/rust-openssl) from 0.9.48 to 0.9.49.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.48...openssl-sys-v0.9.49)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-16 06:54:47 +00:00
dependabot-preview[bot]
7b718f3029 build(deps): bump vmm-sys-util from 5f8c251 to 7222869
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from `5f8c251` to `7222869`.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Commits](5f8c251355...7222869ed3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-16 06:54:23 +00:00
dependabot-preview[bot]
10abfd4448 build(deps): bump vmm-sys-util from 54e256b to 5f8c251
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from `54e256b` to `5f8c251`.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Commits](54e256b2cb...5f8c251355)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-15 09:34:46 +00:00
dependabot-preview[bot]
6678cbfb79 build(deps): bump getrandom from 0.1.8 to 0.1.9
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.8 to 0.1.9.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.8...v0.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-15 08:44:23 +00:00
Rob Bradford
513d2fdcf6 arch: x86_64: Update linux-loader crate
The linux-loader crate has been updated with a regnerated bootparams.rs
which has changed the API slightly. Update to the latest linux-loader
and adapt the code to reflect the changes:

* e820_map is renamed to e820_table (and all similar variables updated)
* e820entry is renamed to boot_e820_entry
* The E820 type constants are not no longer included

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-08-15 10:42:44 +02:00
dependabot-preview[bot]
0d53a5890d build(deps): bump rustc-demangle from 0.1.15 to 0.1.16
Bumps [rustc-demangle](https://github.com/alexcrichton/rustc-demangle) from 0.1.15 to 0.1.16.
- [Release notes](https://github.com/alexcrichton/rustc-demangle/releases)
- [Commits](https://github.com/alexcrichton/rustc-demangle/compare/0.1.15...0.1.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-14 08:12:28 +00:00
dependabot-preview[bot]
4b3fd906f7 build(deps): bump cc from 1.0.38 to 1.0.40
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.38 to 1.0.40.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.38...1.0.40)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-13 07:43:10 +00:00
dependabot-preview[bot]
bc5b72ff73 build(deps): bump libc from 0.2.60 to 0.2.61
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.60 to 0.2.61.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.60...0.2.61)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-13 07:21:11 +00:00
dependabot-preview[bot]
b608671031 build(deps): bump syn from 0.15.43 to 0.15.44
Bumps [syn](https://github.com/dtolnay/syn) from 0.15.43 to 0.15.44.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/0.15.43...0.15.44)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-12 11:07:32 +00:00
dependabot-preview[bot]
97c964891c build(deps): bump arc-swap from 0.4.1 to 0.4.2
Bumps [arc-swap](https://github.com/vorner/arc-swap) from 0.4.1 to 0.4.2.
- [Release notes](https://github.com/vorner/arc-swap/releases)
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v0.4.1...v0.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-12 11:07:05 +00:00
fazlamehrab
df5058ec0a vm-virtio: Implement console size config feature
One of the features of the virtio console device is its size can be
configured and updated. Our first iteration of the console device
implementation is lack of this feature. As a result, it had a
default fixed size which could not be changed. This commit implements
the console config feature and lets us change the console size from
the vmm side.

During the activation of the device, vmm reads the current terminal
size, sets the console configuration accordinly, and lets the driver
know about this configuration by sending an interrupt. Later, if
someone changes the terminal size, the vmm detects the corresponding
event, updates the configuration, and sends interrupt as before. As a
result, the console device driver, in the guest, updates the console
size.

Signed-off-by: A K M Fazla Mehrab <fazla.mehrab.akm@intel.com>
2019-08-09 13:55:43 -07:00
dependabot-preview[bot]
4c9759e4fc build(deps): bump syn from 0.15.42 to 0.15.43
Bumps [syn](https://github.com/dtolnay/syn) from 0.15.42 to 0.15.43.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/0.15.42...0.15.43)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-08 07:33:38 +00:00
dependabot-preview[bot]
b7ed71b012 build(deps): bump vmm-sys-util from 9014b7a to 54e256b
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from `9014b7a` to `54e256b`.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Commits](9014b7ab94...54e256b2cb)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-08 07:13:38 +00:00
dependabot-preview[bot]
8fcaf91d3b build(deps): bump redox_users from 0.3.0 to 0.3.1
Bumps redox_users from 0.3.0 to 0.3.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-08 07:11:11 +00:00
Rob Bradford
fca911e5f3 main: Add logging support controlled by command line
This makes the log macros (error!, warn!, info!, etc) in the code work.
It currently defaults to showing only error! messages, but by passing an
increasing number of "-v"s on the command line the verbosity can be
increased.

By default log output goes onto stderr but it can also be sent to a
file.

Fixes: #121

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-08-07 15:48:17 +01:00
dependabot-preview[bot]
6cc3e88742 build(deps): bump getrandom from 0.1.7 to 0.1.8
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.7 to 0.1.8.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.7...v0.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-06 07:22:10 +00:00
dependabot-preview[bot]
d1cd3c89c6 build(deps): bump vmm-sys-util from c0bbae5 to 9014b7a
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from `c0bbae5` to `9014b7a`.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Commits](c0bbae555d...9014b7ab94)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-06 07:21:55 +00:00
dependabot-preview[bot]
91c7f271b3 build(deps): bump utf8-ranges from 1.0.3 to 1.0.4
Bumps [utf8-ranges](https://github.com/BurntSushi/utf8-ranges) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/BurntSushi/utf8-ranges/releases)
- [Commits](https://github.com/BurntSushi/utf8-ranges/compare/1.0.3...1.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 10:45:55 +00:00
dependabot-preview[bot]
87f148cbff build(deps): bump regex-syntax from 0.6.10 to 0.6.11
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.10 to 0.6.11.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.6.10...regex-syntax-0.6.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 10:32:31 +00:00
dependabot-preview[bot]
778c60f21d build(deps): bump vmm-sys-util from 71b5b25 to c0bbae5
Bumps [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) from `71b5b25` to `c0bbae5`.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Commits](71b5b25dd5...c0bbae555d)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 10:31:17 +00:00
Rob Bradford
9caad7394d build, misc: Bump vmm-sys-util dependency
The structure of the vmm-sys-util crate has changed with lots of code
moving to submodules.

This change adjusts the use of the imported structs to reference the
submodules.

Fixes: #145

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-08-02 07:42:20 -07:00
Rob Bradford
ac950d9a97 build: Bulk update dependencies
Update all dependencies with "cargo upgrade" with the exception of
vmm-sys-utils which needs some extra porting work.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-08-02 15:22:37 +02:00
dependabot-preview[bot]
0c9547618a build(deps): bump vm-memory from 4c329f4 to 1635f25
Bumps [vm-memory](https://github.com/rust-vmm/vm-memory) from `4c329f4` to `1635f25`.
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Commits](4c329f4e76...1635f25afc)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-02 09:59:46 +00:00
dependabot-preview[bot]
6abd50f4b1 build(deps): bump clap from 2.27.1 to 2.33.0
Bumps [clap](https://github.com/clap-rs/clap) from 2.27.1 to 2.33.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-02 08:35:38 +00:00
dependabot-preview[bot]
c7f8498571 build(deps): bump log from 0.4.6 to 0.4.8
Bumps [log](https://github.com/rust-lang/log) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang-nursery/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-02 08:22:44 +00:00
dependabot-preview[bot]
8a7cfe8ec4 build(deps): bump dirs from 2.0.1 to 2.0.2
Bumps [dirs](https://github.com/soc/dirs-rs) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-02 08:21:19 +00:00
Samuel Ortiz
4d16ca8ae7 vmm: Support direct device assignment
With the VFIO crate, we can now support directly assigned PCI devices
into cloud-hypervisor guests.

We support assigning multiple host devices, through the --device command
line parameter. This parameter takes the host device sysfs path.

Fixes: #60

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-07-24 11:55:08 +02:00
Sebastien Boeuf
c93d5361b8 vfio: pci: Build the KVM routes
We track all MSI and MSI-X capabilities changes, which allows us to also
track all MSI and MSI-X table changes.

With both pieces of information we can build kvm irq routing tables and
map the physical device MSI/X vectors to the guest ones. Once that
mapping is in place we can toggle the VFIO IRQ API accordingly and
enable disable MSI or MSI-X interrupts, from the physical device up to
the guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-07-24 11:55:08 +02:00
fazlamehrab
577d44c8eb vm-virtio: Add virtio console device for single port operation
The virtio console device is a console for the communication between
the host and guest userspace. It has two parts: the device and the
driver. The console device is implemented here as a virtio-pci device
to the guest. On the other side, the guest OS expected to have a
character device driver which provides an interface to the userspace
applications.

The console device can have multiple ports where each port has one
transmit queue and one receive queue. The current implementation only
supports one port. For data IO communication, one or more empty
buffers are placed in the receive queue for incoming data, and
outgoing characters are placed in the transmit queue. Details spec
can be found from the following link.

https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.pdf#e7

Apart from the console, for the communication between guest and host,
the Cloud Hypervisor has a legacy serial device implemented. However,
the implementation of a console device lets us be independent of legacy
pin-based interrupts without losing the logs and access to the VM.

Signed-off-by: A K M Fazla Mehrab <fazla.mehrab.akm@intel.com>
2019-07-22 23:08:56 +01:00
Rob Bradford
80f33113cb tests: Use incrementing IP and mac address for VMs
This allows us to test multiple VMs at once.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-07-18 18:01:18 +02:00
Rob Bradford
7ebfe90985 tests: Use a temporary directory for the temporary test files
Use the tempdir crate to create a temporary directory that is deleted
when the structure goes out of scope.

Use this temporary directory for all temporary test files created by the
tests. The cloud init file is still in /tmp as that is created by the
test wrapper code.

This is the first stage towards being able to run the integration tests
in parallel.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-07-18 18:01:18 +02:00
Rob Bradford
78fe807284 build: Run unit tests on the Jenkins server
The addition of [workspace] to the top level Cargo.toml is necessary to
have the binaries colocated together.

The Cargo.lock files have also been refreshed by the change to the
Cargo.toml.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-07-16 17:09:05 +02:00
Sebastien Boeuf
1ddc8f2f0d vm-virtio: Add vhost-user-fs support
The vhost-user-fs or virtio-fs device allows files and directories to
be shared between host and guest. This patch adds the implementation
of this device to the cloud-hypervisor device model.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-27 21:46:00 +02:00
Jing Liu
30266a41be vm-memory usage: vm-memory latest codes rename MmapError to Error
Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
2019-06-26 08:33:46 -07:00
Sebastien Boeuf
5e803ab18f vmm: Integrate userspace IOAPIC
The previous commit introduced a userspace implementation of an IOAPIC
and this commits aims to plumb it into the cloud-hypervisor VMM.

Here is the list of new things brought by this patch:
- Update the rust-vmm/kvm-ioctls dependency to benefit from latest
  patches including the support for split irqchip, and the vector
  being returned when a VM exit is caused by an EOI.
- Enable the split irqchip (which means no IOAPIC or PIC is emulated
  in kernel). This is done conditionally based on the support of the
  TSC_DEADLINE_TIMER from both KVM and the underlying CPU. The
  dependency on TSC_DEADLINE_TIMER is related to KVM which does not
  support creating the in kernel PIT if it has a split irqchip.
- Rely on callbacks to handle the following use cases:
  - in kernel IOAPIC + serial IRQ (pin based)
  - in kernel IOAPIC + virtio-pci MSI-X
  - in kernel IOAPIC + virtio-pci IRQ (pin based)
  - userspace IOAPIC + serial IRQ (pin based)
  - userspace IOAPIC + virtio-pci MSI-X
  - userspace IOAPIC + virtio-pci IRQ (pin based)

Fixes #13

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-21 10:09:34 +02:00
Rob Bradford
c4c8b9314d build: Switch over to using rust-vmm linux-loader crate
With everything now merged upstream we no longer need to rely on Cathy's
fork.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-06-13 11:28:20 +01:00
Sebastien Boeuf
946a5d4f21 build: Update Cargo.lock for syn crate update
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-10 09:11:47 -07:00
Sebastien Boeuf
4be3dfeb37 build: Update Cargo.lock for linux-loader crate update
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-07 18:19:52 +01:00
Rob Bradford
bbd0f5eebb build: Update Cargo.lock for linux-loader crate update
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-06-07 12:39:42 +01:00
Sebastien Boeuf
13a065d2cd dep: Rely on latest kvm-ioctls crate
In order to have access to the newly added signal_msi() function
from the kvm-ioctls crate, this commit updates the version of the
kvm-ioctls to the latest one.

Because set_user_memory_region() has been swtiched to "unsafe", we
also need to handle this small change in our cloud-hypervisor code
directly.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-06 15:27:35 +01:00
Rob Bradford
1f53488003 tests: Switch to launching by command
Launch the test binary by command rather than using using the vmm layer.
This makes it easier to manage the running VM as you can explicitly kill
it.

Also switch to using credibility for the tests which catches assertions
and continues with subsequent commands and reports the issues at the
end. This means it is possible to cleanup even on failed test runs.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-06-06 11:03:13 +01:00
Rob Bradford
ddce3df826 tests: Add basic integration testing
Add basic integration testing of the hypervisor using a cloud-init to
configure the VM at boot and SSH to control it at runtime.

Initial test just boots the VM up checks some basic resources and
reboots. With a second test that calls into the first to check that
subsequent tests work correctly.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-06-06 11:03:13 +01:00
Samuel Ortiz
74a21f24e1 vendor: Remove vendoring
The cargo interaction with the .cargo/config does not meet our
requirements.

Regardless of .cargo/config explicitly replacing our external sources
with vendored ones, cargo build will rely first on Cargo.lock to update
its local source cache. If a dependency has been push forced, build
fails because of our top level Cargo.toml description.
This prevents us from actually pinning dependencies, which defeats the
vendoring purpose.

We're removing vendoring for now, until we understand it better.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-06-06 10:00:16 +01:00
Sebastien Boeuf
842515c2f1 vendor: Add vmm-sys-util duplicate
Since the top-level Cargo.toml specifies a vmm-sys-util revision
but not the sub crates, Cargo.lock points at 2 different crates.
cargo vendor copies both of them into the vendor directory but
forces the build to use the one coming from the top level driven
requirement.

Although this is a waste of space, this is a cargo vendor limitation
that we have to live with for now.

Also, because the dependency onto linux-loader had to be updated,
we had to specify a newly introduced feature called "elf".

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-06-06 10:12:04 +02:00
Samuel Ortiz
a6b7715f4b vendor: Move to the rust-vmm vmm-sys-util package
Locked to 60fe35be but no longer dependent on liujing2 repo.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-06-04 17:51:52 +02:00
Samuel Ortiz
d5f5648b37 vendor: Add vendored dependencies
We use cargo vendor to generate a .cargo/config file and the vendor
directory. Vendoring allows us to lock our dependencies and to modify
them easily from the top level Cargo.toml.

We vendor all dependencies, including the crates.io ones, which allows
for network isolated builds.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-06-04 17:51:52 +02:00
Rob Bradford
e3f7bc2e9d build: Update Cargo.lock to reflect changed dependencies
This also adds a new comment to Cargo.lock that is introduced by newer
cargo.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2019-06-03 14:18:18 +01:00
Samuel Ortiz
8bb71fad76 vmm: Simplify the vcpu run switch
Use a catchall case for all reasons that we do not handle, and
move the vCPU run switch into its own function.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-21 07:56:17 -07:00
Samuel Ortiz
9299502955 cloud-hypervisor: Switch to crates.io kvm-ioctls
Fixes: #15

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-15 05:59:08 +01:00
Samuel Ortiz
576a28ae5e net_util: Add helper for generating a random local MAC
We must ensure our MAC addresses do not conflict with a global one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-10 16:32:39 +02:00
Samuel Ortiz
0c4c330843 cloud-hypervisor: Switch to the linux-loader pending PR branch
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-10 16:32:39 +02:00
Sebastien Boeuf
c0be6642ad vmm: Leverage virtio-net to provide connectivity
This patch expand the device registration to add a new virtio-net
device in case the user provide the appropriate flag --net from the
command line.

If the flag is provided, the code will parse the TAP interface name
and the expected MAC address from the command line. The VM will be
connected to the provided TAP interface, and it will communicate the
MAC address to the virtio-net driver.

If the flag is not provided, the VM will not register any virtio-net
device, therefore it will not have any connectivity with the host.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-05-10 16:32:39 +02:00
Sebastien Boeuf
53f5295454 network: Add virtio-net dependencies
The newly added virtio-net implementation needs to interact with TAP
interfaces and MAC addresses, which is the reason why it is easier
to rely on existing packages net_util and net_gen.

One more thing, both net_util and net_gen could be trimmed down,
based on using only the things we need from cloud-hypervisor.

Both net_util, net_gen and sys_util are based on Firecracker
commit d4a89cdc0bd2867f821e3678328dabad6dd8b767.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-05-10 16:32:39 +02:00
Sebastien Boeuf
b67e0b3dad vmm: Use virtio-blk to support booting from disk image
After the virtio-blk device support has been introduced in the
previous commit, the vmm need to rely on this new device to boot
from disk images instead of initrd built into the kernel.

In order to achieve the proper support of virtio-blk, this commit
had to handle a few things:

  - Register an ioevent fd for each virtqueue. This important to be
    notified from the virtio driver that something has been written
    on the queue.

  - Fix the retrieval of 64bits BAR address. This is needed to provide
    the right address which need to be registered as the notification
    address from the virtio driver.

  - Fix the write_bar and read_bar functions. They were both assuming
    to be provided with an address, from which they were trying to
    find the associated offset. But the reality is that the offset is
    directly provided by the Bus layer.

  - Register a new virtio-blk device as a virtio-pci device from the
    vm.rs code. When the VM is started, it expects a block device to
    be created, using this block device as the VM rootfs.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2019-05-08 08:55:09 +02:00
Chao Peng
80ac3a84bb qcow: Add qcow support
Extracted from crosvm (commit:f82d632), with clippy fixes.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
2019-05-08 08:55:09 +02:00
Samuel Ortiz
0adc3481df vmm: Add PCI root
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-08 08:55:06 +02:00
Samuel Ortiz
c6c5e10a04 vmm: Add a basic stdin loop
After starting all vCPUs, we loop for STDIN input.
We need a more scalable eventfd control loop, obviously.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-08 08:40:42 +02:00
Samuel Ortiz
1853b350ee cloud-hypervisor: Add devices crate
Based on the Firecracker devices crate from commit 9cdb5b2.

It is a trimmed down version compared to the Firecracker one, to remove
a bunch of pulled dependencies (logger, metrics, rate limiter, etc...).

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-08 08:40:42 +02:00
Samuel Ortiz
0921cfb8f8 vmm: Basic Vcpu implementation
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-08 08:40:38 +02:00
Samuel Ortiz
539367b58c cloud-hypervisor: Initial kernel booting implementation
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-07 18:49:51 +02:00
Samuel Ortiz
a0da3deb5e cloud-hypervisor: Call into the test_vm() routine
test_vm is a dummy VM workload, we use it to test our initial VMM
settings.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-07 16:06:21 +02:00
Samuel Ortiz
2ed17abb5c cloud-hypervisor: Application handling
We will only support a --kernel option for now.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-07 16:03:17 +02:00
Samuel Ortiz
73337c8b19 cloud-hypervisor: Initial commit
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-05-07 10:19:57 +02:00