]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
4 years agod/control: bump version dependency to libpve-guest-common-perl
Thomas Lamprecht [Fri, 18 Oct 2019 09:29:50 +0000 (11:29 +0200)]
d/control: bump version dependency to libpve-guest-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoQemuServer: sort and group used perl modules
Thomas Lamprecht [Fri, 18 Oct 2019 09:24:21 +0000 (11:24 +0200)]
QemuServer: sort and group used perl modules

group by:
* external
* pve, other package
* pve, same package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodestroy_vm: use write_config from our Config module to set an "empty" config
Thomas Lamprecht [Fri, 18 Oct 2019 09:21:58 +0000 (11:21 +0200)]
destroy_vm: use write_config from our Config module to set an "empty" config

brings us more in line with what we do in pve-container, also it's
good to not use file_set_contents directly if we have all those nice
wrapper interface methods to do things in a safe and guaranteed way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: use new base config provided destroy_config method
Thomas Lamprecht [Fri, 18 Oct 2019 09:12:39 +0000 (11:12 +0200)]
followup: use new base config provided destroy_config method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #2412: Missing VMs in pools
Dominic Jäger [Tue, 15 Oct 2019 10:17:41 +0000 (12:17 +0200)]
Fix #2412: Missing VMs in pools

Between calling vm_destroy and removing the ID from user.cfg (remove_vm_access)
creating a new VM with this ID was possible. VMs could go missing from pools as
a consequence.

Adding a lock solves this for clones from the same node. Additionally,
unlinking must happen at the very end of the deletion process to avoid that
other nodes use the ID in the meanwhile.

Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 years agoFix #2171: vm_start: volid based statefiles were not activated
Thomas Lamprecht [Thu, 17 Oct 2019 17:13:01 +0000 (19:13 +0200)]
Fix #2171: vm_start: volid based statefiles were not activated

So, while we could just make this a special case before the
config_to_command call and set the $conf->{vmstate} to the statefile
for the case were it's a valid volumeid, the special case handling
get's much easier when we do this outside of that method.

So it's basically a trade-off, and after looking far to long at all
nice revisions Alwin made for me and Fabians request, and even trying
out different approaches, it was never perfect.

But having slight code duplication over the movement mess I proposed
(as I did not had the full picture then, sorry Alwin) felt like the
slightly nicer trade off, as all worked I just use this one now, it
has very clear semantics, easy to understand and that now three lines
are duplicated is IMO irrelevant.

Co-developed-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: push vmstate to volid list to ensure it gets also deactivated
Thomas Lamprecht [Thu, 17 Oct 2019 17:10:43 +0000 (19:10 +0200)]
cfg2cmd: push vmstate to volid list to ensure it gets also deactivated

the volume id list is only used to activate before real start and
deactivate later, so use it for the vmstate file too.

This not only makes config_to_command have less side effects, it also
ensures that the vmstate is deactivated again

Co-developed-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2395: refactor qemu_img_convert to accept files as source
Dominik Csapak [Thu, 17 Oct 2019 11:32:34 +0000 (13:32 +0200)]
fix #2395: refactor qemu_img_convert to accept files as source

and use it also for efidisk creation and importdisk
this way we correctly handle zfs-over-iscsi options for those cases

also write tests for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoadd tests for qemu_img_convert
Dominik Csapak [Thu, 17 Oct 2019 11:32:33 +0000 (13:32 +0200)]
add tests for qemu_img_convert

Add tests for the qemu_img_convert parameters to the resulting
'qemu-img convert' call

we mock the 'run_command' and extract the 'cmd' parameter to
compare with what we expect

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agovm_start: don't reuse migrate_port variable for storage migration
Thomas Lamprecht [Mon, 14 Oct 2019 11:49:06 +0000 (13:49 +0200)]
vm_start: don't reuse migrate_port variable for storage migration

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoconfig_to_command: remove unused variable
Thomas Lamprecht [Mon, 14 Oct 2019 11:47:47 +0000 (13:47 +0200)]
config_to_command: remove unused variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2402: allow 1GB hugepages if 2MB is unavailable
Stefan Reiter [Thu, 10 Oct 2019 10:18:41 +0000 (12:18 +0200)]
fix #2402: allow 1GB hugepages if 2MB is unavailable

