Commit Graph

2339 Commits

Author SHA1 Message Date
Fabiano Fidêncio
33e5ab1bf6
Merge pull request #2624 from andreabolognani/feature-selinux
makefile: Make SELinux support configurable
2020-04-17 15:04:04 +02:00
Andrea Bolognani
d78ffd653d makefile: Make SELinux support configurable
SELinux support requires libselinux to be available, but that's
not the only factor: for example, Fedora 31 has libselinux but not
a version of selinux-policy that knows about Kata containers, so
enabling SELinux support by default in that case causes usability
issues.

Another issue with the current implementation is that, when
libselinux is absent, SELinux support will be quietly disabled,
which might not be what the user (or packager) intended.

To solve both problems, introduce the new FEATURE_SELINUX user
variable. This variable takes one of three values:

  * check (default): keep the current behavior;

  * yes: enable SELinux support, erroring out if libselinux is
         not present on the system;

  * no: disable SELinux support.

In the future we might want to formalize support for optional
build-time features, but for now this will do.

Fixes: #2623

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-04-17 12:03:22 +02:00
Julio Montes
018348064e
Merge pull request #2621 from likebreath/boot_from_pmem
clh: Boot from persistent memory device
2020-04-16 07:33:07 -05:00
Julio Montes
9c8b7c3197
Merge pull request #2561 from justin-he/scsi_async
config: Add scsi_mod.scan=none for virtio-scsi
2020-04-16 07:28:48 -05:00
Fupan Li
39a039cde5
Merge pull request #2617 from fidencio/wip/shimv2_config_paths
katautils: Use config paths set during the build
2020-04-16 16:40:04 +08:00
Bo Chen
7aa3168500 clh: Boot from persistent memory device
This patch enables clh to mount the guest rootfs on a pmem device while
booting, which can reduce the guest memory footprint.

Fixes: #2589

Depends-on: github.com/kata-containers/packaging#1014

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-04-15 17:08:20 -07:00
Bo Chen
e8fc25a7f4 version: Update clh to master
Upgrade the version of clh to the upstream master, so that we have can
boot from pmem, and have the support for virtio-blk and virtio-pmem
hotplug.

Changes:

