Commit Graph

307 Commits

Author SHA1 Message Date
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
Mark Ryan
dfb6cf6041
Merge pull request #112 from alicefr/enable-travis-s390x
s390x: add s390x travis support
2019-12-18 08:42:39 +01:00
Alice Frosi
6d6b2d8892 s390x: add s390x travis support
Since we have travis support for s390x. Let's enable it

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-12-17 14:54:09 +01:00
Mark Ryan
8cba5a8e5f
Merge pull request #109 from jschintag/qemu-img-sharing
virtio-blk: Add support for share-rw flag
2019-09-16 09:15:17 +02:00
Jan Schintag
cb9f640b4e virtio-blk: Add support for share-rw flag
This allows multiple instances of qemu to share the same file for
virtio-blk device.

Fixes: #108
Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
2019-09-13 08:58:23 +02:00
Mark Ryan
ee460e3008
Merge pull request #107 from alicefr/no-numa-bck-mem
s390x: dimm not supported
2019-09-02 10:22:18 +02:00
Alice Frosi
9463486d58 s390x: dimm not supported
Dimm is not supported on s390x

Fixes: #106
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-08-27 08:37:21 +02:00
Julio Montes
e6644f4a25
Merge pull request #105 from bergwolf/interaction
improve qemu interaction
2019-08-14 08:01:15 -05:00
Peng Tao
164bd8cd22 test/fmt: drop extra newlines
They are unneeded.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-14 00:32:03 -07:00
Peng Tao
73555a409c qmp: add query-status API
So that caller can find out guest status via qmp.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-14 00:32:03 -07:00
Peng Tao
234e0edfd7 qemu: fix memory prealloc handling
Memory preallocation is just a property of different memory backends.
We should treat it similar to memory sharing property. Also rename
FileBackedMemShared to MemShared as it is just another memory backend
property that works with different memory backends not just file backed
memory.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-14 00:32:00 -07:00
Peng Tao
30bfcaaa6d qemu: add debug logfile
When LogFile is specified, output debug log there.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-13 01:44:45 -07:00
Mark Ryan
aa341b005e
Merge pull request #104 from BetaXOi/query-schema
qmp: support command 'query-qmp-schema'
2019-08-01 11:36:29 +02:00
Ning Bo
79e0d5333d qmp: support command 'query-qmp-schema'
The upper hyervisor manager application maybe need to wait some
QMP event to control boot sequence, but the event we wanted maybe
not exist in some older version, so we need query all QMP ABI and
check the event is supported or not.

related: kata-containers/runtime#1918

Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
2019-08-01 17:14:54 +08:00
Julio Montes
e0505242c0
Merge pull request #103 from alicefr/cpu_topology
qmp: add checks for the CPU toplogy
2019-07-26 08:59:28 -05:00
Alice Frosi
68cdf64fe5 test: add cpu topology tests
Add cpu driver types in TestQMPCPUDeviceAdd

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-07-26 14:27:25 +02:00
Alice Frosi
e0cf9d5c14 qmp: add checks for the CPU toplogy
Support for function isSocketIDSupported, isThreadIDSupported and isDieIDSupported.
The functions check if the cpu driver and the qemu version support the
id parameter.

Fixes: #102

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-07-26 14:27:25 +02:00
Mark Ryan
e894e7ad00
Merge pull request #101 from devimc/topic/supportQemu41
qemu: support x86 SMP die
2019-07-25 15:12:41 +02:00
Julio Montes
a5c119086a qemu: support x86 SMP die
In QEMU 4.1 the CPU topology for x86 will change to:
`socket > die > core > thread`.
Add `die-id` field to `CPUProperties` and include it in CPU hotplugging

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-07-16 14:08:40 +00:00
Mark Ryan
52b2309a55
Merge pull request #100 from Ace-Tang/add-pci-param
Support x-pci-vendor-id and x-pci-device-id pass to qemu
2019-07-09 16:39:06 +02:00