As reported in bug #2402, a system started with "default_hugepagesz=1G
hugepagesz=1G" does not have a /sys/kernel/mm/hugepages/hugepages-2048kB
directory.

To fix, ignore the missing directory in hugepages_mount (since it might
not be needed anyway), and correctly check if the requested hugepage
size is available in hugepages_size instead.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agotest cfg2cmd: add spice enhancement test
Thomas Lamprecht [Wed, 9 Oct 2019 14:50:37 +0000 (16:50 +0200)]
test cfg2cmd: add spice enhancement test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotest: cfg2cmd: do NOT sort expected/actual commands
Thomas Lamprecht [Wed, 9 Oct 2019 06:08:06 +0000 (08:08 +0200)]
test: cfg2cmd: do NOT sort expected/actual commands

In general it matters where a command line options is positioned
inside a QEMU command, so we want to actually also check the order in
the cfg2cmd test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: sort PCI bridges when adding them for stabillity
Thomas Lamprecht [Wed, 9 Oct 2019 05:51:08 +0000 (07:51 +0200)]
cfg2cmd: sort PCI bridges when adding them for stabillity

In general it matters where a command line options is positioned
inside a QEMU command, so we want to actually also check the order in
the cfg2cmd test, to do so we need to avoid false positives like this
added.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: fix serial-bus for spice foldersharing
Aaron Lauterer [Tue, 8 Oct 2019 15:56:15 +0000 (17:56 +0200)]
cfg2cmd: fix serial-bus for spice foldersharing

Thanks to Gilberto Nunes for finding a bug where the VM would not start
with foldersharing enabled and the qemu agent option disabled [0].

The cause was that the device org.spice-space.webdav.0 would not find a
virtio-serial-bus in this situation.

Since we always create a virtio-serial-bus for the spice vdagent it
seems sensible to use that also for the foldersharing device by moving
it in front of the other spice devices.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-October/039441.html

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agocfg2cmd: fix descriptions of cfg2cmd test cases
Stefan Reiter [Mon, 30 Sep 2019 10:58:55 +0000 (12:58 +0200)]
cfg2cmd: fix descriptions of cfg2cmd test cases

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agoqemu 4.0 : add Cascadelake-Server && KnightsMill cpu models
Alexandre Derumier [Mon, 30 Sep 2019 09:43:36 +0000 (11:43 +0200)]
qemu 4.0 : add Cascadelake-Server && KnightsMill cpu models

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 years agofix #2217: don't copy cloudinit disk on clone
Mira Limbeck [Wed, 25 Sep 2019 16:12:17 +0000 (18:12 +0200)]
fix #2217: don't copy cloudinit disk on clone

This removes the cloudinit disk from the list of drives to clone. As the
cloudinit disk is recreated on every VM start, it's not necessary to
clone it.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agobump version to 6.0-9
Thomas Lamprecht [Thu, 26 Sep 2019 09:28:20 +0000 (11:28 +0200)]
bump version to 6.0-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: support USB 3 SPICE ports with 4.0 machine feature
Thomas Lamprecht [Thu, 26 Sep 2019 08:54:05 +0000 (10:54 +0200)]
cfg2cmd: support USB 3 SPICE ports with 4.0 machine feature

The reason for why we did not do this in the first place was the fact
that the "usb3" flag could be set in older qemu-server versions, we
just ignored it but not filtered it out of the config..

That means there can be VMs out there which would now become a
different HW layout, and issue for migration and live-snapshot
restore.

But, actually, while the "usb3" property could be set it allowed to
start the VM in only if an additional USB devices was added to the VM
with USB2, or the VM uses "q35" based machine - as else no "ehci" was
available, and thus the "ignored" USB3 - SPICE could not get attached
anywhere -> QEMU chickened out.

And if a user had a configuration where this could started we have
still a bit luck, live-migration was not possible as the "can't
migrate VM which uses local devices:" check still hit, as in
qemu-server older than 6.0-8 we explicitly checked for "spice" when
seeing what usb device were not local, so a "spice,usb3=X" was always
(luckily) wrongly detected as local device -> migration was blocked.