a8ec8f33 build(deps): bump hermit-abi from 0.1.10 to 0.1.11
6cc8248a build(deps): bump num_cpus from 1.12.0 to 1.13.0
8ff36337 vm-virtio: pci: Update the BARs used by the VirtioPciDevice
56207a03 pci: Print out details of the BAR moving upon error
a216c2eb vm-virtio: pci: Implement free_bars() for VirtioPciDevice
72fdfff1 vmm: device_manager: Remove unused "_mmap_regions" member
70ecd6ba vmm, virtio: fs: Move freeing of mappped region into device
0c6706a5 vmm, virtio: pmem: Move freeing of mappped region into device
6565e478 vhost_user_net: Enable multithreaded multiqueue support
1a0a2c01 vhost_user_backend: Provide the thread ID to handle_event()
cfffb7ed vhost_user_backend: Allow for one exit_event per thread
b927dcee vhost_user_net: Prepare for multithreaded support
cd2b03f6 vhost_user_backend: Return a list of vring workers
d9eec0de vhost_user_backend: Add the ability to start multiple threads
40e4dc63 vhost_user_backend: Change handle_event as immutable
8f434df1 vhost_user: Adapt backends to let handle_event be immutable
b1554642 vmm: seccomp: Add missing mremap() syscall
886c0f90 build(deps): bump libc from 0.2.68 to 0.2.69
6c164c76 build(deps): bump thiserror from 1.0.14 to 1.0.15
0071ac8c build(deps): bump parking_lot from 0.10.0 to 0.10.2
2b7fbcb9 build(deps): bump lock_api from 0.3.3 to 0.3.4
d1155c7c build(deps): bump parking_lot_core from 0.7.0 to 0.7.1
28abfa9d vmm: openapi: Mark "initramfs" field nullable
c260640f vmm: config: Use Default::default() value for initramfs field
4617aefd tests: Test initramfs loading with PVH boot
7134f312 vmm: Allow PVH boot with initramfs
0fc39364 arch: Support loading initramfs with PVH boot protocol
b9f19370 build(deps): bump smallvec from 1.2.0 to 1.3.0
2d3f518c vmm: config: Error if both socket and path are specified for a disk
eeb7e252 vmm: config: Move max vCPUs > boot vCPUs check to validate()
12edb246 vmm: config: Validate that serial/console file mode has a path
31928fb1 main: Consistently use eprintln!() for error messages
11dd609f main: Only try and parse VM options on VM boot path
aaf382ee vmm: Move kernel check to VmConfig::validate() method
3b0da2d8 vmm: vm: Validate configuration on API boot
99b2ada4 vmm: Start splitting configuration parsing and validation
0ea706fa vmm: openapi: Update OpenAPI definition with RestoreConfig
8d9d2243 vmm: Add "prefault" option when restoring
a517ca23 vmm: Move restore parameters into common RestoreConfig structure
6712958f vmm: memory: Add prefault option when creating region
b2cdee80 vmm: memory: Restore with Copy-on-Write when possible
d771223b vmm: memory: Extend new() to support external backing files
ee5a041a vmm: memory: Add Copy-on-Write parameter when creating region
be4e1e87 vmm: memory: Use fine grained mmap wrapper
f0ab002e build(deps): bump openssl-sys from 0.9.54 to 0.9.55
b9f9f01f vmm: Extend seccomp filters to allow snapshot/restore
6eb72130 vmm: Enable restore feature
53613319 vmm: Enable snapshot feature
2cd0bc0a vmm: Create initial VM from its snapshot
b55b83c6 vmm: vm: Implement the Transportable trait
1ed357cf vmm: vm: Implement the Snapshottable trait
20ba271b vmm: memory_manager: Implement the Transportable trait
e606112c vmm: memory_manager: Implement the Snapshottable trait
50b3f008 vmm: cpu: Implement the Snapshottable trait
f787c409 vmm: cpu: Factorize vcpu starting code
722f9b66 vmm: cpu: Get and set KVM vCPU state
13756490 vmm: cpu: Track all Vcpus through CpuManager
a0d5dbce vmm: device_manager: Implement the Snapshottable trait
93d3abfd vmm: device_manager: Make serial and ioapic devices migratable
12b036a8 Cargo: Update dependencies for the KVM serialization work
183529d0 vmm: Cleanup warning from build
22958261 main: Print human readable error for command line error
c7dfbd8a vmm: config: Implement fmt::Display for error
d8119fda vmm: config: Remove unused error entries
1a10f16a vmm: config: Consolidate size parsing code
f449486b vmm: config: Make toggle parsing more tolerant
a4e0ce58 vmm: config: Consolidate on/off parsing
c731a943 vmm: config: Port vsock to OptionParser
37264cf2 vmm: config: Add unit testing for vsock
8665898f vmm: config: Port device parsing to OptionParser
a85e2fa7 vmm: config: Add unit test for VFIO device parsing
bed282b8 vmm: config: Add "valueless" options to OptionParser
2ae3392d vmm: config: Port console parsing to OptionParser
143d63c8 vmm: config: Add unit test for console parsing
5ab58e74 vmm: config: Port pmem option to OptionParser
233ad78b vmm: config: Add parsing test for pmem
13dc6373 vmm: config: Port filesystem parsing to OptionParser
7a071c28 vmm: config: Implement unit testing for virtio-fs parsing
e4cd3072 vmm: config: Port RNG options to OptionParser
708dbb97 vmm: config: Add RNG parsing unit test
057e71d2 vmm: config: Accept empty value strings
218c780f vmm: config: Port network parsing to OptionParser
a5747a84 net_util: Implement FromStr for MacAddr
8754720e vmm: config: Add unit test for net parsing
224e3dde vmm: config: Switch disk parsing to OptionParser
9e102447 vmm: config: Add unit test for disk parsing
e40ae627 vmm: config: Port memory option parsing to OptionParser
be32065a vmm: config: Add "ByteSized" type for simplifying parsing of byte sizes
f01bd7d5 vmm: config: Implement FromStr for HotplugMethod
74613803 vmm: config: Add a Toggle type for "on/off" strings
929142bc vmm: config: Add memory parsing unit test
68203ea4 vmm: config: Port CPU parsing to OptionParser
9e6a2825 vmm: config: Add unit test for CPU parsing
9e7231cd vmm: config: Introduce basic OptionParser
1e20b572 build(deps): bump serde_json from 1.0.50 to 1.0.51
baf48500 build(deps): bump serde_derive from 1.0.105 to 1.0.106
00230905 build(deps): bump serde from 1.0.105 to 1.0.106
447af8e7 vmm: vm: Factorize the device and cpu managers creation routine
c73c9b11 vmm: vm: Open kernel and initramfs once all managers are created
0646a906 vmm: cpu: Pass CpusConfig to simplify the new() prototype
b584ec3f vmm: memory_manager: Own the system allocator
ef2b11ee vmm: memory_manager: Pass MemoryConfig to simplify the new() prototype
622f3f8f vmm: vm: Avoid ioapic variable creation
164e8100 vmm: cpu: Move CPUID patching to CpuManager
1a2c1f97 vmm: vm: Factorize the KVM setup code
3eb11069 arch: regs: Rename and export create_msr_entries
c3a34903 arch: regs: Make create_msr_entries more readable
7a50646c vmm: device_manager: Convert migratable_devices to a map
8ba37a98 .gitignore: Add build directory
b3e4111e devices: serial: Implement the Snapshottable trait
98741573 devices: ioapic: Implement the Snapshottable trait
3ef1c00c ch-remote: Fix snapshot and restore subcommands
dc97b67d main: Fix restore CLI
859a9618 ch-remote: Add --restore option
35c0ea6c ch-remote: Add --snapshot option
fe2d8846 main: Support VM restore from the command line
8f300bed vmm: api: Add a /api/v1/vm.restore endpoint
92c73c3b vmm: Add a VmRestore command
39d4f817 vmm: http: Add a /api/v1/vm.snapshot endpoint
cf8f8ce9 vmm: api: Add a Snapshot command
452475c2 vmm: Add migration helpers
1b1a2175 vm-migration: Define the Snapshottable and Transportable traits
2d17f438 vmm: seccomp: Add missing open() syscall
bf135a29 build(deps): bump linux-loader from `2adddce` to `61d95eb`
da4aaee7 build(deps): bump vmm-sys-util from 0.4.0 to 0.5.0
6a934c32 build(deps): bump proc-macro-hack from 0.5.14 to 0.5.15
3b891cd3 build(deps): bump micro_http from `e89ed14` to `0d87a94`
d5199ad9 build(deps): bump anyhow from 1.0.27 to 1.0.28
6a0b4d7a build(deps): bump proc-macro2 from 1.0.9 to 1.0.10
31bbe0e5 build(deps): bump hermit-abi from 0.1.9 to 0.1.10
7f098168 build(deps): bump hermit-abi from 0.1.8 to 0.1.9
00a1eced build(deps): bump thiserror from 1.0.13 to 1.0.14
f24b7424 build(deps): bump serde_json from 1.0.48 to 1.0.50
e4ea8b0b vmm: Add missing syscalls to the seccomp filters
33be24bd vhost-user-fs: return EINVAL if req is out of range in fs_slave_mmap/unmap/sync
78b5cbc6 vhost-user-fs: validate fs_slave_map/unmap/sync request
0c29c2ec ci: Extend VFIO test with memory hotplug
9e181776 vmm: Add memory hotplug support to VFIO PCI devices
cc67131e vmm: Retrieve new memory region when memory is extended
e4a034ae vfio: Add support for memory hotplug
8fc7bf29 vmm: Move to the latest linux-loader
785812d9 vmm: Fallback to legacy boot if PVH is enabled along with initramfs
5157ba10 resources: enable initramfs in kernel config
3b470d4f tests: add support for initramfs
6cce7b95 arch: load initramfs and populate zero page
1f9bc68c openapi: Add initramfs support
4db252b4 main, vmm: add --initramfs cli option
0ce7de3e arch: provide mechanism to get page size
4b110d5b tests: Add integration test for hotplugging network device
f3f4d075 ch-remote: Add support for hotplugging network devices
c73c31b6 docs: Update API documentation to include "vm.add-net"
6244beb9 openapi: Add "vm.add-net" entry point
57c3fa4b vmm: Add "add-net" to the API
f664cdde vmm: Add support for adding network devices to the VM
8f323e61 vmm: Add support to DeviceManager for hotplugging network devices
42a9896f vmm: device_manager: Refactor make_virtio_net_devices
9df601a1 bin, vmm: Centralise the net syntax
41d7b3a3 vmm: memory_manager: Only send the GED notification for the ACPI method
15d9ec01 openapit: Add hotplug_method to MemoryConfig
abbd69ab tests: Add integration test test_virtio_mem
4a7a2cff tests: Add test for hotplug_size and hotplug_method
e63f9818 vmm: device: Add make_virtio_mem_devices
e6b934a5 vmm: Add support for virtio-mem
51d102c7 vm-virtio: Add virtio-mem device
8d05fb86 tests: Add integration test for hotplugging pmem device
0b051010 ch-remote: Add support for hotplugging persistent memory
44aef8f4 docs: Update API documentation to include "vm.add-pmem"
75878dd9 openapi: Add "vm.add-pmem" entry point
f6f4c68f vmm: Add "add-pmem" to the API
15de30f1 vmm: Add support for adding pmem devices to the VM
f7def621 vmm: Add support to DeviceManager for hotplugging pmem devices
8c3ea8cd vmm: device_manager: Refactor make_virtio_pmem_devices
a7296bbb bin, vmm: Centralise the pmem syntax
61e34331 virtio-fs: validate request len in fs_slave_io()
4c9d15d4 vmm: Fix copy and paste error message
96d4f1e3 tests: Add integration test for hotplugging disk device
05ce2dc8 ch-remote: Add support for hotplugging disks
eec1a32d docs: Update API documentation to include "vm.add-disk"
82cad99c openapi: Add "vm.add-disk" entry point
f2151b27 vmm: Add "add-disk" to the API
164ec2b8 vmm: Add support for adding disks to the VM
b3082c19 vmm: Add support to DeviceManager for hotplugging disks
2be703ca vmm: device_manager: Refactor make_virtio_block_devices
66da29d8 bin, vmm: Centralise the disk syntax
ede28878 build(deps): bump micro_http from `e712d6a` to `e89ed14`

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-04-15 17:08:12 -07:00
Archana Shinde
65865ab74d
Merge pull request #2613 from amshinde/update-kernel-5-4-32
version: Update kernel to lts 5.4.32
2020-04-15 06:29:57 -07:00
Fabiano Fidêncio
bf9758bf86 katautils: Use config paths set during the build
When building kata runtime packagers can simply do something like
`make CONFDIR=/usr/share/kata-containers/defaults` and it'll make
runtime understand that `/usr/share/defaults/kata-containers/` shouldn't
be used as `defaultRuntimeConfiguration` and, instead, runtime will use
whatever as passed to `make` during build time.

