Commit Graph

151 Commits

Author SHA1 Message Date
Rob Bradford
2706a07be5 qemu: Use the supplied context.Context for launching
This will kill the process when the context is cancelled. As using a nil
context is not permitted it is necessary to substitute with a real
context if it is not initialised in the Config struct.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2018-08-14 15:09:49 +01:00
Sebastien Boeuf
24ee4be532
Merge pull request #32 from amshinde/add-share-rw
disk: Add --share-rw option for hotplugging disks
2018-08-13 14:44:28 -07:00
Mark Ryan
c202f5d0ba
Merge pull request #30 from xindazhao/gpu-vfio-mdev
qemu/qmp: add vfio mediated device support
2018-08-13 22:07:21 +01:00
Mark Ryan
f3ab90f21b
Merge pull request #35 from rbradford/rtc-valid-tweak
qemu: Do not try and generate invalid RTC parameters
2018-08-10 15:11:15 +01:00
Rob Bradford
e46092e03a qemu: Do not try and generate invalid RTC parameters
If no RTC is specified in the config then do not generate any RTC command line
options. RTC command line options are optional for QEMU so make Valid() return
false when presented with the empty version of the RTC struct containing empty
strings.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2018-08-10 14:54:22 +01:00
Zhao Xinda
fcaf61dcb1 qemu/qmp: add vfio mediated device support
In addition to normal VFIO device, this patch adds VFIO mediated device
as a supplement to do hot plug on PCI(E) bridges.

Signed-off-by: Zhao Xinda <xinda.zhao@intel.com>
2018-08-10 12:43:22 +08:00
Archana Shinde
4461c459a3 disk: Add --share-rw option for hotplugging disks
With qemu 2.10, a write lock was added for qcow images that
prevents the same image to be passed more than once.
This can be over-ridden using the --share-rw option which is
desired for raw images.

This solves an issue with running Kata with devicemapper
using the privileged mode as in this case all devices on the host
are passed to the container using the block device associated
with the rootfs, causing it to be passed twice to qemu.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-08-08 14:48:02 -07:00
Sebastien Boeuf
301ea5e989
Merge pull request #34 from devimc/topic/addrBusVsock
qemu/qmp: add addr and bus to hotplug vsock devices
2018-08-08 08:44:09 -07:00
Julio Montes
685199980d qemu/qmp: add addr and bus to hotplug vsock devices
For machines types based on PCIe like q35, device addr and bus must be specified.
For machines types based on PCI like pc, device addr must be specified and bus
is optional since devices can be hot plugged directly on the root bus.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-08 09:53:09 -05:00
Sebastien Boeuf
eda239928b
Merge pull request #33 from caoruidong/hotplug-by-fds
qemu/qmp: add function for hotplug network by fds
2018-08-08 07:49:07 -07:00
Ruidong Cao
10efa84132 qemu/qmp: add function for hotplug network by fds
Implement function to hotplug a network device to QEMU by fds.
Macvtap can only be hotplug by this way.

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-08-08 11:12:47 +08:00
Mark Ryan
8d626afb0c
Merge pull request #31 from devimc/topic/virtserialportHotplug
qemu/qmp: implement functions to hotplug chardevs and serial ports
2018-08-06 18:44:34 +01:00
Julio Montes
80ed88edb1 qemu/qmp: implement function to hotplug serial ports
Implement function to hotplug virtio serial ports, the serial ports
are visible in the guest at the directory /dev/virtio-ports.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-03 13:50:25 -05:00
Julio Montes
ca46f21f3f qemu/qmp: implement function to hotplug character devices
implement function to hotplug character devices using as backend
unix sockets, binding a character device with a serial port allows
the communnication between processes running in the guest with
processes running in the host.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-03 08:01:05 -05:00
Sebastien Boeuf
1c5466db3d
Merge pull request #23 from devimc/topic/vsockHotplug
qemu: add vhostfd and disable-modern to vsock hotplug
2018-08-03 01:19:55 -07:00
Sebastien Boeuf
a5cbc6122f
Merge pull request #19 from markdryan/static-checks
Add two additional static analysis tools to the travis builds
2018-08-03 01:19:22 -07:00
Julio Montes
03f1a1c3a8 qemu/qmp: implement getfd
`getfd` receives a file descriptor via SCM rights and assign it a name,
this command is useful to send file descriptors from the host, and then
hot plug devices that needs file descriptors like vhost-vsock-pci devices.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-02 11:07:16 -05:00
Julio Montes
84b212f1b8 qemu: add vhostfd and disable-modern to vsock hotplug
`vhostfd` is used to specify the vhost-vsock device fd, and it holds
the context ID previously opened.

`disable-modern` is to disable the use of "modern" devices, by using virtio 0.9
instead of virtio 1.0. Particularly, this is useful when running the VM in a
nested environment.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-08-02 11:07:16 -05:00
Sebastien Boeuf
131c8d0caa
Merge branch 'master' into static-checks 2018-08-02 08:27:54 -07:00
Sebastien Boeuf
79e74d936b
Merge pull request #24 from caoruidong/master
qemu/qmp: implement function for hotplug network
2018-07-25 09:44:51 -07:00
Ruidong Cao
12dfa87293 qemu/qmp: implement function for hotplug network
Implement function to hotplug and delete a network device to QEMU

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-07-25 17:39:23 +08:00
Sebastien Boeuf
6ff20ae2f4
Merge pull request #25 from devimc/topic/improveVSockColdplug
qemu: add vhostfd and disable-modern to vhost-vsock-pci
2018-07-24 16:20:31 -07:00
Julio Montes
3830b4419f qemu: add vhostfd and disable-modern to vhost-vsock-pci
`vhostfd` is the vhost file descriptor that holds the socket context ID
`disable-modern` prevents qemu from relying on fast MMIO

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-24 15:24:43 -05:00
Mark Ryan
db7e149611
Merge pull request #22 from devimc/topic/vsockHotplug
qemu/qmp: implement function to hotplug vsock-pci
2018-07-17 09:07:44 +01:00
Julio Montes
f700a97bee qemu/qmp: implement function to hotplug vsock-pci
Implement function to hotplug vsocks, vsocks are needed
to communicate processes are running inside the VM
with processes are running on the host.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-16 14:19:43 -05:00
Mark Ryan
4ca232ecdf qmp_test: Fix Warning and Error level logs
This commit fixes an issue with the log handlers defined by qmp_test.
The issue was picked up by the latest version of go vet on go tip.