So we only have one case left: restoring a live-snapshot. Here sadly
there seems no way out, it was possible to do with a "spice,usb3=1"
usb device, and thus all Snapshots taken on such VMs after they had a
clean restart on PVE 6 (to have a machine version >= 4.0) are broken
- but can be easily fixed by removing the "usb3=1" from the
problematic snapshot config.
As restoring a snapshot can be repeated more than once even on
failure without rendering the snapshot or VM permanently unusable,
this should be a reasonable compromise.

I strongly believe that the chance is so small that no one is
affected in practice and the property description mentioned that it
was not supported. If anybody is affected on snapshot restore we can
help them on a case-per-case basis.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-8
Thomas Lamprecht [Wed, 25 Sep 2019 15:07:08 +0000 (17:07 +0200)]
bump version to 6.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotree-wide trailing whitespace cleanup
Aaron Lauterer [Tue, 17 Sep 2019 14:47:25 +0000 (16:47 +0200)]
tree-wide trailing whitespace cleanup

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agofix #2382: delete cloudinit disk before restoring
Mira Limbeck [Wed, 25 Sep 2019 13:30:12 +0000 (15:30 +0200)]
fix #2382: delete cloudinit disk before restoring

The fix introduced in commit bf4a933 did not work as intended. We're
iterating over the $oldconf, not over $virtdev_hash. This means
$drive->{is_cloudinit} is always undefined. Instead use the $exclude_cloudinit
parameter from drive_is_cdrom().

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agomake clean: also cleanup source tarball
Thomas Lamprecht [Wed, 25 Sep 2019 12:59:03 +0000 (14:59 +0200)]
make clean: also cleanup source tarball

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: update dh version dependency and standard version
Thomas Lamprecht [Wed, 25 Sep 2019 12:58:05 +0000 (14:58 +0200)]
d/control: update dh version dependency and standard version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: add dsc target
Thomas Lamprecht [Wed, 25 Sep 2019 12:50:45 +0000 (14:50 +0200)]
buildsys: add dsc target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: use BUILDDIR variable
Thomas Lamprecht [Wed, 25 Sep 2019 12:47:26 +0000 (14:47 +0200)]
buildsys: use BUILDDIR variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: remove unused or duplicate directories
Thomas Lamprecht [Tue, 24 Sep 2019 17:04:12 +0000 (19:04 +0200)]
buildsys: remove unused or duplicate directories

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoremove pcitest, now irrelevant
Thomas Lamprecht [Tue, 24 Sep 2019 16:14:14 +0000 (18:14 +0200)]
remove pcitest, now irrelevant

PCI pass through was greatly advanced since this got changed and is
all in QemuServer.

If anybody needs it, it's in git history anyway..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomove VM network (hook) scripts to own directory
Thomas Lamprecht [Tue, 24 Sep 2019 16:12:25 +0000 (18:12 +0200)]
move VM network (hook) scripts to own directory

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomove qemu-configs to own directory
Thomas Lamprecht [Tue, 24 Sep 2019 16:11:22 +0000 (18:11 +0200)]
move qemu-configs to own directory

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomove qmeventd to own directory
Thomas Lamprecht [Tue, 24 Sep 2019 16:08:48 +0000 (18:08 +0200)]
move qmeventd to own directory

It's really not nice if such many files, source code, meta-files, …
linger around in the top level directory..

Also, cleanup the build a bit, i.e., use LDFLAGS as dpkg-buildpackage
can set some LDFLAGS so it'd be nice if both CFLAFGS and LDFLAGS have
the same (related) ones.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: use $(MAKE) instead of make
Thomas Lamprecht [Tue, 24 Sep 2019 16:06:16 +0000 (18:06 +0200)]
buildsys: use $(MAKE) instead of make

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: omit manual manpage gzip, done by debhelpers
Thomas Lamprecht [Tue, 24 Sep 2019 16:03:46 +0000 (18:03 +0200)]
buildsys: omit manual manpage gzip, done by debhelpers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: reorder error so that $volid is last (potential long)
Thomas Lamprecht [Mon, 23 Sep 2019 16:26:15 +0000 (18:26 +0200)]
followup: reorder error so that $volid is last (potential long)