This is a quite common approach, mainly for distros, as there's no
perfect agreement on directory layout and whatnot.

Kwowing that, let's also make `containerd-shim-kata-v2`, which reads the
configurations from `pkg/katautils/config-settings.go`, to have a
similar behaviour as `runtime` and respect a "build-time" configured
`defaultRuntimeConfiguration` and `defaultSysConfRuntimeConfiguration`
paths.

Fixes: #2610

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-15 13:40:02 +02:00
Jia He
8c850d9e3a config: Add scsi_mod.scan=none for virtio-scsi
As per [1], the default scan mode of scsi is sync.
kata-agent already scans the SCSI buses [2], changing it to none
can reduce the guest boot time.

=Before this patch=
[    0.113828] [    T1] scsi host0: Virtio SCSI HBA
[    0.134006] [    T1] tun: Universal TUN/TAP device driver, 1.6

=After this patch=
[    0.105891] [    T1] scsi host0: Virtio SCSI HBA
[    0.107868] [    T1] tun: Universal TUN/TAP device driver, 1.6

It reduces about 17ms on arm64 for virtio-scsi.

This patch changes the default kernel parameter:
1. If user specifies the scan mode, use that
2. If user doesn't specify it, and the block device is virtio-scsi, use
   "none" by default

[1] https://lwn.net/Articles/201898/
[2] https://github.com/kata-containers/agent/blob/649d44117a/device.go#L322

