Commit Graph

327 Commits

Author SHA1 Message Date
bin liu
d7836877e9 qemu: add pvpanic device to get GUEST_PANICKED event
Listening to the events channel from QEMU and a guest
panic event issued, then we can get the event and do some
work for the special event.

Fixes: #152

Signed-off-by: bin liu <bin@hyper.sh>
2020-10-19 16:59:37 +08:00
James O. D. Hunt
546cc55ea4
Merge pull request #148 from devimc/2020-10-09/fixup
contributors: remove CONTRIBUTORS.md file
2020-10-09 15:04:31 +01:00
Julio Montes
cb0d339141 contributors: remove CONTRIBUTORS.md file
Remove CONTRIBUTORS.md file since, this repo is now part of the
kata-containers organization, the other repos don't have this file
and we are not willing to maintain (update) it.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-09 08:03:25 -05:00
Julio Montes
2f6bb3dbec
Merge pull request #146 from jodh-intel/update-for-new-github-org
misc: Update for new GitHub organisation name
2020-10-09 08:01:28 -05:00
James O. D. Hunt
69f9a50bb2
Merge pull request #144 from mazzy89/fw-cfg
qemu: add fw_cfg flag to config
2020-10-09 09:23:50 +01:00
Salvatore Mazzarino
29ba5a9012 qemu: add fw_cfg flag to config
Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>
2020-10-09 10:17:58 +02:00
James O. D. Hunt
9f309c2aa1 misc: Update for new GitHub organisation name
`govmm` is now part of the `kata-containers` GitHub organisation, so
update to reflect this.