and add "current" as keyword, further remove the parenthesis for the
post-if, to adapt to Proxmox general perl code style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd check to resize disk if current size could not be determined
Tim Marx [Thu, 12 Sep 2019 10:56:18 +0000 (12:56 +0200)]
add check to resize disk if current size could not be determined

This check ensures that disks aren't unintentionally shrunken, if the
size is zero due to an underlying problem.

4 years agofollowup: add newline in warn to avoid extra perl-internal info
Thomas Lamprecht [Mon, 23 Sep 2019 11:15:30 +0000 (13:15 +0200)]
followup: add newline in warn to avoid extra perl-internal info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoImprove handling and description of migrate with --online
Fabian Ebner [Mon, 23 Sep 2019 07:56:01 +0000 (09:56 +0200)]
Improve handling and description of migrate with --online

Thanks to Stefan and Thomas for the suggestions.

Changes from v1:
* update parameter description
* warn instead of die

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoapi: config deletion: avoid regex on undefined values
Thomas Lamprecht [Mon, 23 Sep 2019 10:53:04 +0000 (12:53 +0200)]
api: config deletion: avoid regex on undefined values

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi: deletion: check also pending values for serial/usb
Dominik Csapak [Mon, 23 Sep 2019 08:50:21 +0000 (10:50 +0200)]
api: deletion: check also pending values for serial/usb

otherwise a user with only VM.Config.HWType cannot
delete a 'pending' usbX: spice or serial: socket option

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofollowup: fix usb3 description, SPICE is OK now
Thomas Lamprecht [Mon, 23 Sep 2019 08:25:01 +0000 (10:25 +0200)]
followup: fix usb3 description, SPICE is OK now

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agousb: Fix local resource check of Spice USB devices
Aaron Lauterer [Wed, 11 Sep 2019 12:43:33 +0000 (14:43 +0200)]
usb: Fix local resource check of Spice USB devices

The check relied on the fact that in a regular use case a usb device of
type spice would not have any other settings like `usb3=1`. An exact
match worked fine for this.

This patch changes the behaviour and makes it possible to migrate VMs
with Spice USB devices that have additional usb options set.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agocfg2cmd: mock SPICE/VNC port allocation methods
Thomas Lamprecht [Sat, 21 Sep 2019 11:41:06 +0000 (13:41 +0200)]
cfg2cmd: mock SPICE/VNC port allocation methods

to make them independent of environment, else other running VMs or
quickly sequential test runs may result in false negative test
results, as the port differed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd: add config test for SPICE with USB3
Thomas Lamprecht [Sat, 21 Sep 2019 11:35:01 +0000 (13:35 +0200)]
cfg2cmd: add config test for SPICE with USB3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agousb: Add USB3 capabilities to Spice USB devices
Aaron Lauterer [Wed, 11 Sep 2019 12:43:32 +0000 (14:43 +0200)]
usb: Add USB3 capabilities to Spice USB devices

To not change current behaviour and thus breaking live migration USB3
for a Spice USB device requires Qemu v4.1.

The old behavior was that even though technically it was possible to
the set `usb3=1` setting, it was ignored. The bus was hardcoded to
ehci. If another USB2 device was added or the machine type was set to
Q35 an ehci controller was present and the VM was able to boot.

With this patch the behaviour is changing and the bus is set to xhci if
USB3 is set for the Spice USB device and the VM is running under Qemu
v4.1.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agousb: Cleanup redundant if condition
Aaron Lauterer [Wed, 11 Sep 2019 12:43:31 +0000 (14:43 +0200)]
usb: Cleanup redundant if condition

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoapi: add reboot api call
Dominik Csapak [Wed, 11 Sep 2019 12:07:45 +0000 (14:07 +0200)]
api: add reboot api call

this creates a reboot request file (inspired by pve-container)
and relies on the 'qm cleanup' call by the qmeventd to detect
and restart the vm afterwards

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agorefactor vm_stop locked code
Dominik Csapak [Wed, 11 Sep 2019 12:07:44 +0000 (14:07 +0200)]
refactor vm_stop locked code

