5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-12 20:58:26 +03:00

1363 Commits

Author SHA1 Message Date
Dominik Csapak
7820eae438 fix #2131: get correct device when deleting iothreads
we map scsiX to virtioscsiX/scsihwX when we use virtio-scsi-single to add
and iothread so we have to map it back when we delete an iothread, else the
parsing fails with

'invalid drive key: virtioscsi0'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-14 08:25:48 +01:00
Dominik Csapak
92bdc3f0e3 fix #2120: use hosts initiator name with qemu-img
qemu-img uses the qemu default initiator name 'iqn.2008-11.org.linux-kvm'
since we use the one of the host (/etc/iscsi/initiatorname.iscsi) when
using it with a running vm, we want to using it also when moving a disk
with qemu-img

to do that we have give qemu-img the image in as a full option string

this fixes the issue that we could not move an zfs-over-iscsi disk
without allowing the default qemu initiator

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-07 15:59:56 +01:00
David Limbeck
cb702ebe0f cloud-init: allow custom network/user data files via snippets
Adds the 'cicustom' option to specify either or both network and user
options as property strings. Their parameters are files in a snippets
storage (e.g. local:snippets/network.yaml). If one or both are specified
they are used instead of their respective generated configuration.
This allows the use of completely custom configurations and is also a
possible solution for bug #2068 by specifying a custom user file that
contains package_upgrade: false.

Tested with Ubuntu 18.10 and cloud-init 18.4.7

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2019-03-07 09:02:33 +01:00
Dominik Csapak
95d3be5879 fix indentation and trailing whitespace
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-28 10:02:23 +01:00
Dominik Csapak
79046fd12e fix #2114: set correct link status on hotplug
we also need to set the link status if the whole device changed,
otherwise a change of macaddress allows a network connection even
if link_down is set to 1

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-28 10:02:23 +01:00
Thomas Lamprecht
bd772c2e87 code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:13 +01:00
Thomas Lamprecht
4c5a6a2419 ivmshmem: comment deletion of shm on VM stop in code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:13 +01:00
Thomas Lamprecht
e3c27a6afe ivmshmem: follouwp code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 08:30:10 +01:00
Dominik Csapak
6dbcb07367 add ivshmem device to config
with such a shared memory device, a vm can share data with other
vms or with the host via memory

one of the use cases is looking-glass[1] with pci-passthrough, which copies
the guest fb to the host and you get a high-speed, low-latency
display client for the vm

on vm stop we delete the file again

1: https://looking-glass.hostfission.com/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-26 08:01:12 +01:00
Christian Ebner
e741c51696 Fix 2097 allow to set and pass wwn parameter for ide, sata and scsi disks
This allows to set the wwn parameter for ide, sata and scsi disks in the VM
config and passes it to the qemu command on execution.

VirtIO Block does not supports this property, so exclude it from
there.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 07:55:04 +01:00
David Limbeck
4efb58a96e fix #2101: ipv6 ending in ':' not parsed as a string
Space or newline after ':' is recognized as a mapping and as a result an
ipv6 ending in ':' is not parsed as a string. The solution is to quote
the address. For consistency all other addresses (including mac) are
quoted.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2019-02-22 10:21:10 +01:00
Thomas Lamprecht
769f187df5 followup whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-20 07:34:10 +01:00
Alexandre Derumier
f3a483b682 QemuMigrate : cleanup identation 2019-02-20 07:32:23 +01:00
Wolfgang Bumiller
1d68295172 memory: fix automatic num amapping
when no numaX config options were present we returned the
hash as a list instead of a hash reference...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-18 10:45:17 +01:00
Kamil Trzciński
ca0ef6b148 Use nr_hugepages from /proc/cmdline
Currently Proxmox VE always deallocates HugePagesTLB
when starting a new machine and it makes it impossible
to preconfigure kernel /proc/cmdline with persistent allocation.