Fixes: #2560
Signed-off-by: Jia He <justin.he@arm.com
2020-04-15 09:45:48 +08:00
Archana Shinde
07d0a4f0aa version: Update kernel to lts 5.4.32
Update kernel from 5.4.15 to 5.4.32

Fixes #2612

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-14 15:10:29 -07:00
Jose Carlos Venegas Munoz
c369692924
Merge pull request #2595 from jcvenegas/fix-2594
clh: virtiofs: Add no_posix_lock option
2020-04-14 13:30:08 -05:00
Salvador Fuentes
84d2bacc74
Merge pull request #2604 from amshinde/update-virtiofs-kernel
versions: Switch to virtio-fs-dev branch for kernel
2020-04-14 12:04:06 -05:00
Graham Whaley
0fe23c85c2
Merge pull request #2591 from darfux/change_log_outpipe_to_rdwr
v2: Open log fifo with `RDWR` instead of `WRONLY`
2020-04-14 14:40:20 +01:00
Fabiano Fidêncio
ab8050c5e0 kata_agent: Don't use dax if virtio_fs_cache is 0
If always using dax, even if virtio_fs_cache is 0, the following error
would happen:

```
[root@f32 runtime]# podman run --security-opt label=disable  --runtime=/usr/local/bin/kata-runtime --rm -id fedora sh
Error: rpc error: code = Internal desc = Could not mount kataShared to /run/kata-containers/shared/containers/: invalid argument: OCI runtime error
```

Fixes: #2464

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Fabiano Fidêncio
6218b2a558 kata_agent: Remove sharedDirVirtioFSOptions
Although in the earlier stages of development those FUSE client mount
options were needed, when virtiofs got merged the default option values
were baked into virtiofs.ko.