we want to reuse most of the code in the locked context of vm_stop
for vm_reboot (since it really is just a vm_stop with a
create_reboot_request in there) so we factor that out into
_do_vm_stop
and note that it has to be called in a locked context

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoqm: cleanup: detect and handle reboot trigger
Dominik Csapak [Wed, 11 Sep 2019 12:07:43 +0000 (14:07 +0200)]
qm: cleanup: detect and handle reboot trigger

if the reboot trigger file was set, start the vm again
also cleanup the reboot trigger on vm startup, to prevent
leftover files to trigger a reboot at the next shutdown

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoadd create and remove reboot trigger subs
Dominik Csapak [Wed, 11 Sep 2019 12:07:42 +0000 (14:07 +0200)]
add create and remove reboot trigger subs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoapi: add missing index child links
Dominik Csapak [Fri, 6 Sep 2019 12:24:05 +0000 (14:24 +0200)]
api: add missing index child links

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agotest: compare also with our qemu cfgs for pci addr conflicts
Thomas Lamprecht [Tue, 10 Sep 2019 08:31:38 +0000 (10:31 +0200)]
test: compare also with our qemu cfgs for pci addr conflicts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotest: pci addr checker: add slurp_qemu_config skeleton
Thomas Lamprecht [Mon, 9 Sep 2019 14:24:20 +0000 (16:24 +0200)]
test: pci addr checker: add slurp_qemu_config skeleton

it works™, but yet unused, add nonetheless to make it easier to pick
up and complete this testing work.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd test: hostpci, also specify exact PCIe devices
Thomas Lamprecht [Mon, 9 Sep 2019 06:40:07 +0000 (08:40 +0200)]
cfg2cmd test: hostpci, also specify exact PCIe devices

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd test: fix hostpci tests, specify exact PCI device
Thomas Lamprecht [Mon, 9 Sep 2019 06:26:45 +0000 (08:26 +0200)]
cfg2cmd test: fix hostpci tests, specify exact PCI device

as a hack to avoid that we hit a code path where the current ones
from the hosts are checked, and the command line option is added
depending if it exists or not.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd tests: improve hostpci test by marking some as PCIe
Thomas Lamprecht [Fri, 6 Sep 2019 17:45:33 +0000 (19:45 +0200)]
cfg2cmd tests: improve hostpci test by marking some as PCIe

and add a linux based one, which acts a bit different

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoconfig_to_command: refactor/cleanup try for hostpci part
Thomas Lamprecht [Fri, 6 Sep 2019 17:24:01 +0000 (19:24 +0200)]
config_to_command: refactor/cleanup try for hostpci part

try to increase variable declaration to use locality, reduce
duplication of same variable names used, and try to cleanup a bit in
general..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd tests: config with PC i440fx, pci passthrough, NUMA, EFI
Thomas Lamprecht [Fri, 6 Sep 2019 17:26:54 +0000 (19:26 +0200)]
cfg2cmd tests: config with PC i440fx, pci passthrough, NUMA, EFI

identical with the Q35 one, solely the machine type is different

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfg2cmd tests: config with q35, pci passthrough, NUMA, EFI
Thomas Lamprecht [Fri, 6 Sep 2019 17:21:08 +0000 (19:21 +0200)]
cfg2cmd tests: config with q35, pci passthrough, NUMA, EFI

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoPCIe passthrough: fixup: avoid addr conflict and cleanup a bit
Thomas Lamprecht [Fri, 6 Sep 2019 17:22:27 +0000 (19:22 +0200)]
PCIe passthrough: fixup: avoid addr conflict and cleanup a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopci: add conflict tests
Thomas Lamprecht [Fri, 6 Sep 2019 17:10:34 +0000 (19:10 +0200)]
pci: add conflict tests

best viewed with: git show -w

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAdd support for up to 16 PCI(e) devices
Aaron Lauterer [Thu, 5 Sep 2019 16:13:00 +0000 (18:13 +0200)]
Add support for up to 16 PCI(e) devices

For non pci express passthrough additional addresses are reserved.
For pcie passthrough pcie root ports are needed (unless guest is like
windows 7).

