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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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/947Fixes: #70
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
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>