Commit Graph

1934 Commits

Author SHA1 Message Date
Wolfgang Bumiller
8c58b12d0d cleanup: use a local $override_targetsid variable
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-20 10:11:32 +01:00
Thomas Lamprecht
4530494bf9 fix local disk migration when no target storage is set
the check for targetstorage in:
if ($self->{running} && $self->{opts}->{targetstorage} && $local_volumes->{$volid}->{ref} eq 'config') {

was obsolete, as we always set the tragetstorage opts variable to '1'
in a broader "use same sid for remote local" check above.
So removing it leads to the same if truthtable but fixes the
check if we should fallback to the volume's SID if targetstorage is
not set, as else it seemed to be always set, and '1' is naturally not
a correct stroage ID.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-20 10:11:32 +01:00
Alexandre Derumier
d0c671823d fix #1013 : migrate : sync_disk : --targetstorage with offline disk
targetsid was not used, for disk unused (offline copy)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-20 10:11:32 +01:00
Dominik Csapak
739ba34024 add win7 pcie quirk
Win7 is very picky about pcie assignments and fails with
'error 12' the way we add hospci devices.

To combat that, we simply give the hostpci device a normal port
instead.

Start with address 0x10, so that we have space before those devices,
and between them and the ones configured in pve-q35.cfg should we
need it in the future.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-17 14:00:23 +01:00
Dominik Csapak
86c9fafefc fix #2032: check that type is set before using
When not setting 'vga' we would get a warning:

Use of uninitialized value $type in string eq at
/usr/share/perl5/PVE/QemuServer.pm line 2026.

This patch changes the order of the conditions and checks if $type is set
before using it, so that we do not get the warning anymore.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-17 09:23:00 +01:00
Thomas Lamprecht
8256220068 t/cfg2cmd: ensure tests can pass again
the change to use a real diff to check tests, with it's nicer output
for failing cases, failed to ensure that the test system knew if a
case passed - earlier done indirectly by 'is_deeply', thus add a
manual 'pass' call if the tes was OK.
Further, the firs test failing aborted everything, which isn't to
nice, normally it's much more convenient if all test get run and one
can view at the results of all of them. So put the diff in an eval
and fail/note the test manually.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-11 10:45:03 +01:00
Wolfgang Bumiller
3dc780c643 t/cfg2cmd: replace is_deeply with diff
(The diff() sub is copied from our pve-common's network
interfaces test scripts)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-11 10:44:04 +01:00
Wolfgang Bumiller
a774013569 t/cfg2cmd: mock iscsi initiator name
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-11 10:44:04 +01:00
Thomas Lamprecht
7b963e5762 add config to command tests
To have a better safety net for not introducing regressions and also
some functional checks as the QEMU command defines the layout
behavior of the VM.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-11 10:44:04 +01:00
Wolfgang Bumiller
89caf77b87 add the rest of themissing lock types
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-11 10:09:21 +01:00
Stoiko Ivanov
9759415454 add 'clone' to lock schema definition/confdesc.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-12-11 10:03:00 +01:00
Dominik Csapak
7c954c426d vga: allow 'none'
so that one can explicitly disable the vga without having to specify
a serial port as display, this is mostly useful for very special
and custom gpu passthrough setups which have to be specified with
'args' and for setups which do not care about any display (not even serial)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-11 09:56:50 +01:00
Dominik Csapak
7635067063 fix #1267: move args to the end of qemu commandline
there is nothing that should be really affected by this, but
even then, this option is only for experts and people using this
should know what they are doing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-11 09:56:50 +01:00
Alexandre Derumier
8fa6a851ee clone_disk : cloudinit drive: don't clone snapname
we don't snapshot cloudinit drive,

this fix "qm clone <vmid> <targetvmid> --snapname mysnap" when a cloudinit drive exist
2018-12-11 09:43:04 +01:00
Thomas Lamprecht
e6bac1f569 bump version to 5.0-43
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-29 12:58:12 +01:00
Dominik Csapak
0f56fff292 better cleanup logging for migration
if we migrate a vm we call cleanup but the logging looks like:

Starting cleanup for 101
trying to acquire lock...
 OK
Configuration file 'nodes/pve-ceph-01/qemu-server/101.conf' does not exist

with this patch, we omit any logging in the case we do not have the config,
since we cannot know what to clean up

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-28 11:04:46 +01:00
Thomas Lamprecht
88a7da8309 followup: add FIXME comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-27 13:45:23 +01:00
Dominik Csapak
ad5f4f3837 fix check if machine type is q35
When live migrating, with a q35 machine will get the qemu version
encoded in the machine type, for example,'pc-q35-2.12', so we need to
allow this too and cannot expect that all q35 machine have
q35' in verbatim as their type.

So, when migrating such a machine live, we missed to include the q35
cfg because we didn't allowed versioned q35 machine types, which then
failed the migration.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-27 13:35:52 +01:00
Thomas Lamprecht
8794aa34e7 bump version to 5.0-42
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 11:27:35 +01:00
Thomas Lamprecht
92ef37cecb bump libpve-common-perl version dependency to >= 5.0-43
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 11:27:17 +01:00
Dominik Csapak
2fd247882d use improved lspci
since lspci does not split between id and function anymore,
there is no need to plug id + function together

also we can remove the capture groups from PCIRE
since parse_property_string does this check for us

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-22 07:02:19 +01:00
Dominik Csapak
6ab45bd7ff add mediated devices support
with this, we are able to create and use mediated devices,
which include Intel GVT-g (aka KVMGT) and Nvidia vGPUs, and probably more
types of devices in the future

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-22 07:02:19 +01:00
Thomas Lamprecht
e196200ab8 bump version to 5.0-41
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 15:19:27 +01:00
Thomas Lamprecht
b330642aec d/control: bump version dependency to libpve-common-perl
to ensure we have the new PVE::SysFSTools module available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 15:19:27 +01:00
Thomas Lamprecht
01557677b1 bsys: CFLAGS should add to existing
else the environment from buildpackage gets overwritten and the '-g'
misses, which results in an debug symbols file without debug
symbols.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 15:19:27 +01:00
Thomas Lamprecht
303c67ba8a bsys: we have a dbgsym package now too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 14:41:14 +01:00
Thomas Lamprecht
f4ced5d2d3 qmeventd: fixup program name in license
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 14:40:21 +01:00
Thomas Lamprecht
81b2db7d28 QemuServer: remove now unused $pcisysfs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 14:07:54 +01:00
Dominik Csapak
b71351a7ed QemuServer: remove PCI sysfs helpers
and use them from PVE::SysFSTools, where they got moved to

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 14:06:11 +01:00
Wolfgang Bumiller
d6140280f7 d/control: remove unused dependency
this was a leftover from a previous iteration of the
qmeventd patches

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-19 09:57:50 +01:00
Dominik Csapak
b4496b9ed5 use qmeventd to execute qm cleanup
we reverse the direction of the event socket (this does not
prevent live migration) and point it to wher qmeventd listens

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-14 15:29:59 +01:00
Dominik Csapak
3ea84aeb7c add 'qm cleanup'
this is intended to be used with qmeventd, to do
the necessary cleanups when qemu crashes or is being
shut down from within the guest

this can also be the point where we could introduce
shutdown/stop/reboot hooks

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-14 15:29:59 +01:00
Dominik Csapak
4c17b2e30d add qmeventd
this adds a program that can listen to qemu qmp events on a given socket
and if a shutdown event followed by a disconnected socket occurs,
executes qm cleanup with arguments that indicate if the
vm was closed gracefully and whether the guest initiated it

this is useful if we want to cleanup after the qemu process exited,
e.g. tap devices, vgpus, etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-14 15:29:59 +01:00
Rhonda D'Vine
3074f37b34 Add missing Build-Depends
These were found while building the package within a clean chroot.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-11-14 11:45:59 +01:00
Thomas Lamprecht
a32df3b4f4 d/control: bump version dependency for pve-edk2-firmware
to ensure that we have AAVMF available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-13 15:09:39 +01:00
Wolfgang Bumiller
869ad4a78d arm: use virtio gpu by default
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
1ea63c15bf don't use amd64-specific cpu options on arm
FIXME: This function needs proper reorganisation...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
d559309fcf arm: pci addressing, keyboard and ehci controller
On arm we start off with a pcie bridge pcie.0. We need a
keyboard in addition to the tablet device, and we need to
connect both to an 'ehci' controller.

To do all this, we also pass the $arch variable through a
whole lot of function calls to ultimately also adapt the
hotplug code to take care of the new keyboard device.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
91b01bbbaa arm: use UART for serial0 instead of a separate device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
6f0cb67588 only use vhost-net for native kvm machines
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
0f27a91d3d use cortex-a57 as cpu for arm emulation for now...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
4fc262bd50 move cpu option creation into separate sub
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
6908fd9bf4 use qemu-system-aarch64 for arm machines
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
96ed3574d4 use AAVMF for arm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
40c3bcf876 create_vm: don't add vmgenid for ARM machines by default
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
d731ecbefe add 'arch' vm configuration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
646f2df43c fix and simplify kvm_version()
This was never actually used, but we want to use it as
alternative to checking /proc/cpuinfo for 'hvm' on ARM.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
David Limbeck
c701be3243 fix #1959: add fallback for 'auto' previously set by SLAAC
SLAAC previously set 'auto' which is not supported by nocloud network
config. On an up-to-date Ubuntu this should work as it uses 'dhcp' for
both dhcp and SLAAC. For others it was invalid anyway.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-11-13 10:10:29 +01:00
Thomas Lamprecht
56cd7f6981 bump version to 5.0-40
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-12 17:28:45 +01:00
Dominik Csapak
8490283721 check for $vga->{type} instead of $vga
with commit 55655ebc32
we changed $vga to a parsed hash instead of a string
and forgot to check the property type in one place

this fixes an issue where a vm with a gpu passed through
with x-vga=on could not start

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-12 09:27:21 +01:00