Commit Graph

352 Commits

Author SHA1 Message Date
Jakob Naucke
3eaeda7f6d
qemu: Refactor vhostuserDev.QemuParams
by splitting out the respective functionality to QemuNetParams,
QemuSCSIParams, QemuBlkParams, and QemuFSParams. This allows adding
functionality to these functions without going beyond the cyclomatic
complexity of 15 mandated by the lint checks.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-04-28 00:28:11 +02:00
Fabiano Fidêncio
7183b12b07
Merge pull request #166 from kata-containers/egernst-patch-1
qmp: remove chatty log
2021-04-26 23:36:31 +02:00
Chelsea Mafrica
092293f1d0
Merge pull request #169 from QiuMike/master
Fix qemu commandline issue with empty romfile
2021-04-23 18:58:27 -07:00
Michael Qiu
511cf58b0c Fix qemu commandline issue with empty romfile
Currently, if romfile field is empty, the commandline will
shows like below:
-device driver=virtio-net-pci,...,mq=on,vectors=4,romfile=

This does not make sense, just remove this field in commandline

Add unittest support.

Signed-off-by: Michael Qiu <qiudayu@huayun.com>
2021-04-22 04:09:16 -04:00
Julio Montes
8ba62b02ca
Merge pull request #164 from devimc/2021-03-30/tdxSupport
qemu: add support for tdx-guest object
2021-04-09 09:53:53 -05:00
Eric Ernst
b3eac95b28 qmp: remove frequent, chatty log
In Kata, we are getting a *lot* of logs at runtime from QMP, in particular `read from QMP: xxxx`

Ideally we'd set this to only be visible for trace, but I did not see this working when adding a
V(7) check around these prints. To avoid filling journal with info that isn't useful, let's drop.

Fixes: #165

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-04-01 09:09:32 -07:00
Julio Montes
3141894033 qemu: add support for tdx-guest object
support tdx-guest guest objects

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-03-30 16:18:11 -06:00
Fabiano Fidêncio
7fbc685865
Merge pull request #161 from Jakob-Naucke/memory-backend
qemu: Append memory backend for non-DIMM setups
2021-03-29 22:58:24 +02:00
GabyCT
4f6a403cde
Merge pull request #162 from devimc/2021-03-24/deviceLoader
qemu: add support for device loaders
2021-03-29 10:22:21 -06:00
GabyCT
164d28a27b
Merge pull request #163 from devimc/2021-03-24/supportQEMU6
qemu: support QEMU 6
2021-03-29 10:21:55 -06:00
Jakob Naucke
4b136f3f1c
qemu: Append memory backend for non-DIMM setups
Some architectures and setups do not support DIMM/NUMA. However, they
can still use memory backends, provided a memory backend of the same ID
is specified under -machine. This was introduced in QEMU 5.0. Enable
this functionality in appendMemoryKnobs.

Fixes: #160

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-03-29 15:53:39 +02:00
Julio Montes
6213dea42a qemu: support QEMU 6
Use `on` and `off` to enable or disable features,
`no` prefix is deprecated

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-03-24 11:05:24 -06:00
Julio Montes
0d47025d05 qemu: add support for device loaders
Devices loaders can be used to load some firmwares.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-03-24 10:35:45 -06:00
Eric Ernst
7d320e8f5d
Merge pull request #158 from egernst/blk-ro
qmp: Add ro argument for block-device hotplug funcs
2021-01-11 17:37:50 -08:00
Eric Ernst
e2eb549fcd qmp: Add ro argument for block-device hotplug funcs
We should allow users to specify if a block device should be hotplugged
as read-only.

Fixes: #157

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-01-11 15:33:20 -08:00
Julio Montes
5b0331c0fa
Merge pull request #156 from jongwu/dimm
qemu: add arm64 to support list of dimm
2020-11-19 07:48:48 -06:00
Jianyong Wu
0592c82536 qemu: add arm64 to support list of dimm
dimm is supported on arm64, so add is to check list.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Fixes: #155
2020-11-19 16:44:16 +08:00
Julio Montes
5e9aa08c4f
Merge pull request #154 from edmond-hk/pflash
qemu: enable "-pflash"
2020-10-22 10:38:25 -05:00
Edmond AK Dantes
2079c15c26 qemu: enable "-pflash"
flash image can store some critical data like firmware, enable it here.

Fixes: #140
Signed-off-by: Edmond AK Dantes <edmond.dantes.ak47@outlook.com>
2020-10-22 21:26:23 +08:00
Peng Tao
99f43ec188
Merge pull request #153 from liubin/feature/152-add-pvpanic-and-dump-guest-memory-support
qemu: add pvpanic and dump guest memory support
2020-10-20 13:20:39 +08:00
bin liu
b8cd705901 qmp: add dump-guest-memory support
By adding `dump-guest-memory` command, user can get kernel
memory dump when guest panic occurred.

Fixes: #152

Signed-off-by: bin liu <bin@hyper.sh>
2020-10-19 17:09:12 +08:00
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
Julio Montes
11b6ac380d
Merge pull request #151 from mazzy89/blk-device-serial
Add serial ID to blk device
2020-10-16 08:28:30 -05:00
Julio Montes
0bd15d6dbf
Merge pull request #150 from mazzy89/fix-fwcfg
Make fw_cfg a slice
2020-10-15 09:13:39 -05:00
Salvatore Mazzarino
43d774d27b Add serial to blk device
Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>
2020-10-12 17:35:06 +02:00
Salvatore Mazzarino
8cb8b24c05 Make fw_cfg a slice
Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>
2020-10-12 12:29:05 +02: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