The first 4 pcie root ports are defined by default in the pve-q35*.cfg
files. If more than 4 pcie devices are passed through the needed root
ports are created on demand. This helps to keep live migration possible
without adding a new pve-q35*.cfg file.

For the windows 7 like guests additional addresses are reserved as well.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoNewline cleanup
Christian Ebner [Mon, 1 Jul 2019 13:43:51 +0000 (15:43 +0200)]
Newline cleanup

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agospice enhancements: document default values
Thomas Lamprecht [Wed, 4 Sep 2019 12:44:04 +0000 (14:44 +0200)]
spice enhancements: document default values

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: code cleanup
Thomas Lamprecht [Wed, 4 Sep 2019 11:26:11 +0000 (13:26 +0200)]
followup: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2041, #2272: Add Spice enhancements
Aaron Lauterer [Thu, 22 Aug 2019 15:33:18 +0000 (17:33 +0200)]
fix #2041, #2272: Add Spice enhancements

This adds a new config option called `spice_enhancements` with two
optional settings:

* videostreaming
* foldersharing

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoclose #2263: die on live migration with local cloudinit disk
Mira Limbeck [Fri, 12 Jul 2019 12:23:15 +0000 (14:23 +0200)]
close #2263: die on live migration with local cloudinit disk

Live migration with a local cloudinit disk was never intended to work. It did
however work to an extent that the migration completed but the disk on the
source node could not be deleted. Now die if a live migration is started with
a local cloudinit disk.

With the GUI changes live migration is already disabled as it recognizes the
cloudinit disk as a local resource.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agoCPU flags: Add aes flag
Peter Keresztes Schmidt [Thu, 1 Aug 2019 17:22:23 +0000 (19:22 +0200)]
CPU flags: Add aes flag

Signed-off-by: Peter Keresztes Schmidt <peterke@sos.ethz.ch>
4 years agofix remote viewer live migration
Dominik Csapak [Tue, 20 Aug 2019 08:45:32 +0000 (10:45 +0200)]
fix remote viewer live migration

for some reason not setting port results in a port of '65535' which
triggers an execption in http-server anyevent, so we set the port to 0

also, we have to read the ticket from stdin even for 'unix' type secure
migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoqemu_machine_pxe: remove unused parameter
Dominik Csapak [Tue, 13 Aug 2019 13:19:08 +0000 (15:19 +0200)]
qemu_machine_pxe: remove unused parameter

no caller used that parameter, ever

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agorework kvm_user_version cache mechanism
Dominik Csapak [Tue, 13 Aug 2019 13:19:07 +0000 (15:19 +0200)]
rework kvm_user_version cache mechanism

we now also save the mtime of the binary and cache per binary (for each
arch; this is done so we have it already when we sometime decide
that we want to split the qemu package for each arch)
so that we get the real version if only pve-qemu-kvm was updated

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofix: qemu: uninitialized value in multiplication
Alwin Antreich [Wed, 24 Jul 2019 13:56:43 +0000 (15:56 +0200)]
fix: qemu: uninitialized value in multiplication

A generated VM with default values does not set the memory key in the
configuration. Hence the size of the state file for a suspend had only
the default size of the state itself and not in addition twice the
configured memory.

The patch uses the static defaults from the JSON schema if the memory
key is not set.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agoAdd a FIXME to the Q35 config to rm audio0 dev
Aaron Lauterer [Wed, 24 Jul 2019 13:57:29 +0000 (15:57 +0200)]
Add a FIXME to the Q35 config to rm audio0 dev

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agobump version to 6.0-7
Thomas Lamprecht [Wed, 24 Jul 2019 13:13:44 +0000 (15:13 +0200)]
bump version to 6.0-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoq35 already has an 'audio0' device, rename our to "audiodev$id"
Thomas Lamprecht [Wed, 24 Jul 2019 13:06:20 +0000 (15:06 +0200)]
q35 already has an 'audio0' device, rename our to "audiodev$id"

The latest changes to our audio device implemenation [0] changed the
naming of the device id to "audio<id>" which in practice resulted in
"audio0".

