Commit Graph

376 Commits

Author SHA1 Message Date
David Gibson
d27256f863 qmp: Don't use deprecated 'props' field for object-add
Use of the 'props' argument to 'object-add' has been deprecated since QEMU
5.0 (commit 5f07c4d60d09) in favor of flattening the properties directly
into the 'object-add' arguments.  Support for 'props' is removed entirely
in qemu 6.0 (commit 50243407457a).

fixes #193

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-08-04 13:42:41 +10:00
David Gibson
d8cdf9aa2a qemu: Drop support for versions older than 5.0
Kata requires version 5.2 (or 5.1 on ARM) anyway.  Simplify code by
dropping support for older versions.  In any case explicit checks against
version number aren't necessarily reliable for patched qemu versions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-08-04 13:42:41 +10:00
David Gibson
40843efc26
Merge pull request #192 from dgibson/host-device
Use 'host_device' driver for blockdev backends
2021-07-29 17:03:44 +10:00
David Gibson
1b02192986 Use 'host_device' driver for blockdev backends
ExecuteBlockdevAdd() and ExecuteBlockdevAddWithCache() both appear to be
intended to create block devices in the guest which backend onto a block
device in the host. That seems to be the way that Kata always uses it.
However blockdevAddBaseArgs(), used by both those functions always uses the
"file" driver, which is only intended for use with regular file backends.

Use of the "file" driver for host block devices was deprecated in qemu-3.0,
and has been removed entirely in qemu-6.0 (commit 8d17adf34f5).  We should
be using the "host_device" driver instead.

fixes #191

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-07-29 13:32:39 +10:00
Julio Montes
b507f32392
Merge pull request #186 from LiangZhou-CTY/master
add support for "sandbox" feature to qemu
2021-07-23 08:36:57 -05:00
Liang Zhou
9518675e11 add support for "sandbox" feature to qemu
Update the govmm code in order to support "sandbox" feature on qemu,
which can introduce another protect layer on the host,
to make the secure container more secure.

Fixes: #185

Signed-off-by: Liang Zhou <zhoul110@chinatelecom.cn>
2021-07-23 04:24:40 -07:00
Archana Shinde
0173713ea9
Merge pull request #187 from devimc/2021-07-21/nvdimmRO
qemu: support read-only nvdimm
2021-07-22 04:53:11 -07:00
Julio Montes
7e200ea9d7
Merge pull request #188 from devimc/2021-07-21/gomods
Support golang 1.16
2021-07-21 15:35:12 -05:00
Julio Montes
335fa81667 qemu: fix golangci-lint errors
fix golangci-lint errors

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-07-21 15:08:12 -05:00
Julio Montes
61b6378749 .github/workflows: reimplement github actions CI
* Remove golang 1.13 and 1.14, add golang 1.16
* gometalinter has been deprecated, use golangci-lint instead

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-07-21 15:08:07 -05:00
Julio Montes
9d6e7970b6 go: support go modules
Add go.mod file to support Golang 1.16.x

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-07-21 11:38:07 -05:00
Julio Montes
0d21263a9b qemu: support read-only nvdimm
Append `readonly=on` to a `memory-backend-file` object and
`unarmed=on` to a `nvdimm` device when `ReadOnly` is set to `true`

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-07-21 11:26:19 -05:00
James O. D. Hunt
f3533734ac
Merge pull request #184 from Jakob-Naucke/consistent-joins
qemu: Consistent parameter building
2021-07-19 09:37:54 +01:00
Jakob Naucke
ff34d283db
qemu: Consistent parameter building
Always join by ",", do not put commas in the parameter slices. Always
use the variable name `deviceParams`.

Fixes: #180
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-07-16 15:14:14 +02:00
Fabiano Fidêncio
263136e69a
Merge pull request #177 from marcel-apf/memdev-on-bridge
qemu: Allow hot-plugging memory devices on PCI bridges
2021-06-22 09:55:16 +02:00
Marcel Apfelbaum
0e19ffb67e qemu: Allow hot-plugging memory devices on PCI bridges
Currently virtio-mem-pci devices can be hotplugged only on the root bus.
This doesn't work for PCIe machines like q35.

Extend the API to optionally support hotplugging on PCI bridges.

Fixes: #176

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
2021-06-21 19:55:20 +03:00
Pradipta Banerjee
eb57f004d8
Merge pull request #175 from Amulyam24/pef
qemu: Add support for PEF
2021-05-20 19:54:20 +05:30
Amulyam24
c135681d9a qemu: Add support for PEF
Adding the support for Protected Execution Facility(PEF) is
which is the confidential computing technology on ppc64le.

Fixes: #174

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2021-05-20 13:50:25 +00:00
Julio Montes
6fd848e95e
Merge pull request #173 from Jakob-Naucke/sec-exec
qemu: Add support for Secure Execution
2021-05-20 07:59:01 -05:00
Jakob Naucke
03b55ea51d
qemu: Add support for Secure Execution
Secure Execution, also known as Protected Virtualization in QEMU, is a
confidential computing technology for s390x (IBM Z & LinuxONE). Allow
the respective object.

Fixes: #172

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-05-20 10:45:39 +02:00
Jakob Naucke
7a367dc0a8
qemu: Simplify (Object).Valid()
so that more object types can be added without going over cyclomatic
complexity limits

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-05-20 10:45:37 +02:00
Sandeep Gupta
a6cec2d38c qemu: add support for SevGuest object
Signed-off-by: Jim Cadden <jcadden@ibm.com>
2021-05-20 10:08:02 +02:00
Fabiano Fidêncio
f0e9a35308
Merge pull request #171 from Jakob-Naucke/fix-virtiofs-s390x
qemu: VhostUserDevice CCW device numbers
2021-04-28 18:36:04 +02:00
Jakob Naucke
abd3c7ea03
qemu: VhostUserDevice CCW device numbers
Add CCW (s390x) device numbers to VhostUserDevices, as is with other
device types. Add them to VhostUserFS devices (the only type currently
supported on s390x) when building QEMU parameters.

Fixes: #170

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-04-28 00:28:25 +02:00
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