Use noopAgent in unit tests to add online fake resources.
Fix unit tests according with new changes introduced recently.
fixes#192
Signed-off-by: Julio Montes <julio.montes@intel.com>
The initrd image name should be kata-containers-initrd.img,
as its referenced by this name later on.
Fixes#14
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
The rollback does not work as expected because the error has to be
checked from the defer itself.
Fixes#178
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
We need to be able to specify the PCI slot for a bridge while
adding it.
Add test to verify bridge is correctly added.
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
In case the container creation fails, we need a proper rollback
regarding the mounts previously performed.
Fixes#135
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
In case the container creation fails, we need a proper rollback
regarding the mounts and hotplugs previously performed.
This patch also rework the hotplugDrive() function in order to
prevent createContainer() function complexity to exceed 15.
Fixes#135
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Set the qemu major and minor version variables in the hypervisor
configuration script.
Partially fixes#13.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Add option to configure if IO needs to be in a separate IO thread.
Add tests to verify option is correctly parsed. The default value
is set to false for now.
This should be considered to be enabled by default in the future.
Fixes#132
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Fixes#140
`virtcontainers` had been moved from `github.com/containers/virtcontainers` to
`github.com/kata-containers/runtime/virtcontainers`, so we should remove legacy dependencies
of `github.com/containers/virtcontainers` from go imports and vendors.
Also some documents need to be modified.
Note: vendor is updated with `dep` tool with following command:
`$ dep ensure -update github.com/containers/virtcontainers`
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Add a hypervisor configuration to specify if IO should
be handled in a separate thread. Add support for iothreads for
virtio-scsi for now. Since we attach all scsi drives to the
same scsi controller, all the drives will be handled in a separate
IO thread which would still give better performance.
Going forward we need to assess if adding more controllers and
attaching iothreasds to each of them with distributing drives
among teh scsi controllers should be done, based on more performance
analysis.
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Vendor package for pulling in changes related to support
for iothreads with virtio-scsi.
Shortlog for govmm:
9130f37 scsi: Allow scsi controller to associate with an IO thread.
a54de18 iothread: Add ability to configure iothreads
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
If a container is not running, but created/ready instead, this means
a container process exists and that we can actually exec another
process inside this container. The container does not have to be
in running state.
Fixes#120
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
In case a consumer of virtcontainers tries to start/stop a container,
or stop a pod, and for some reasons, this fails, virtcontainers always
tries to delete everything related to the container or the pod before
it returns the error.
The caller of the runtime is the one responsible for cleaning things
up if something goes wrong, that's why this cleanup call is never
needed.
A real example of that is the case of cc-runtime and CRI-O, where this
cleanup prevented CRI-O from retrieving proper state of the container
after the failure, leading to the inability to stop and remove the
container and the VM afterwards.
Fixes#87
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This enable data-plane for scsi. All drives attached to the
scsi controller will have their IO processed in a single separate
IO thread instead of qemu's main event loop.
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
IOthreads also known as x-data-plane allow IO to
be processed in a separate thread rather than the main event
loop. This produces much better IO throughput and latency.
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit modifies version.yaml to now point to the qemu
2.11 stable version.
It modifies the default QEMU_CMD to be qemu-system-x86_64
instead of qemu-lite-system-x86_64.
And modifies virtcontainers unit tests to now point to the
correct QEMU_CMD.
Fixes: #118.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
Qemu 2.11 does not support --disable-static flag and
--enable-strip flag, this patch adds a condition
to only use it for qemu 2.7 or older.
Fixes: #11.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
Add details on how to disable the `initrd` config option to ensure the
base system as documented is functional.
Fixes#42.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This script will ensure we use a single source of qemu build
options for the Kata Containers project.
Fixes: #7.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
The kata_agent.go code breaks after the first /dev/shm. But in case
several are defined, the agent will crash since other /dev/shm will
be wrongly configured in the OCI spec mounts.
Fixes#127
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Instead of ignoring containers based on their path, this commit
relies on the type of mount being "bind" to choose if this mount
should be ignored or not.
For instance, we have some use cases where k8s expects the path
"/dev/container-log" to be bind mounted inside the container, but
the code ignores it because it has the prefix "/dev" which is a
system prefix mount.
Fixes#122
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Don't use a copy of the go test script, use the central version for
consistency with the other repos.
Fixes#125.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>