Commit Graph

271 Commits

Author SHA1 Message Date
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
Julio Montes
78d079db6d
Merge pull request #84 from nitkon/master
qmp: Conditionally pass threadID and socketID when CPU device add
2019-01-28 10:43:02 -06:00
Nitesh Konkar
4692f6b965 qmp: Conditionally pass threadID and socketID when CPU device add
For vCPU hotplug to work on ppc64le, we need not
pass threadID and socketID. So conditionally pass
arguments when executing CPU device add.

Fixes: #83

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2019-01-28 21:44:41 +05:30
Sebastien Boeuf
b9c8f76ebe
Merge pull request #85 from markdryan/fix-travis
Fix travis
2019-01-28 08:02:40 -08:00
Mark Ryan
1f51b4386b Update the versions of Go used to build GoVMM
The .travis file was building GoVMM with some old of date versions of
Go that seem to be incompatible with the latest versions of gometalinter.
This commit updates the .travis file so that we build against 1.10 and
1.11.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:36:15 +01:00
Mark Ryan
ad310f9fde Fix staticcheck S1023
Static check was complaining about code that looked like

_ = <-ch

when it wants to see simply

<-ch

There was only one instance of this in govmm and this commit fixes
that instance.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:20:23 +01:00
Mark Ryan
932fdc7f50 Fix staticcheck S1023
By removing a redundant return statement.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:19:20 +01:00
Mark Ryan
cb2ce9339c Fix staticcheck S1008
static check was complaining about code that looked like

if x == "" {
  return false
}

return true

when what it wants to see is return x != "".  This commit fixes the issue.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:17:24 +01:00
Mark Ryan
f0172cd2a6 Fix staticcheck (S1002)
staticcheck was complaining about code that looked like

if x == true {

}

rather than

if x {

}

This commit fixes the issue.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:13:48 +01:00
Mark Ryan
5f2e630bda Fix staticcheck (S1025)
staticcheck was complaining as there were quite a lot of
fmt.Sprintf("%s",d) in the code where d was either a string or
had string as its underlying type.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 16:06:49 +01:00
Mark Ryan
4beea5133e Fix staticcheck (ST1005) errors
staticcheck was complaining as some of the error messages returned by
govmm began with a capital letter.  This commit fixes the issue.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2019-01-28 15:32:07 +01:00
Sebastien Boeuf
737f03de59
Merge pull request #76 from teawater/nvdimm
qmp: Add nvdimm support
2018-12-06 19:43:30 +00:00
Hui Zhu
97fc3435cf contributors: add my name
Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-06 11:35:15 +08:00
Hui Zhu
c891f5f84b qmp: Add nvdimm support
ExecuteNVDIMMDeviceAdd can add a nvdimm disk to qemu.
Not implement NVDIMM device delete function because qemu doesn't support it.

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-06 11:35:07 +08:00
Mark Ryan
32f64a0630
Merge pull request #81 from sboeuf/fix_qmp_disable_modern
qemu: Allow disable-modern option from QMP
2018-12-05 21:12:01 +01:00
Sebastien Boeuf
f9b31c0f80 qemu: Allow disable-modern option from QMP
For devices that actually support the option disable-modern, this
current commit provides a proper flag to the caller. This will allow
for better support when used in nested environment as virtio-pci
devices should rely on virtio 0.9 instead of 1.0 due to a bug in
KVM.

Fixes #80

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-05 09:16:41 -08:00