This conflicts with the predefined audio device in the Q35 configs
that is also using "audio0". The result is that a VM with a
configured audio device and Q35 type will not start.

While we just would had removed the audio0 device if we had detected
this earlier in the new 4.0 q35 config, we cannot do so anymore due
to migration compatibility.

So rename the device from "audio$id" to audiodev$id".

Co-authored-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-6
Thomas Lamprecht [Tue, 23 Jul 2019 16:20:49 +0000 (18:20 +0200)]
bump version to 6.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoMake hv-tlbflush and hv-evmcs optional and merge flag list
Stefan Reiter [Tue, 23 Jul 2019 11:41:28 +0000 (13:41 +0200)]
Make hv-tlbflush and hv-evmcs optional and merge flag list

Both flags were causing issues and have been made into optional flags to
be manually selected by the user if needed.

The supported flags have been merged into a single list for convenience.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agoaudio follouwp: pull out parsing into a conf_has_audio
Thomas Lamprecht [Tue, 23 Jul 2019 16:09:32 +0000 (18:09 +0200)]
audio follouwp: pull out parsing into a conf_has_audio

now that we finally now what the ID from the audiodev is for let's
factor some format string parsing out making a eventual future multi
audio device support with differen backends quite easy to support
here - once QEMU itself supports that fully.[0][1]

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-July/038400.html
[1]: https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg03583.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoaudio dev: specify qemu audio backend
Aaron Lauterer [Fri, 19 Jul 2019 13:15:44 +0000 (15:15 +0200)]
audio dev: specify qemu audio backend

QEMU 4 adds the `-audiodev` parameter to explicitly specify the audio
backend. Setting it avoids occasional error messages when starting a
virtual machine with an audio device and qemu wants to connect it to the
physical audio device.

For now only SPICE is supported as it's also the biggest use case.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoremove unused variable
Dominik Csapak [Mon, 15 Jul 2019 12:35:30 +0000 (14:35 +0200)]
remove unused variable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofix #2275: die on invalid sendkey
Dominik Csapak [Mon, 15 Jul 2019 12:35:29 +0000 (14:35 +0200)]
fix #2275: die on invalid sendkey

sendkey does not return anything if it is succesful and the error otherwise

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoaudio dev: follouwp code cleanup and error handling
Thomas Lamprecht [Thu, 18 Jul 2019 07:08:59 +0000 (09:08 +0200)]
audio dev: follouwp code cleanup and error handling

die if we get some unknown value, which is either a bug (new dev type
added to enum but not here) or a user manual edit error, good to
ccatch both

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoaudio dev: add note that this is useful for SPICE
Thomas Lamprecht [Thu, 18 Jul 2019 07:08:40 +0000 (09:08 +0200)]
audio dev: add note that this is useful for SPICE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAdd audio device to HW permissions
Aaron Lauterer [Wed, 17 Jul 2019 13:59:01 +0000 (15:59 +0200)]
Add audio device to HW permissions

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoAdd PCI address for audio device
Aaron Lauterer [Wed, 17 Jul 2019 13:59:00 +0000 (15:59 +0200)]
Add PCI address for audio device

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agoAdd audio device support
Aaron Lauterer [Wed, 17 Jul 2019 13:58:57 +0000 (15:58 +0200)]
Add audio device support

Until now audio devices had to be added manually with the `args` option
in the VMs config file. This adds a new config option to define an audio
device. It is called `audio0` with the extra `0` to be prepared should
we ever implement support for more than one audio device.

Supported devices are:

* ich9-intel-hda: Intel HD Audio Controller, emulates ICH9
* intel-hda: Intel HD Audio Controller, emulates ICH6
* AC97: useful for older OSs like Win XP

If any of the `intel-hda`s is selected two additional devices will be
created: hda-micro and hda-duplex. The `*intel-hda` controllers need at
least one of them as they emulate microphones and speakers (hda-micro)
or line in and out devices (hda-duplex).

Having both is deemed best practice to avoid problems if some software
needs one of the other kind of output/input ports.

