Commit Graph

286 Commits

Author SHA1 Message Date
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
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
Ace-Tang
8fd28e23ac Support x-pci-vendor-id and x-pci-device-id pass to qemu
since some vendor id like 1ded can not be identified by virtio-pci
driver, so upper level need to pass a specified vendor id to qemu.

the upper level will change unavailable id and pass it to qemu.

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-07-09 12:19:51 +08:00
Mark Ryan
8d18f344c5
Merge pull request #99 from alicefr/devno-blk-ccw
Support for virtio-blk-ccw
2019-07-05 09:09:09 +02:00
Alice Frosi
713d0d9406 s390x: add virtio-blk-ccw type
In order to hotplug virtio-blk, on s390x the CCW device drivers is used
instad of PCI.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-07-05 08:08:25 +02:00
Alice Frosi
65cc343f7b test: add devno in the tests for s390x
Add test with devno param

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-07-05 08:08:25 +02:00
Alice Frosi
9cf98da0be s390x: add devno support
DevNo is used to identify the ccw device for s390x systems

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-07-05 08:08:25 +02:00
Julio Montes
9f389cb319
Merge pull request #96 from ganeshmaharaj/mem-hotplug-share
Allow sharing of memory backend file
2019-06-18 12:18:17 -05:00
Ganesh Maharaj Mahalingam
0c900f596e Allow sharing of memory backend file
Hotplugged memory could be backed by a file on the host with sharing
turned on. This change allows qmp to pass that option to a govmm.

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-06-18 08:07:17 -07:00
Mark Ryan
516e0c5b7c
Merge pull request #95 from bergwolf/migration-incoming
qemu: add migration incoming defer support
2019-06-14 14:05:33 +02:00
Peng Tao
f695ddf8f3 qemu: add migration incoming defer support
qemu commandline supports -incoming defer
and qmp supports migrate-incoming uri.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-06-14 00:24:26 -07:00
Sebastien Boeuf
27363b1aca
Merge pull request #94 from bergwolf/multiqueue
qmp: add virtio-blk multiqueue
2019-05-28 08:00:15 -07:00
Peng Tao
f0f18dd0f2 qmp: add virtio-blk multiqueue
Hotplug virtio-blk with multiqueue support.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-05-27 20:40:12 -07:00
Mark Ryan
a6e2655b90
Merge pull request #93 from lifupan/fixvirtioblkdriver
qemu: fix the issue of wrong driver for VirtioBlock
2019-04-17 09:22:32 +02:00
lifupan
7d3deea4fc qemu: Add a virtio-blk-pci device driver support
Add a pci bus based virtio block device driver support.

Fixes:#92

Signed-off-by: lifupan <lifupan@gmail.com>
2019-04-16 11:45:50 -04:00
Julio Montes
b3e7a9e784
Merge pull request #91 from stefanha/virtio-fs-cache-size-mb
qemu: use MiB instead of Gib for virtio-fs cache size
2019-04-09 11:33:17 -05:00
Stefan Hajnoczi
058cda0603 qemu: use MiB instead of Gib for virtio-fs cache size
QEMU supports finer-grained units than GiB.  Change the cache size to
MiB so users have more control over the cache size.

Note that changing the semantics of the CacheSize field is fine because
there are no users of this API yet.  kata-runtime will be the first
users and prefers MiB instead of GiB.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-04-09 10:21:43 +01:00
Mark Ryan
35a8fd3ca9
Merge pull request #90 from devimc/topic/FixQemu4qmp
qemu/qmp: re-implement mainLoop
2019-04-08 09:38:17 +02:00
Julio Montes
694a7b1c61 qemu/qmp: re-implement mainLoop
In newer versions of QEMU, like 4.0-rc2, QMP events can be thrown even before
the QMP-version response, one example of this behaviour is when a virtio serial
is closed and a VSERPORT_CHANGE event is thrown.
Re-implement mainLoop to check the data received from the VM channel, since
it's not a guarantee that the first data read from the VM channel is the
QMP version.

fixes https://github.com/kata-containers/runtime/issues/1474

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-05 13:25:22 -06:00
Julio Montes
4963fb587f
Merge pull request #89 from woshijpf/master
qemu/qmp: fix readLoop() reuse scanner.Bytes() underlying array problem
2019-03-13 08:49:08 -06:00
jiangpengfei
5712b1198e qemu/qmp: fix readLoop() reuse scanner.Bytes() underlying array problem
Since []byte channel type transfer slice info(include slice underlying array pointer, len, cap)
between channel sender and receiver. scanner.Bytes() function returned slice's underlying array
may point to data that will be overwritten by a subsequent call to Scan(reference from:
https://golang.org/pkg/bufio/#Scanner.Bytes), which may make consecutive scan() call write the
read data into the same underlying array which causes receiver read mixed data,so we need to
copy line to new allocated space and then send to channel receiver to solve this problem.

Fixes: #88

Signed-off-by: jiangpengfei <jiangpengfei9@huawei.com>
2019-03-13 19:45:05 -04:00
Mark Ryan
b48780f3d3
Merge pull request #86 from stefanha/virtio-fs
govmm: add VhostUserFS vhost-user device type
2019-02-20 17:57:34 +01:00
Stefan Hajnoczi
3c84b1daa3 govmm: add VhostUserFS vhost-user device type
The QEMU vhost-user-fs-pci device provides virtio-fs host<->guest file
system sharing (https://virtio-fs.gitlab.io/).  The device is
instantiated like this:

  $ qemu -chardev socket,path=/tmp/vhost-fs.sock,id=chr0
         -device vhost-user-fs-pci,tag=myfs,chardev=chr0,cache-size=4G,versiontable=/dev/shm/fuse_shared_versions

This patch adds the VhostUserFS DeviceDriver and command-line generation
for this QEMU device.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-02-19 13:03:18 +00:00