This change makes deallocation to prefer defaults set by /proc/cmdline,
by parsing the cmdline and respecting hugepages= and hugepagesz=.

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
2019-02-18 10:39:18 +01:00
Thomas Lamprecht
f5c673cba7 fix #2043: vm start: always stop existing systemd scopes
commit 3c23aa808ccc946bad92d9bc63b6f833c61d0f52 tried to fix a issue
where after a stop mode backup a scope could still linger around, but
it actually removed the wrong check. If we want to remove a
lingering, not yet cleaned up, scope we need to check if said scope
exists not if a VM process is still running. While they are corelated
the scope will always get cleaned up _after_ it's processes are gone.

Should fix #2043, but as this is seemingly not that easy to fix one
for all I'll put the should as disclaimer here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-11 08:12:32 +01:00
Dominik Csapak
9e784b1154 add pre- start/stop hookscripts to VMs
this adds a new config option for it, and executes it on four
points in time:

'pre-start'
'post-start'
'pre-stop'
'post-stop'

on pre-start we abort if the script fails
and pre-stop will not be called if the vm crashes or if
the vm gets powered off from inside the guest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-01 12:58:37 +01:00
Thomas Lamprecht
87d92707b6 followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:15 +01:00
Thomas Lamprecht
2a68ec7893 fix some indentaion errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:00 +01:00
Rhonda D'Vine
b14477e718 Fix #1924: add snapshot parameter
The qm CLI command offer the config and showcmd functions. Both of those
outputs may vary with respect to a given snapshot. This adds a switch
that shows the corresponding snapshot's config and command line.

The code needs a newer libpve-guest-common-perl, thus bumping the
dependency.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2019-01-30 14:56:43 +01:00
Dominik Csapak
bfc0bb8179 allow explicit set vga with gpu passthrough
this patch allows the user to explicitely set a virtual vga,
even when using the 'x-vga' flag, this is sometimes necessary,
as some users need the 'x-vga' flag on the pci device,
but still want to use a virtual vga

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-28 17:38:55 +01:00
Thomas Lamprecht
f1e277cd88 api/create: print correct error message if cleanup fails
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-26 14:39:38 +01:00
Thomas Lamprecht
fc5c194b5d followup: HV ID description
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-25 17:10:49 +01:00
Dominik Csapak
2894c24745 allow explicit hv-vendor-id
with this, a user can set the hv_vendor_id independently of
any 'x-vga=on' setting he may or may not have configured.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-25 17:06:43 +01:00
Thomas Lamprecht
c7789f54ad migrate: fix local disk migration with online VMs
commit 4530494bf9f3d45c4a405c53ef3688e641f6bd8e introduced an
regression with local disk migrations if the VM is online and thus
needs to live migrated and no target storage was passed as parameter.

We made the hack to write "1" to the targetstorage option in this
case obsolete, but it was still used on deciding if there are any
drives to mirror at all. Here it is enough to check if there are any
'online_local_volumes' because that hash gets only filled if we can
and are told to live mirror local disk on migrations anyway. Also,
we abort early if local disks are found and the 'with-local-disks'
option is not set.

This was reported at:
https://forum.proxmox.com/threads/livemigration-with-localdisk-doesnt-coppy-and-data-from-the-hdds-anymore.50744/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-17 10:58:50 +01:00
Dominik Csapak
8fef2bdb95 fix #2003: give 'qm terminal' a terminal over ssh
this prevents a connection loop when using novnc on a vm with
vga: serialX
when proxying via ssh

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-03 09:07:54 +01:00
Dominik Csapak
414b42d8ef vnc/termproxy: use ssh_info_to_command for ssh tunnel
this way we have two places less where we define a ssh cmd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-03 09:07:54 +01:00
Thomas Lamprecht
db70021bcf config2command test: mock kernel_has_vhost_net
just return true for now, the use is guarded by an 'is_native($arch)'
check anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:44:15 +01:00
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
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
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
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
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
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
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