qemu/qmp_test.go:56::error: missing ... in args forwarded to printf-like function (vet)
qemu/qmp_test.go:60::error: missing ... in args forwarded to printf-like function (vet)

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 16:05:00 +01:00
Mark Ryan
430e72c63b qemu,qmp: Enable gas security checker
This commit enables the gas security checker on govmm builds.  The
security checker has signalled 4 issues all of which I've checked
and have determined to be non issues.  These issues are disabled
by this commit.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 15:56:27 +01:00
Mark Ryan
ffc06e6bc4 qemu,qmp: Add staticcheck to travis and fix errors
This commit enables staticcheck in the travis builds and fixes the existing
errors detected by staticcheck.  There was one type of error repeated in
qemu.go in which the type of some constants was not explicitly specified.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-06-28 15:11:13 +01:00
Sebastien Boeuf
ff2401825e
Merge pull request #18 from bergwolf/templating
Add APIs to enable vm templating
2018-06-25 07:58:45 -07:00
Peng Tao
54caf7810b qmp: add hotplug memory
It adds size of MiB memory to the guest.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
e66a9b481b qemu: add appendMemoryKnobs helper
To fix travis failure about cyclomatic complexity in appendKnobs().

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
8aeca15388 qmp: add migrate set arguments
It allows to set migration arguments so that callers can control how
migration is done.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
a03d4968e1 qmp: add set migration capabilities
It allows to set guest migration capabilities.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:28 +08:00
Peng Tao
0ace4176b4 qemu: allow to set migration incoming
It is useful when we want to specify migration incoming source.
Supported source are fd and exec right now.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-23 11:39:23 +08:00
Peng Tao
723bc5f3c6 qemu: allow to create a stopped guest
When Knobs.Stopped is set, the guest CPU will not be started at startup.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-19 14:56:34 +08:00
Peng Tao
283d7df99e qemu: add file backed memory device support
It allows a caller to use a local file as the memory backend of the
guest, and it also allows the file backed memory device to be set shared
or not.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-06-19 14:55:47 +08:00
Sebastien Boeuf
9cf8ce6c6d
Merge pull request #15 from amshinde/pass-addr-bridge
qemu: Add qemu parameter for PCI address for a bridge.
2018-04-03 12:21:35 -07:00
Archana Shinde
30aeacb89e qemu: Add qemu parameter for PCI address for a bridge.
We need to be able to specify the PCI slot for a bridge while
adding it.
Add test to verify bridge is correctly added.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-04-03 12:10:02 -07:00
Sebastien Boeuf
1509acf186
Merge pull request #14 from amshinde/scsi-iothreads
Add ability to associate a SCSI controller device with an iothread
2018-03-29 10:35:47 -07:00
Archana Shinde
9130f37516 scsi: Allow scsi controller to associate with an IO thread.
This enable data-plane for scsi. All drives attached to the
scsi controller will have their IO processed in a single separate
IO thread instead of qemu's main event loop.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-28 17:02:47 -07:00
Archana Shinde
a54de1835b iothread: Add ability to configure iothreads
IOthreads also known as x-data-plane allow IO to
be processed in a separate thread rather than the main event
loop. This produces much better IO throughput and latency.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-03-28 17:02:47 -07:00
Mark Ryan
82c67ab9b2
Merge pull request #12 from bergwolf/initrd
qemu: add initrd support
2018-03-20 11:02:07 +00:00
Peng Tao
0c0ec8f3c9 qemu: add initrd support
Append initrd image to qemu arguments if configured.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-20 16:42:39 +08:00
Mark Ryan
e87160f8ea
Merge pull request #11 from devimc/scsi/disable_modern
qemu: add DisableModern to SCSIController
2018-03-06 18:39:29 +00:00
Julio Montes
68f3071806 qemu: add DisableModern to SCSIController
DisableModern prevents qemu from relying on fast MMIO.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-03-06 12:11:02 -06:00
Mark Ryan
d60256118f
Merge pull request #9 from devimc/qemu/extraOptions
qemu: add extra options for the machine type
2018-02-12 15:33:44 +00:00
Julio Montes
693d9548dc qemu: add options for the machine type
certain machines types need to have options to enable or disable features
For example the machine type virt in certain hosts must have the gic version
(gic-version=3 or gic-version=host) to start without problems

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-02-12 09:27:30 -06:00
Mark Ryan
065d1d2517
Merge pull request #7 from amshinde/scsi-device-add
scsi: Add function to send device_add qmp command for a scsi device
2018-01-12 11:09:25 +00:00
Archana Shinde
3273aafd53 scsi: Add function to send device_add qmp command for a scsi device
device_add qmp command for scsi devices accepts additional parameters like
scsi-id and lun. Implement function to add scsi devices. Devices
with drivers "scsi-hd", "scsi-cd" and "scsi-disk" are accepted.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-01-11 18:19:10 -08:00
Julio Montes
22c99930c2
Merge pull request #8 from markdryan/coveralls
Compute coverage statistics for unit tests in Travis builds
2018-01-04 14:00:30 -06:00