Commit Graph

249 Commits

Author SHA1 Message Date
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
Mark Ryan
908b6aab14
Merge pull request #69 from BetaXOi/output-qmp-err
qmp: Output error detail when execute QMP command failed
2018-12-04 09:20:41 +01:00
Mark Ryan
d31bc8d300
Merge pull request #79 from markdryan/s390x-tests
Run tests for the s390x build
2018-12-03 16:37:12 +01:00
Mark Ryan
d6173077f1 Run tests for the s390x build
It turns out it is possible to run the unit tests for the s390x build
on travis by renaming the s390x specific files, so that their
inclusion in the build is determined only by tags and not by filename,
and by introducing a new tag s390x_test that we can use to force
their inclusion into a build by using this tag.  The .travis file is
then updated to include the line

go test --tags s390x_test ./...

This creates a build on travis that includes the s390x specific
files and runs the unit tests.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-12-03 15:56:20 +01:00
Mark Ryan
09923e8ed7
Merge pull request #78 from clarecch/master
Contributors: Add Clare Chen to CONTRIBUTORS.md
2018-12-03 12:34:54 +01:00
Clare Chen
b36b5a8f67 Contributors: Add Clare Chen to CONTRIBUTORS.md
Signed-off-by: Clare Chen <clare.chenhui@huawei.com>
2018-12-03 06:22:11 -05:00
Mark Ryan
900f3a1f18
Merge pull request #74 from markdryan/s390-travis
Verify govmm builds on s390x
2018-12-03 10:16:09 +01:00
Mark Ryan
2fbc7e5ed2
Merge pull request #77 from caoruidong/contri
Contributors: Add my name
2018-12-03 09:21:01 +01:00
Ruidong Cao
b41939c6b4 Contributors: Add my name
Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-12-03 20:48:35 +08:00
NingBo
dab4cf1d70 qmp: Add tests
Test execute QMP command with error response.

Signed-off-by: NingBo <ning.bo9@zte.com.cn>
2018-12-03 14:40:26 +08:00
Mark Ryan
5ea6da1448 Verify govmm builds on s390x
This commit adds a single command to the travis script that checks
that the s390x build works.  We can't run the unit tests but at
least we can check that everything builds on this architecture.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-11-30 15:20:26 +01:00
Mark Ryan
dddf0f08ea
Merge pull request #68 from alicefr/s390x
qemu: Add s390x support
2018-11-30 11:12:17 +01:00
Alice Frosi
ee75813ad1 contributors: add my name
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-30 10:14:45 +01:00
Alice Frosi
c80fc3b12f qemu: Add s390x support
The PR adds the s390x support. It sets the CCW devices and sets to false
all the devices in the mapping isVirtioPCI. It reimplements the functions
QemuNetdevParam and QemuDeviceParam to print an error message if the vhost-user
devices are used. It introduces a new function ExecuteNetCCWDeviceAdd for qmp
for the CCW devices.

Fixes: #37

Co-authored-by: Yash D Jain <ydjainopensource@gmail.com>
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-30 10:13:28 +01:00
Mark Ryan
c5440a8819
Merge pull request #73 from markdryan/contributing
Update file headers , CONTRIBUTING.md and add CONTRIBUTORS.md
2018-11-30 10:04:14 +01:00
Mark Ryan
ca477a18b6 Update source file headers
This commit updates the headers in the Go source files to adhere
to the new guidelines in the CONTRIBUTING.md file.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-11-30 09:34:21 +01:00
Mark Ryan
e68e005697 Update the CONTRIBUTING.md
The CONTRIBUTING.md file is updated to provide a template for new
source files and to invite contributors to add themselves to the
CONTRIBUTORS.md file.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-11-30 09:34:21 +01:00
Mark Ryan
2b7db5473f Add the CONTRIBUTORS.md file
This file is a partial list of contributors to the Virtual Machine
Manager for Go project. To see the full list of contributors,
see the revision history in source control.

Contributors who wish to be recognized in this file should add
themselves (or their employer, as appropriate).

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-11-30 09:34:20 +01:00
Mark Ryan
18948af4d4
Merge pull request #67 from BetaXOi/fix-mempath
qmp: fix mem-path properties for hotplug memory.
2018-11-30 08:49:21 +01:00
Rob Bradford
7efe742ea8
Merge pull request #71 from alicefr/vsock_cid
qemu: change Context ID for Vsock to uint64
2018-11-29 16:40:38 +00:00
Alice Frosi
b3b765cbe6 qemu: test Valid for Vsock for Context ID
Add test for the validation when the Context ID is larger than 32
bits

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-29 12:29:46 +00:00
Alice Frosi
3becff5f4e qemu: change of ContextID from uint32 to uint64
The correct type used by qemu and in kernel is uint64 and this leads to
an endianess problem with ioctl system call. See the issue
https://github.com/kata-containers/runtime/issues/947

Fixes: #70

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-29 12:29:29 +00:00
NingBo
f30fd1354a qmp: Output error detail when execute QMP command failed
Only get 'QMP command failed' error message now when execute QMP
command by 'executeCommandWithResponse' failed. This patch will
output more error detail.

Signed-off-by: NingBo <ning.bo9@zte.com.cn>
2018-11-29 16:32:14 +08:00