Commit Graph

192 Commits

Author SHA1 Message Date
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
Mark Ryan
c2d92fe208
Merge pull request #48 from bergwolf/memsize
qemu: skip setting system memory if it is set via dimm device
2018-09-26 08:53:24 +02:00
Peng Tao
a429677a0b govmm: fix memory prealloc
The memory-backend-ram should also be set to a numa node instead of
being inserted as a new device. Otherwise it becomes additional memory
and requires explicit online to be available, instead of just being a
backend of the memory specified by -m option.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-09-25 15:01:31 +08:00
Sebastien Boeuf
f3e45a09b7
Merge pull request #52 from WeiZhang555/qmp-query-cpus
qmp: add "query-cpus" support
2018-09-24 22:10:31 -07:00
Wei Zhang
1130aab85e qmp: add "query-cpus" support
Add "query-cpus" and "query-cpus-fast" to query CPU information from qemu

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2018-09-21 10:14:25 +08:00
Mark Ryan
9905ae92c5
Merge pull request #47 from xindazhao/gpu-vfio-mdev
qemu/qmp: add vfio mediated device support on root bus
2018-09-18 10:00:32 +02:00
Zhao Xinda
de5d278889 qemu/qmp: add vfio mediated device support on root bus
In addition to supporting hotplug for VFIO mediated device on PCI bridge,
this patch adds hotplug functionality on root bus.

When parameter bus and addr are set to be empty, the system will pick up
an empty slot on root bus.

Signed-off-by: Zhao Xinda <xinda.zhao@intel.com>
2018-09-18 15:54:53 +08:00
Mark Ryan
66bfe83589
Merge pull request #50 from markdryan/fix-perms
qemu/image: Reduce permissions of .iso creation dir
2018-09-13 11:59:19 +01:00
Mark Ryan
de00d7a681 qemu/image: Reduce permissions of .iso creation dir
The contents of .iso used to bootstrap VMs with cloudinit are
initialised using a precreated, short-lived  directory.  The
permissions on this directory were too lenient.  This commit
restricts access to this directory to the user and his/her group.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-09-13 09:18:47 +02:00
Mark Ryan
032705ba6a
Merge pull request #49 from caoruidong/undefault-vhost
qemu/qmp: nic can works without vhost
2018-09-11 11:36:32 +01:00
Ruidong Cao
1a1fee75e5 qemu/qmp: nic can works without vhost
If host doesn't support vhost_net, we won't pass vhost="on" in QMP.

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-09-11 11:45:31 +08:00
Rob Bradford
e2c716433e
Merge pull request #45 from jcvenegas/rng-knob
qemu: Add rng device .
2018-09-10 17:04:38 +01:00
Jose Carlos Venegas Munoz
6c3d84ea8c qemu: Add virtio RNG device.
Add support for virtio-rng divice.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-09-07 15:11:02 -05:00
Rob Bradford
25277d52ad
Merge pull request #44 from clarecch/master
qemu/qmp: support query-memory-devices qmp command.
2018-08-29 14:07:13 +01:00
Clare Chen
b16291cfab qemu/qmp: support query-memory-devices qmp command.
Implement query qemu memory devices function and testcase.

Signed-off-by: Clare Chen <clare.chenhui@huawei.com>
2018-08-28 23:19:52 -04:00
Julio Montes
1a16b5f98f
Merge pull request #42 from woshijpf/fix-qemu-2.8
govmm: modify govmm to be compatible with qemu 2.8
2018-08-24 11:52:20 -05:00
flyflypeng
ce070d11f7 govmm: modify govmm to be compatible with qemu 2.8
govmm has ExecuteBlockdevAdd() function and ExecuteBlockdevDel() function
doesn't compatible with qemu 2.8,because blockdev-add and x-blockdev-del usages
are different between qemu 2.7 and qemu 2.8

Follow the qemu 2.7 and qemu 2.8 qmp-commands.txt documents to modify ExecuteBlockdevAdd()
function and ExecuteBlockdevDel() function to be compatible with qemu 2.8

Signed-off-by: flyflypeng <jiangpengfei9@huawei.com>
2018-08-24 22:56:27 +08:00
Julio Montes
cb112dba2c
Merge pull request #41 from caoruidong/support-mq
qemu/qmp: support hotplug a nic whose qdisc is mq
2018-08-23 12:01:44 -05:00
Ruidong Cao
0286ff9e6e qemu/qmp: support hotplug a nic whose qdisc is mq
If we hotplug a nic with args mq=on, its qdisc will be mq by default.
This aligns with cold plug nics.

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2018-08-23 20:42:59 +08:00
Sebastien Boeuf
6aa35d33f2
Merge pull request #40 from rbradford/qmp-caps-comment
qmp: Remind users that you must first call ExecuteQMPCapabilities()
2018-08-22 10:14:33 -07:00
Rob Bradford
8515ae4817 qmp: Remind users that you must first call ExecuteQMPCapabilities()
Before calling any other command it is necessary to call
ExecuteQMPCapabilities() otherwise QEMU will not process the subsequent QMP
commands.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2018-08-22 17:07:21 +01:00
Rob Bradford
5a5e5b720f
Merge pull request #39 from sboeuf/vhost_hp
qemu/qmp: Add netdev_add with chardev support
2018-08-22 09:21:24 +01:00
Sebastien Boeuf
21504d31ff qemu/qmp: Add netdev_add with chardev support
In order to be able to hotplug network devices such as vhost user
net, we need to be able to define a previously declared chardev as
a parameter of this new network device.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-08-21 15:59:43 -07:00
Julio Montes
cfdbc15148
Merge pull request #38 from markdryan/negative
Add some negative test cases
2018-08-20 10:50:45 -05:00
Mark Ryan
ed34f61664 Add some negative test cases for qmp.go
This commit adds a couple of negative test cases for qmp.go, one
which checks that failed commands return errors and the other
checks that QMPStart exits gracefully when passed an invalid
socket path.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-08-20 15:40:37 +01:00
Mark Ryan
17cacc7238 Add negative test cases for qemu.go
This commit adds some negative test cases for the append functions
in qemu.go that build up the qemu command line.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
2018-08-20 15:40:37 +01:00
Rob Bradford
d8f80cafe3
Merge pull request #36 from rbradford/use-context-for-launch
qemu: Use the supplied context.Context for launching
2018-08-14 18:11:35 +01:00
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