Those options are not only unneeded, but they'd also cause issues when
trying to run recent enough kernels, as shown below:
```
[root@f32 runtime]# podman run --security-opt label=disable  --runtime=/usr/local/bin/kata-runtime --rm -id fedora sh
Error: rpc error: code = Internal desc = Could not mount kataShared to /run/kata-containers/shared/containers/: invalid argument: OCI runtime error
```

Fixes: #2464

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Fabiano Fidêncio
95ccc0f759 agent: Use "virtiofs" instead of "virtio_fs"
virtio_fs was the name used for the module in the very early stages of
its development.

Fixes: #2462

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Archana Shinde
4c1cacd31d versions: Switch to virtio-fs-dev branch for kernel
This includes a newer kernel and necessary overlay changes
that fix oustanding issue for running docker in docker using
overlay.

Depends-on: github.com/kata-containers/agent#738
Depends-on: github.com/kata-containers/shim#233

Fixes #2603

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-13 14:22:52 -07:00
Li Yuxuan
8e0f891ebc v2: Open log fifo with RDWR instead of WRONLY
The container log fifo is opened as `O_WRONLY` now. When the read side
of fifo is closed temporarily such as restarting contaienrd, write to
`tty.Stdout` will get an EPIPE error and finally cause `io.CopyBuffer`
return. Then `ioCopy` closes the tty io and exits. Thus after containerd
restarted, the log fifo can't be reopened. The container will be blocked
forever after stdout/stderr buffer is full.

Opening the log fifo with `RDWR` instead of `WRONLY` avoids the fifo
returning EPIPE when the read side is closed, and keeps the fifo open
until the reader reopening it.

Fixes: #2590

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-04-10 14:58:56 +08:00
James O. D. Hunt
af24829c2a
Merge pull request #2600 from nitkon/master
qemu-ppc64le: Switch off large decrementer capability
2020-04-09 11:30:54 +01:00
Your Name
afbd03cf01 qemu-ppc64le: Switch off large decrementer capability
Large decrementer was introduced in Power 9 cpus.
Switch it off "cap-large-decr=off" as not all KVM hosts
support it

Fixes: #2599

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2020-04-09 00:04:57 -05:00
Jose Carlos Venegas Munoz
432f9bea6e clh: virtiofs: Add no_posix_lock option
This will allow lock operations, needed by programs like
`apt-get upgrade`.

Fixes: #2594

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-04-08 14:54:56 +00:00
Jose Carlos Venegas Munoz
02d8ec0bf8
Merge pull request #2593 from chavafg/topic/update-golang-version
versions: Update go to 1.13.9
2020-04-07 18:05:51 -05:00
Salvador Fuentes
0294fcb992 versions: Update go to 1.13.9
Update golang to 1.13.9 in versions.yaml.
In addition, add same golang version to `.travis.yml` and
delete the call to `.ci/install_go.sh` as it started to
cause problems in travis CI.

Fixes: #2592.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-07 13:04:59 -05:00
Jose Carlos Venegas Munoz
6e398f7c71
Merge pull request #2585 from nitkon/QemuCapablity
qemu_ppc64le: EXpose fs support explicitly
2020-04-03 09:52:42 -06:00
Julio Montes
2b92007a5c
Merge pull request #2583 from fidencio/wip/virtiofsd_not_present
qemu: Don't crash if virtiofsd path is non existent
2020-04-03 09:21:14 -06:00
Archana Shinde
2f07ec9100
Merge pull request #2503 from rhatdan/selinux
Add SELinux support for running VM Confinement
2020-04-03 07:58:58 -07:00
Fabiano Fidêncio
fd625b3fc5 qemu: Don't crash if virtiofsd path is non existent
Instead, report an error and exit gracefully, as shown below:
```
dahmer fidencio # podman run -ti --runtime=/usr/bin/kata-runtime fedora sh
Error: virtiofsd path (/usr/libexec/virtiofsd) does not exist: OCI runtime error
```

Fixes: #2582

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-03 15:44:06 +02:00
Nitesh Konkar
5eec8bdf9d qemu_ppc64le: EXpose fs support explicitly
Since fs sharing is not assumed as supported by default, expose
explicitly that the qemu_ppc64le supports it.

Fixes: #2584

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2020-04-03 19:08:04 +05:30
Daniel J Walsh
e4eb553d12
virtcontainers: Add SELinux support for running VM Confinement
We want to launch the KVM launcher tool (qemu?) with an SELinux label, similar
to what we do with libvirt.

Currently when I use kata with Podman, it complains if we specify a label that
kata does not support SELinux labels. What I would like to do is have kata just
use this label to apply to the KVM launcher. Then I will work to generate a new
policy type (container_kvm_t) that will allow the KVM Launcher tool to do its
thing, but prevent breakout.