I also cleaned up some old, commented out, code regarding audio devices.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agobump version to 6.0-5
Thomas Lamprecht [Thu, 11 Jul 2019 17:45:38 +0000 (19:45 +0200)]
bump version to 6.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agouse new pcie port hardware
Dominik Csapak [Mon, 8 Jul 2019 09:25:10 +0000 (11:25 +0200)]
use new pcie port hardware

with qemu 4.0 we can make use of the new pcie-root-ports with settings
for the width/speed which can resolve issues with some hardware combinations
when negioating link speed

so we add a new q35 cfg that we include with machine types >= 4.0
to preserve live migration of machines without passthrough but q35

for details about the link speeds see:

pcie: Enhanced link speed and width support
https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg02827.html

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoFix: rtcflags: ignore startdate 'now'
Alwin Antreich [Thu, 4 Jul 2019 09:00:58 +0000 (11:00 +0200)]
Fix: rtcflags: ignore startdate 'now'

If 'now' is passed to the startdate option, the kvm start fails with
below failure.
 kvm: invalid datetime format
 valid formats: '2006-06-17T16:01:21' or '2006-06-17'

With this patch, 'now' is ignored and not passed to the rtcflags (-rtc).

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agobump version to 6.0-4
Thomas Lamprecht [Fri, 28 Jun 2019 18:36:39 +0000 (20:36 +0200)]
bump version to 6.0-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocheck_local_storage_availability: only count each unavailable storage once
Thomas Lamprecht [Fri, 28 Jun 2019 15:23:44 +0000 (17:23 +0200)]
check_local_storage_availability: only count each unavailable storage once

and some general cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomigrate: add size to volume attributes
Tim Marx [Fri, 28 Jun 2019 13:13:47 +0000 (15:13 +0200)]
migrate: add size to volume attributes

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agomigrate: handle storage not selected manually in storage config
Tim Marx [Fri, 28 Jun 2019 13:13:45 +0000 (15:13 +0200)]
migrate: handle storage not selected manually in storage config

e.g. local storage was considered not allowed for offline migration
even if it is available on all nodes, this should now be fixed as it
is now considered available on all nodes if a local storage isn't
restricted to a specific subset of the available nodes. The user is
responseable to make sure that the datacenter storage config reflects
the actual setup, so there is no additional check for local storages
which aren't available on all nodes if they are not explicitly marked
at datacenter level.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agocloudinit: set iso-level in genisoimage call
Mira Limbeck [Thu, 27 Jun 2019 16:01:05 +0000 (18:01 +0200)]
cloudinit: set iso-level in genisoimage call

This is required for Windows to recognize the ISO and as a result the cloudinit
config. This is the minimum to get any config working at all for windows.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agoFix guest agent shutdown without timeout
Stefan Reiter [Tue, 25 Jun 2019 14:44:31 +0000 (16:44 +0200)]
Fix guest agent shutdown without timeout

Regression from change allowing timeouts to be set, now shutting down
also works without timeouts again (previously qmp failed because of
the unknown "timeout" parameter passed to it).

We always delete the timeout value from the arguments, regardless of
truthiness. "delete" returns the deleted element, deleting a
non-existant hash entry returns undef, which is fine after this point:

"deleting non-existent elements returns the undefined value in their
corresponding positions."
- https://perldoc.perl.org/functions/delete.html

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agobump version to 6.0-3
Thomas Lamprecht [Tue, 25 Jun 2019 12:34:27 +0000 (14:34 +0200)]
bump version to 6.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd_hyperv_enlightenments: do not add hv_evmcs for now at all
Thomas Lamprecht [Tue, 25 Jun 2019 12:32:05 +0000 (14:32 +0200)]
add_hyperv_enlightenments: do not add hv_evmcs for now at all

as Windows VMs on hosts with AMD CPUs do not start at all with
that...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-2
Thomas Lamprecht [Mon, 24 Jun 2019 15:50:01 +0000 (17:50 +0200)]
bump version to 6.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: move hv_tlbflush under 3.1 machine feature guard
Thomas Lamprecht [Mon, 24 Jun 2019 15:23:42 +0000 (17:23 +0200)]
followup: move hv_tlbflush under 3.1 machine feature guard

while it really should not pose an issue for live migrations lets be
on the safe side and also add this only with 3.1 or later machines

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>