Fixes: #145.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-09 09:10:10 +01:00
Julio Montes
6fa954a506
Merge pull request #139 from dgibson/main
Add qom-get function
2020-09-03 07:36:07 -05:00
David Gibson
3d46d08a90 Add qom-get function
Add a function to access the qom-get QMP command so we can query
information from qemu.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-03 14:05:00 +10:00
James O. D. Hunt
6042f60331
Merge pull request #110 from heychenbin/master
typo fix
2020-08-25 07:50:22 +01:00
Julio Montes
9901db52fd
Merge pull request #134 from Jakob-Naucke/vfio-ap-mdev
Add support for hot-plugging IBM Adjunct Processor (AP) devices
2020-08-19 07:16:13 -05:00
Julio Montes
a0d27643ee
Merge pull request #138 from devimc/2020-08-17/enableGithubActions
github: enable github actions
2020-08-19 07:15:53 -05:00
Jakob-Naucke
39c372a201
Add support for hot-plugging IBM VFIO-AP devices
Add ExecuteAPVFIOMediatedDeviceAdd to qmp.go, which executes a hotplug
for an IBM Adjunct processor (AP) VFIO device (see also
https://www.kernel.org/doc/html/latest/s390/vfio-ap.html )
Also includes the respective unittest and adds the VfioAP DeviceDriver
constant to qemu.go.

Pushing again due to incidental CI failure

Fixes: #133

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
Reviewed-by: alicefr <afrosi@redhat.com>
2020-08-18 17:35:23 +02:00
Julio Montes
4c33e5e823
Merge pull request #137 from devimc/2020-08-17/fixCoveralls
travis: Run coveralls after success
2020-08-18 10:18:53 -05:00
Julio Montes
f5bdd53ce6 travis: disable amd64 jobs
move amd64 CI jobs to github actions

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-08-18 07:48:20 -05:00
Julio Montes
1af1c0d783 github: enable github actions
Use github actions to run unit tests.
Github actions service looks more stable and reliable than travis.

fixes #136

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-08-17 12:59:21 -05:00
Julio Montes
4831c6e0a3 travis: Run coveralls after success
Fix the following error:

```
Bad response status from coveralls: 422
{"message":"service_job_id (717167073) must be unique for Travis Jobs
not supplying a Coveralls Repo Token","error":true}
The command "$GOPATH/bin/goveralls -v -service=travis-ci" exited with 1.
```

fixes #135

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-08-17 11:00:07 -05:00
Julio Montes
547a851809
Merge pull request #132 from huoqifeng/iommu_platform
qemu: add iommu_platform knob for qemuParams
2020-07-31 08:16:13 -05:00
Qi Feng Huo
cf0f05d2e9 qemu: add iommu_platform knob for qemuParams
Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>

fix typo

Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>

qemu: remove useless fmt.Sprintf for qemuParams

Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>

fix test cases for s390x

Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
2020-07-30 22:19:49 +08:00
Julio Montes
6c3315ba8a
Merge pull request #131 from merwick/master
qemu: Add NoReboot config Knob for qemuParams
2020-07-28 08:52:09 -05:00
Liam Merwick
6645baf249 qemu: Add NoReboot config Knob for qemuParams
The Kata architecture does not support rebooting VMs (the lifecycle
being start/exec/kill) and if a VM is killed (e.g. using sysrq-trigger),
the VM does not exit fully and other layers do not notice the state change.
Kata needs a way to tell QEMU to run with the '--no-reboot' option
so that the guest VM exits and does not attempt to reboot.

Add a NoReboot boolean Knob so when Knobs.NoReboot is set, the '--no-reboot'
command-line option will be passed to QEMU on startup.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
2020-07-27 15:04:54 +01:00
Julio Montes
af9e34b91a
Merge pull request #130 from devimc/2020-07-22/addMultidevs
Add multidevs option to fsdev
2020-07-24 12:06:48 -05:00
Julio Montes
abca6f3ce9 Add multidevs option to fsdev
multidevs specifies how to deal with multiple devices being shared with a 9p
export. `multidevs=remap` fixes the following warning:

```
9p: Multiple devices detected in same VirtFS export, which might lead to file
ID collisions and severe misbehaviours on guest!
You should either use a separate export for each device shared from host or
use virtfs option 'multidevs=remap'!
```

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-23 10:56:22 -05:00
James O. D. Hunt
7cc469641b
Merge pull request #128 from devimc/2020-05-29/qmp/vhostBool
qemu/qmp: use boolean type for the vhost
2020-06-02 15:54:48 +01:00
Julio Montes
cc53876661 qemu/qmp: use boolean type for the vhost
vhost is a Netdev Tap Option used to configure a host TAP network interface
backend, according to the QMP API documentation the type for such option must
be a boolean. Use boolean type for vhost option to fix the following
error on recent versions of QEMU:

```
Invalid parameter type for 'vhost', expected: boolean
```

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-05-29 20:52:44 +00:00
Julio Montes
7efaf0b1cd
Merge pull request #127 from amorenoz/iommu
qemu: add IOMMU Device
2020-05-27 08:54:42 -05:00
Adrian Moreno
e57e86e2ea qemu: add IOMMU Device
The following options can be provided

Intremap: activates interrupt remapping
DeviceIotlb: enables device IOTLB support for the vIOMMU
CachingMode: enables Cahing Mode

See: https://wiki.qemu.org/Features/VT-d

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
2020-05-26 18:29:02 +02:00
Julio Montes
10b22acda6
Merge pull request #125 from bpradipt/master
Enable Numa support for Power (ppc64le) architecture
2020-05-14 10:25:37 -05:00
Pradipta Kr. Banerjee
b2aa0225ac Enable Numa support for Power (ppc64le) architecture
Fixes #124
Signed-off-by: bpradipt@in.ibm.com
2020-05-13 01:21:00 +05:30
Julio Montes
ad66e4caf8
Merge pull request #122 from devimc/topic/qemu/maxPorts
qemu: Add max_ports option to virtio-serial device
2020-05-08 13:47:10 -05:00
Julio Montes
621af7ebe8
Merge pull request #123 from LinShuicheng/master
Add rt clock definition for rtc clock in qemu
2020-05-06 09:46:32 -05:00
Shuicheng Lin
29529a5d72 Add rt clock definition for rtc clock in qemu
There are three different types for the RTC clock: host, rt and vm.
Add `rt` to the list of RTC clocks.

Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2020-05-06 08:43:40 +08:00
Julio Montes
0e98b613a8 qemu: Add max_ports option to virtio-serial device
Allow API consumers to change the maximum number of ports in the virtio-serial
devices, setting a lower number of ports can improve the boot time and
reduce the attack surface.

fixes #120

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-04-24 15:10:51 +00:00
Julio Montes
f6f627acef
Merge pull request #121 from merwick/microvm
qemu: Add microvm machine type support
2020-04-24 09:33:11 -05:00
Liam Merwick
787c86b7e5 qemu: Add microvm machine type support
Following on from #111 which added support for multiple virtio transports,
add code to use virtio-mmio as the transport when booting a guest with
the microvm machine type and add a microvm case when checking for
NUMA support. Also add a test case for machine string parsing.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
2020-04-23 22:27:03 +01:00
Julio Montes
e969afbec5
Merge pull request #119 from devimc/topic/qemu/AddPmem
qemu: add pmem flag to memory-backend-file
2020-03-04 08:25:14 -06:00
Julio Montes
5378725f11 qemu: add pmem flag to memory-backend-file
According to QEMU's nvdimm documentation: When 'pmem' is 'on' and QEMU is
built with libpmem support, QEMU will take necessary operations to guarantee
the persistence of its own writes to the vNVDIMM backend.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-03 14:28:59 +00:00
Peng Tao
3700c55dd7 qemu: add block device readonly support
So that we can attach it readonly.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-02-21 08:58:53 +01:00
Mark Ryan
37b0d9c12f
Merge pull request #111 from slp/multiple_transports
Refactor code to support multiple virtio transports at runtime
2020-02-18 13:51:07 +01:00
Mark Ryan
20f3977bc7
Merge pull request #117 from fidencio/wip/dont_always_set_cache_size
qemu: Don't set ".cache-size=" when CacheSize is 0
2020-02-08 10:49:46 +01:00
Sergio Lopez
88a25a2d68 Refactor code to support multiple virtio transports at runtime
Currently, virtio transports for each device are determined with
architecture dependent build time conditionals. This isn't the ideal
solution, as virtio transports aren't exactly tied to the host's
architecture.

For example, aarch64 VMs do support both PCI and MMIO devices, and
after the recent introduction of the microvm machine type, that's also
the case for x86_64.

This patch extends each device that supports multiple transports with
a VirtioTransport field, so users of the library can manually specify
a transport for each device. To avoid breaking the compatibility, if
VirtioTransport is empty a behavior equivalent to the legacy one is
achieved by checking runtime.GOARCH and Config.Machine.Type.

Keeping support for isVirtioPCI/isVirtioCCW in qmp.go is a bit
tricky. Eventually, the hot-plug API should be extended so callers
must manually specify the transport for the device.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-02-07 18:17:12 +01:00
Fabiano Fidêncio
2ee53b00ca qemu: Don't set ".cache-size=" when CacheSize is 0
As there's no guarantee that ".cache-size" is a supported QEMU property,
let's not add it to the QEMU command line when the user explicitly set
virtio_fs_cache_size to zero.

By not always setting ".cache-size" property we avoid errors like:
```
$ sudo podman --runtime=/usr/bin/kata-runtime run --security-opt label=disable -it fedora:31 /bin/bash
Error: failed to launch qemu: exit status 1, error messages from qemu log: qemu-kvm: -device vhost-user-fs-pci,chardev=char-88c350403e95d3db,tag=kataShared,cache-size=0M: Property '.cache-size' not found: OCI runtime error
```

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-02-07 09:56:36 +01:00
Julio Montes
cab4709376
Merge pull request #116 from Jimmy-Xu/add-pcie-root-port
qemu: Add pcie-root-port device support.
2020-01-31 08:07:07 -06:00
Jimmy Xu
f1252f6e17 qemu: Add pcie-root-port device support. 2020-01-26 21:44:11 +08:00
Julio Montes
ee21903287
Merge pull request #115 from teawater/virtio-mem
qmp: Add ExecMemdevAdd and ExecQomSet API
2020-01-21 08:58:30 -06:00
Hui Zhu
6667f4e90b qmp_test: Add TestExecMemdevAdd and TestExecQomSet
Add TestExecMemdevAdd and TestExecQomSet to qmp_test.go.
They can test ExecMemdevAdd and ExecQomSet.

Signed-off-by: Hui Zhu <teawater@antfin.com>
2020-01-21 10:26:59 +08:00
Hui Zhu
201fd0ae82 qmp: Add ExecMemdevAdd and ExecQomSet API
Add ExecMemdevAdd and ExecQomSet API to support virtio-mem.

Signed-off-by: Hui Zhu <teawater@antfin.com>
2020-01-19 14:51:17 +08:00
Mark Ryan
94145ff380
Merge pull request #114 from dong-liuliu/xliu2/vhost-user-dev
qmp: add ExecutePCIVhostUserDevAdd and ExecuteChardevDel to hotplug vhost-user device
2020-01-15 10:03:26 +01:00
Liu Xiaodong
e04be2cc38 qmp: add ExecutePCIVhostUserDevAdd API
Caller can hotplug vhost-user device via qmp.
The Qemu vhost-user device, like vhost-user-blk-pci and
vhost-user-scsi-pci can be hotplugged by qmp API:
ExecuteCharDevUnixSocketAdd() together with
ExecutePCIVhostUserDevAdd()

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-01-14 00:41:53 -05:00
Liu Xiaodong
13aeba09d5 qmp: support command 'chardev-remove'
So that caller can remove hotremove chardev via qmp

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-01-14 00:12:04 -05:00