Fixes: #2501

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-02 09:19:45 -04:00
Jose Carlos Venegas Munoz
705713b4f9
Merge pull request #2571 from jcvenegas/caps-clh
clh:  Implment capabilities
2020-03-30 16:33:42 -06:00
Jose Carlos Venegas Munoz
9fd7189388
Merge pull request #2536 from openSUSE/golang-update
Update go to v1.13.8
2020-03-30 12:12:41 -06:00
Julio Montes
e2d346c61d
Merge pull request #2566 from jcvenegas/fix-2565
Makefile: Allow change default hypervisor via env var
2020-03-30 07:30:49 -06:00
Jose Carlos Venegas Munoz
e525003e96
Merge pull request #2552 from likebreath/warn_only_resizeCPU
clh: Report warning when requested vCPUs exceeds maxVCPU allowed
2020-03-27 13:01:48 -06:00
Jose Carlos Venegas Munoz
39e354f609 clh: Implement capabilities
Make explicit that sharedfs is supported.

Other features are not supported today.

Fixes: #2567

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-27 06:14:20 +00:00
Jose Carlos Venegas Munoz
0a1ffc1d97 types: Make FS sharing disable by default
All the other caps are inverted (not supported by default).

Make fs sharing not supported by default and let hypervisors
expose if it supports it.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-27 06:14:20 +00:00
Bo Chen
669b6e32a5 clh: Report warning when requested vCPUs exceeds maxVCPU allowed
To have a consistent behavior of CPU hotplug with qemu in clh, we should
only report warning instead of errors when the requested vCPUs exceeds
the maximum number of vCPUs allowed.

Fixes: #2551

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-26 19:36:09 -07:00
Jose Carlos Venegas Munoz
2a19de8aa9
Merge pull request #2556 from jcvenegas/mem-hotplug-clh-v2
clh: Enable memory hotplug
2020-03-26 15:48:19 -06:00
Jose Carlos Venegas Munoz
7997218ced Makefile: Allow change default hypervisor via env var
- Add support to change default hypervisor via env variable.

- Show in the summary the default hypervisor to be used.

```
export DEFAULT_HYPEVISOR=cloud-hypervisor
make
sudo -E make install
```

Fixes: #2565

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-26 20:59:38 +00:00
Julio Montes
4fe62ade7f
Merge pull request #2543 from devimc/topic/virtcontainers/fixQ35vfioHotplug
virtcontainers: check PCI resource format before using it
2020-03-26 14:29:26 -06:00
Jose Carlos Venegas Munoz
11c998b6c7
Merge pull request #2515 from devimc/topic/pmem-CSI
Support persistent memory volumes
2020-03-26 11:57:17 -06:00
Graham Whaley
92b2ff723c
Merge pull request #2563 from chavafg/topic/update-containerd-version
versions: Update containerd commit
2020-03-26 09:33:24 +00:00
Jose Carlos Venegas Munoz
aab82f6745 clh: Add memory hotplug
Request memory to resize memory to hypervisor.

Depends-on: github.com/kata-containers/tests#2413

Fixes: #2526

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-26 04:31:21 +00:00
Salvador Fuentes
e62a8aa98e versions: Update containerd commit
We currently use containerd v1.3.0, but this version has an
issue when running the containerd/cri tests with go 1.13.
This commit: 3a4acfbc99aa976849f51a8edd4af20ead51d8d7 from
branch release/1.3 contains the fix to be able to run the
tests with go 1.13.

Depends-on: github.com/kata-containers/tests#2415
Fixes: #2562.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-03-25 18:10:52 -06:00
Jose Carlos Venegas Munoz
2f948738e4 clh: Use MemUnit to create VM
Provide memory in bytes using the new memory unit abstraction.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-25 04:32:03 +00:00
Jose Carlos Venegas Munoz
b6a7d8d63a utils: Add memory unit abstraction
Add MemUnit to help to manage memory, this will handle memory
units internally and provide proper methods to convert to different
units.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-25 04:32:03 +00:00
Jose Carlos Venegas Munoz
5e7d253859 clh: add vmInfo method
API VMInfo call is done more than one time. This leads to have
similar code in multiple times, create context, defer, do call.

Move the logic to one function.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-25 04:32:03 +00:00
Jose Carlos Venegas Munoz
ebb8fd576b versions: Update clh to latest master
Use latest master to enable memory hotplug.

Changes:

