Commit Graph

227 Commits

Author SHA1 Message Date
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
NingBo
7da6a4c7c6 qmp: fix mem-path properties for hotplug memory.
The QMP command 'object-add' only has three arguments: 'qom-type'
'id' and 'props', thus 'mem-path' has to be saved in 'props'.
https://github.com/qemu/qemu/blob/stable-2.0/qapi-schema.json#L2958
https://github.com/qemu/qemu/blob/stable-2.12/qapi/misc.json#L1846

Signed-off-by: NingBo <ning.bo9@zte.com.cn>
2018-11-29 09:56:26 +08:00
Sebastien Boeuf
60a5f7ca7f
Merge pull request #64 from alicefr/preparation
qemu/qmp: preparation for s390x support
2018-11-27 19:23:58 +00:00
Sebastien Boeuf
c664d3dd94
Merge pull request #60 from teawater/cache
qemu/qmp: add new function ExecuteBlockdevAddWithCache
2018-11-27 07:46:36 +00:00
Alice Frosi
e4892e3396 qemu/qmp: preparation for s390x support
This PR prepares for the s390x support. It introduces:
 - a generalization of ccw and pci devices. The variables for the pci devices
   have been renamed by removing the Pci suffix. They have been moved to the
   qemu_arch_base.go
 - the mapping isVirtioPCI has been move to qemu_arch_base.go because in
   this way a different mapping can be added for other architecture (e.g
   s390x)
 - the functions QemuNetdevParam and QemuDeviceParam have been moved to
   qemu_arch_base.go. In this way, they could be reimplemented for other
   architecture for the case VHOSTUSER
 - a function disableModern has been introduced to check if the device is
   a pci device and then returns the right parameters. In the case of ccw
   devices, they don't have the disable-modern flag
 - a function mqParameter has been introduced to return the right
   parameters for the mq case. The virtio-net-ccw device doesn't have the
   vectors flag
 - in qemu_arch_base_test.go contains the test and strings that can be
   overwritten for other architectures (e.g s390). The devices names and
   the flags for the devices can be overwritten.
 - the string for the romfile has been replaced by a variable romfile
   that could be left empty if the devices doesn't support a romfile as
   for the ccw devices for s390.
 - clean-up: the disable-modern=on/off options have been changed to
   disable-modern=true/false. In the code there was a mixture of on/true
   off/false

Fixes: #61

Co-authored-by: Yash D Jain <ydjainopensource@gmail.com>
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-11-23 10:15:09 +00:00
Hui Zhu
110d2fa049 qemu/qmp: add new function ExecuteBlockdevAddWithCache
ExecuteBlockdevAddWithCache has two more parameters direct and noFlush
than ExecuteBlockdevAdd.
They are cache-related options for block devices that are described in
https://github.com/qemu/qemu/blob/master/qapi/block-core.json.
direct denotes whether use of O_DIRECT (bypass the host page cache)
is enabled.  noFlush denotes whether flush requests for the device are
ignored.

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-11-23 17:23:06 +08:00
Hui Zhu
a0b0c86e9c qmp_test: Change QMP version from 2.6 to 2.9
Also change TestQMPXBlockdevDel to TestQMPBlockdevDel because QMP verion
2.9 and older use blockdev-del but not x-blockdev-del.

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-11-23 09:33:21 +08:00
Mark Ryan
99e0358ba9
Merge pull request #63 from jingxiaolu/add_pidfile
qemu: add support for pidfile option
2018-11-22 08:57:25 +01:00
l00397676
10c36a13da qemu: add support for pidfile option
Add input for -pidfile option of qemu, so that we can get pid of
qemu main process, and apply resource limitations to it.

Fixes #62

Signed-off-by: l00397676 <lujingxiao@huawei.com>
2018-11-21 19:51:49 +08:00
Sebastien Boeuf
e82e8498c5
Merge pull request #59 from sboeuf/fix_virtio-net-pci
qemu: Fix virtio-net-pci QMP command
2018-10-16 14:14:23 -07:00
Sebastien Boeuf
9c819db5a3 qemu: Fix virtio-net-pci QMP command
This patch fixes the wrong behavior of specifying a netdev, MAC
address or PCI address entry when those were empty. Instead, it
does not provide those entries if the content is empty.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-10-16 13:20:55 -07:00
Manohar Castelino
b1635d5dcb
Merge pull request #56 from sboeuf/fix_romfile
qemu: Add support for romfile option
2018-10-12 10:26:31 -07:00
Sebastien Boeuf
7fdfc6a4c9 qemu: Add support for romfile option
Any device inheriting from virtio-pci can specify a ROM file. This
option is provisioned by default with "efi-virtio.rom", but most
of the time, firmwares such as OVMF or seabios will already support
what is provided by this ROM file.

In order to reduce the "forced" dependency on such ROM file, govmm
should provide an empty path if the consumer of the library does not
provide one.

This patch reorganizes the list of devices, so that it gets easier to
list which devices inherit from virtio-pci, and then adds the romfile
option to every single device that support this option.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-10-10 17:17:36 -07:00
Rob Bradford
35b7308881
Merge pull request #57 from markdryan/contributing-security
Update guidelines on security issue reporting
2018-10-10 15:09:21 +01:00
Mark Ryan
e74de3c7f1 Update guidelines on security issue reporting
This commit clarifies the process to be used when reporting security issues.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-10-10 10:05:58 +02:00
Sebastien Boeuf
5770f40f4b
Merge pull request #55 from jcvenegas/virtio-balloon
qemu: Add virtio-balloon device suppport.
2018-10-05 10:53:46 -07:00
Jose Carlos Venegas Munoz
ec83abe69e qemu: Add virtio-balloon device suppport.
Add support for virtio-balloon.

- Add test
- Support disable-modern
- Support deflate-on-oom

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-10-05 11:18:31 -05:00
Rob Bradford
53c0c33bb2
Merge pull request #54 from jodh-intel/show-qemu-path-on-launch
qemu: Show full path to qemu binary at launch time
2018-10-03 16:48:47 +01:00
James O. D. Hunt
46970781fa qemu: Show full path to qemu binary at launch time
Rather than show the generic "qemu", log the full path to the
particular qemu binary being used.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-03 16:41:08 +01:00
Sebastien Boeuf
f03df80fc3
Merge pull request #53 from sboeuf/fix_pcie_bridge
qemu: Fix the support of PCIe bridge
2018-10-02 15:47:02 -07:00
Sebastien Boeuf
ef7250508c qemu: Fix the support of PCIe bridge
In case the type of bridge is PCIEBridge, which we expect as ending
up using pcie-pci-bridge device from Qemu, the properties chassis_nr
and shpc don't exist.

This commit simply fixes this use case by removing those parameters
from the command line.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-10-02 15:35:49 -07:00
Mark Ryan
6ba3b3fad1
Merge pull request #51 from bergwolf/ExecuteQueryMigration
qmp: add ExecuteQueryMigration
2018-09-28 15:18:36 +02:00
Peng Tao
56f645eac6 qmp: add ExecuteQueryMigration
It sends query-migrate qmp command to check migration status.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-09-28 21:10:21 +08:00