c1e6d00 ci: Add memory resizing use case to vhost-user tests
890582b ci: Factorize kernel command line
4de2584 ci: Fix mmio tests with direct kernel boot
f268246 ci: Factorize integration tests booting from vhost-user-blk
5a5b3cf ci: Factorize vhost-user-blk integration tests
dd8debf ci: Run vhost-user-blk tests for mmio builds
0c9c72c ci: Unify vhost-user-blk integration tests
c95851f ci: Run vhost-user-net tests for mmio transport
68293fc ci: Factorize vhost-user-net one step further
d75e745 vm-virtio: vhost-user: Send memory update to the backend
7ff82af vm-virtio: vhost-user: Factorize SET_MEM_TABLE setup
e54f8ec vmm: Update memory through DeviceManager
bc874a9 vm-virtio: Add update_memory() to VirtioDevice trait
93becca build(deps): bump backtrace from 0.3.45 to 0.3.46
feb8d7a vmm: Separate seccomp filters between VMM and API threads
5120c27 main: Add seccomp support
f1a23d7 vmm: api: Add seccomp to the HTTP API thread
db62cb3 vmm: Add seccomp filter to the VMM thread
cb98d90 vmm: Create new seccomp_filter module
708f02d vmm: Pull seccomp crate from Firecracker
18fbd30 vhost-user-fs: return correct result of fs_slave_io()
bbc385c devices: ioapic: Remove unused MsiMessage structure
2fc86ff dev_cli: Always pull the latest container image
4b462a5 Dockerfile: Add cpio and bsdtar to the container image
8acc15a build: Bump vm-memory and linux-loader dependencies
38ed560 build(deps): bump thiserror from 1.0.12 to 1.0.13
9f67de4 build(deps): bump proc-macro-hack from 0.5.12 to 0.5.14
ebab809 build(deps): bump thiserror from 1.0.11 to 1.0.12
c67e407 build(deps): bump syn from 1.0.16 to 1.0.17
bdcfe1e tests: Add "discard_writes" pmem test
7098602 tests: Make the test_virtio_pmem test use a temporary file
f7197e8 vmm: Add a "discard_writes=" to --pmem
d11a67b vmm: Use more generic MmapRegion constructor
7257e89 vmm: Add "readonly" parameter MemoryManager::create_userspace_mapping
03cb26c release: v0.6.0
3e9a39c github: Upload the ch-remote asset
c503118 vmm: fix a corrupted stack caused by get_win_size
0788600 build: Remove "pvh_boot" feature flag
477bc17 bin: Share VFIO device syntax between cloud-hypervisor and ch-remote
96be2db build(deps): bump serde_derive from 1.0.104 to 1.0.105
5a335fc build(deps): bump serde from 1.0.104 to 1.0.105
a31ffef openapi: Add hotplug_size for memory hotplug
87990f9 vmm: Add virtio-pci device to B/D/F hash table
fb185fa vmm: Always return PCI B/D/F from add_virtio_pci_device
462082c build(deps): bump arc-swap from 0.4.4 to 0.4.5
c821e96 vhost_user_fs: Implement support for FUSE_LSEEK
5aa9abc docs: Add document for vhost-user-net test with OVS/DPDK
6329219 vm-virtio: queue: Use a SeqCst fence on get_used_event
63eeed2 vm: Comment on the VM config update from memory hotplug
0895bcb build(deps): bump proc-macro-hack from 0.5.11 to 0.5.12
0541f5a build(deps): bump proc-macro-nested from 0.1.3 to 0.1.4
51f51ea build(deps): bump libc from 0.2.67 to 0.2.68
9cf67d1 arch: x86: Always set the bootloader type
ad35470 arch: x86: Extract common bootparams settings
28a5f9d vmm: acpi: Remove unused IORT related structures
5c1207c vhost-user-fs: handle FS_IO request
f61f78e build(deps): bump anyhow from 1.0.26 to 1.0.27
efb2447 pvh: Add integration test to validate PVH boot
da084fa pvh: Add unit tests for initial sregs and control registers
64941bf pvh: Add unit tests for start_info and memory map structures
9e247c4 pvh: Introduce "pvh_boot" feature
a22bc35 pvh: Write start_info structure to guest memory
840a9a9 pvh: Initialize vCPU regs/sregs for PVH boot
24f0e42 pvh: Introduce EntryPoint struct
98b9568 pvh: Add definitions for PVH boot protocol support
6e6ef83 build: Fix log dependency
291f1ce build(deps): bump linux-loader from `0c754f3` to `0ce5bfa`
07cc73b vhost_user_fs: add a flag to disable extended attributes
710520e vhost_user_fs: Process requests in parallel with a thread pool
90309b5 vm-virtio: queue: Add methods to switch a descriptor context
2294c2d Add .rustfmt.toml to the project
48c4885 vhost_user_fs: replace HandleData's File Mutex with RwLock
134e64c arch, qcow: Fix 1.42.0 clippy warnings
6ea85ca resources: Dockerfile: Update Rust toolchain
4579afa vmm: For --disk error if socket and path is specified
7e599b4 vmm: Make disk path optional
477d924 github: Build from a rust toolchain matrix
4f2469e main: Remove "--vhost-user-net"
8d785bb pci: Fix the PciBus using HashMap instead of Vec
04f2ccd build(deps): bump ryu from 1.0.2 to 1.0.3
02265bb build(deps): bump regex-syntax from 0.6.16 to 0.6.17
40b38a4 openapi: Make desired_ram int64 format
ca3b39c bin: Fix wrapping in help strings
ee1ba56 build: Use "wrap_help" feature for clap
3957d1e vhost_user_backend: call get_used_event from needs_notification
536323d vm-virtio: queue: hint that get_used_event should be inlined
401e1d2 vm-virtio: queue: fix a barrier comment at update_avail_event
e0bdfe8 vm-virtio: queue: add a missing memory barrier in get_used_event
df2570a resources: Simplify kernel config filename
9ab648b resources: Enable VIRTIO_MEM support
0339853 ci: Bump to kernel 5.6-rc4
abccf76 tests: Use ch-remote to add/remove devices in test_vfio
5c3ce9d tests: Extend ch-remote helper to support optional single argument
9a7d9c9 ch-remote: Support removing VFIO devices
0d53ba4 ch-remote: Support adding VFIO devices
babefbd main: Remove spurious second help line for "--device"
63c5d09 github: Trigger the build job on PRs
8cbb6d0 github: Replace Travis CI with github actions
efba48d vmm: Don't put a VFIO device behind the vIOMMU by default
34412c9 vmm: Add id option to VFIO hotplug
18dc916 vmm: Switch to the micro-http package
9023444 vmm: Add id field to --device through CLI
f4a956a vmm: Remove 32 bits MMIO range from correct address space
432eb5b vmm: Free PCI BARs when unplugging PCI device
f0dff8b vfio: pci: Remove KVM user memory region when cleaning up
34d1f43 vfio: pci: Implement free_bars() from the PciDevice trait
b8e1cf2 vm-allocator: Add new function to free 32 bits MMIO address space
f3dc245 pci: Extend PciDevice trait with new free_bars() method
911a2d6 tests: Use ch-remote to resize the VM
21160f7 ch-remote: Add "resize" command
bb2d04b ch-remote: Add support for sending a request body
bde4f73 ch-remote: Refactor HTTP response handling
6ed23bb build(deps): bump micro_http from `9bbde4f` to `6b3e5f0`
5edd812 build(deps): bump backtrace-sys from 0.1.33 to 0.1.34
f727714 ci: Add integration test for VFIO hot-unplug
b50cbe5 pci: Give PCI device ID back when removing a device
df71aae pci: Make the device ID allocation smarter
e514b12 vmm: Update VmConfig when removing VFIO device
81173bf vmm: Add id field to DeviceConfig structure
6cbdb9a vmm: api: Introduce new "remove-device" HTTP endpoint
991f3bb vmm: Remove VFIO device from everywhere it is referenced
6adebbc vmm: Detect when guest notifies about ejecting PCI device
0e21c32 devices: Add new method to remove all occurrences of a BusDevice
f8e2008 pci: Add a function to remove a PciDevice from the bus
08604ac vmm: Store PCI devices as Any devices from DeviceManager
0f99d3f vmm: Store VFIO device's name and its PCI b/d/f
13a61c4 build(deps): bump rand_chacha from 0.2.1 to 0.2.2
fcd605a build(deps): bump micro_http from `6d416af` to `9bbde4f`
30b6954 vm-virtio: Consume pause events to prevent infinite epoll_wait calls
16fd506 tests: Use new ch-remote for pause/resume integration test
ba8cd4d bin: Introduce "ch-remote" for controlling VMM
06cd31c build(deps): bump micro_http from `02def92` to `6d416af`
7e941c9 build(deps): bump linux-loader from `8cb7c66` to `0c754f3`

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-25 04:30:58 +00:00
Julio Montes
213f5dbaf5
Merge pull request #2550 from devimc/topic/virtcontainers/noVFIOInGuest
virtcontainers: Don't create vfio devices in the guest
2020-03-24 09:39:23 -06:00
Julio Montes
4d2574a723 virtcontainers: Don't create vfio devices in the guest
vfio devices hotplugged in the VM are expected to be handled by the kernel
driver in the guest, hence the char vfio devices shouldn't appear in the
container under /dev/vfio/.

fixes #2539

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-23 19:53:42 +00:00