Commit Graph

584 Commits

Author SHA1 Message Date
Wolfgang Bumiller
822c8a0776 drive schema: allow 'none' again 2016-04-01 09:30:01 +02:00
Wolfgang Bumiller
bb9207e0e1 cputype: format_description to avoid huge enum in manpage 2016-04-01 09:27:35 +02:00
Wolfgang Bumiller
ff6ffe20c9 cleanup: naming consistency 2016-04-01 09:27:12 +02:00
Wolfgang Bumiller
93c0971cec fix a few property string descriptions 2016-04-01 09:26:51 +02:00
Fabian Grünbichler
20519efc76 use PVE::Storage::config(), not cfs_read_file() 2016-03-30 10:37:22 +02:00
Dietmar Maurer
8a61e0fd38 use asciidoc compatible markup
s/Note:/NOTE:/
2016-03-23 10:22:17 +01:00
Wolfgang Bumiller
ba8fc5d13e limit serial and model and document their real limits
The urlencoded format currently cannot check the real
decoded length, so we limit to an upper bound and document
the real limits. Ideally we'd introduce a decodedLength
schema parameter at some point...
2016-03-21 11:19:55 +01:00
Wolfgang Bumiller
988e2714ad clone: use the zeroinit filter for sparseinit storages 2016-03-21 09:59:49 +01:00
Wolfgang Bumiller
46630a5fd4 cfg: use the 'urlencoded' format for drive model and serial 2016-03-21 09:01:15 +01:00
Wolfgang Bumiller
918d09150e clanup: qemu_drive_options is only used inside the one function
and it doesn't contain 'bootindex'
2016-03-21 09:00:47 +01:00
Thomas Lamprecht
1917695c93 Fix some typos in JSON schema descriptions
/cirrur/cirrus/
/devive/device/
/Numa/NUMA/
and a few grammar fixes, rewrites of sentences

Also if already touching those lines lets break them up from one
liners to a column limit of ~80.
2016-03-16 16:46:08 +01:00
Fabian Grünbichler
e79706d47a Use has_lock to check for specific lock 2016-03-14 09:03:28 +01:00
Wolfgang Bumiller
4f4fbeb048 fix #909: pass rate to tap_plug()
When using OVS tap_plug() resets rate limiting so we need
to pass it along to reapply it.

The rate on its own can still be hot-plugged with the
regular tap_rate_limit() call.
2016-03-08 15:52:31 +01:00
Fabian Grünbichler
8793d4950e Refactor add_unused_volume
Drop add_unused_volume from PVE::QemuServer in favor of
(identical) implementation in PVE::AbstractConfig
2016-03-08 11:42:51 +01:00
Fabian Grünbichler
b2c9558da8 Rework snapshot code, has_feature
Drop snapshot_create, snapshot_delete and snapshot_rollback
in favour of PVE::AbstractConfig. Qemu-specific parts are
implemented in __snapshot_XX methods in PVE::QemuConfig.

has_feature is made an implementation of the abstract
has_feature, and thus moves to PVE::QemuConfig.

Note: a new hook method needed to be introduced to be called
before creating a volume snapshot, after creating a volume
snapshot, and after unfreezing the guestfs after creating a
volume snapshot. The base method in PVE::AbstractConfig is a
noop, the implemention in PVE::QemuConfig runs the necessary
Qemu monitor commands.
2016-03-08 11:42:37 +01:00
Fabian Grünbichler
ffda963f46 Refactor basic config-related methods
Drop load_config, write_config, lock_config[_xx],
check_lock, check_protection, is_template and config_file
in favour of implementions in PVE::AbstractConfig.

Implement guest_type, __config_max_unused_disks,
config_file_lock and cfs_config_path from
PVE::AbstractConfig in PVE::QemuConfig.
2016-03-08 11:41:59 +01:00
Fabian Grünbichler
74479ee9bb Make foreach_drive order deterministic
Previously, foreach_drive iterated over all configuration
keys (in a random order) and checked whether the current key
is a valid drive name. Instead, we now iterate over a list
of valid drive names (with deterministic order) and check
whether a drive with such a name exists in the
configuration.

Also rename the two involved methods from valid_drive_name
to is_valid_drive_name (for the check) and from disknames
to valid_drive_names (for the list of valid keys), for
consistency. These two were only used in the qemu-server
code base.
2016-03-04 06:25:48 +01:00
Fabian Grünbichler
521c52e09c Remove dead code
This sub is not used anywhere.
2016-03-01 09:31:09 +01:00
Fabian Grünbichler
ff9922861a Don't apply snapshot config in snapshot_commit
We hold a lock from snapshot_prepare until snapshot_commit,
so there is no need to copy back the snapshot config to the
actual config. This allows to drop a workaround for not
copying the 'machine' type config option.
2016-03-01 08:37:05 +01:00
Wolfgang Bumiller
69bcf246bd indentation cleanup 2016-02-27 10:20:19 +01:00
Wolfgang Bumiller
6ada5d61c2 only perform scsi inquiry on device nodes
We don't have any storage types other than LVM which react
to scsi inquiry, and we don't want to treat LVM as a scsi
device, so now we only query devices added as actual /dev
path. This was originally intended to be a pass-through
feature anyway, so this makes sense.
2016-02-27 10:20:01 +01:00
Fabian Grünbichler
b2ca930a79 Refactor has_feature
backup_only is currently not used as snapshot backups are
handled by qemu, but this makes the signatures identical
to LXC.pm's has_feature.
2016-02-26 10:34:21 +01:00
Fabian Grünbichler
afa5eae56a Make snapshot_save_vmstate proper sub 2016-02-26 10:33:43 +01:00
Thomas Lamprecht
09b1142906 kvm_user_version: update code to use our framework
Replace backticks with run_command and also do not use
`kvm -help` which produces a lot of unecessary output, lets use
`kvm -version` instead.
2016-02-26 07:54:35 +01:00
Thomas Lamprecht
74cc511fda fix undefined value when starting a q35 machine VM
As there the signleton function "kvm_user_version" may not have been
called and with the machine alias q35 the regex from the
qemu_machine_feature_enabled method does not match and thus we
need a valid kvm version here
2016-02-26 07:48:35 +01:00
Fabian Grünbichler
2d3caa008c Refactor snapshot_create to match LXC.pm 2016-02-25 09:23:02 +01:00
Dominik Csapak
88240a83fb change check for write-zeros
instead of hardcoding the storagetypes for writing zeros on a
backup restore, we use volume_has_feature with 'sparseinit'
for determining if we can omit writing zeros

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-24 17:18:50 +01:00
Alexandre Derumier
d1363934b8 qemu_machine_pxe : return $machine if no pxe
Currently migration is broken, because qemu_machine_pxe return nothing if no pxe rom exist.

That mean that we don't pass -machine flag to migration, and migration is broken between qemu 2.4->2.5

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-22 17:33:27 +01:00
Fabian Grünbichler
ec61e9383f Make snapshot_prepare and snapshot_commit proper subs 2016-02-22 16:19:16 +01:00
Dominik Csapak
77cde36b4e deactivate volumes if vm start command fails
also for current master
cleanup of patch from Dhaussy Alexandre from 02/15/2016

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-20 10:26:05 +01:00
Dietmar Maurer
b42d3cf9d4 rename $ost to $ostype 2016-02-18 12:54:47 +01:00
Alexandre Derumier
b7be4ba92f disable vnc server and add -nographic is no vga card is present
For passthrough, we need to be sure that card is primary,
so we need to disable vnc server

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-18 12:54:47 +01:00
Alexandre Derumier
bd92244c35 passthrough : reenable hyperv and add hv_vendor_id for windows
qemu 2.5 support a new hyper-v feature: hv_vendor_id
This allow nvidia drivers to install on windows with hyper-v feature on.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-18 12:54:47 +01:00
Dominik Csapak
381b8fae81 delete ram state files when restoring a backup
currently we leave orphaned vmstate files when we restore a
backup over a vm, which has snapshots with saved ram state.

this patch deletes those files on a restore.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-18 11:53:46 +01:00
Fabian Grünbichler
7efedbf397 Refactor snapshot code
Split vmstate saving into its own sub in preparation of
LXC/QemuServer codebase refactoring.
2016-02-15 13:26:28 +01:00
Wolfgang Link
4dcc780c2a If we freeze the fs with the Qemu-Guest-Agent test if QGA is running. 2016-02-15 12:50:14 +01:00
Fabian Grünbichler
8317c759bf Drop skiplock from write_config
Since write_config was always called with skiplock=1 except
once, it makes sense to drop this parameter like in
PVE::LXC::write_config . If needed in the future, the
caller can use check_lock before write_config anyway.
2016-02-12 12:16:57 +01:00
Fabian Grünbichler
63be43a947 Refactor update_config_nolock -> write_config
The method update_config wrapped update_config_nolock
using lock_config, but to prevent update races the whole
"read config", "do something", "write config" flow was
always protected by lock_config anyway, and update_config
was never called.

Thus, we can safely drop update_config and rename
update_config_nolock to write_config like in PVE::LXC .
2016-02-12 12:14:52 +01:00
Dominik Csapak
a6b9aee42a use better usb config parsing
since we want the usb3 option to be really boolean and not only
'usb3=yes', we have to change the usb json format a little

to not break existing configs for 'usbX: spice', we set the 'host'
option as non-optional and default_key and allow 'spice' as its
content (this also makes the option less ambiguous)

another side effect is that previously accepted multiple 'host='
entries are now forbidden

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-11 16:42:24 +01:00
Wolfgang Bumiller
c0f7406e93 remove a superfluous condition
This is only reached if the $line from which $virtdev
originates matches, and the part in $virtdev can never be
false then.
2016-02-10 17:46:54 +01:00
Wolfgang Bumiller
d9faf79016 restore: deal with new backup=0 property string 2016-02-10 17:45:56 +01:00
Dominik Csapak
da8b4189d8 add usb3 option for usb-devices
adding a flag for usb devices (usb3), if this is set to yes,
add a xhci controller and attach the specified devices to it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-10 17:33:26 +01:00
Wolfgang Bumiller
15cc878469 pass $skiplock all the way through to destroy_vm
The API passes $skiplock to vm_destroy() which performed a
check conditionally depending on the $skiplock parameter and
then simply calls destroy_vm() inside lock_config() which
did yet another check_lock() without any way to avoid that.

Added the $skiplock parameter to destroy_vm() and removed
the conditional check in vm_destroy() as both happened after
locking the config.
2016-02-08 11:52:23 +01:00
Alexandre Derumier
f7b4356fe6 disk hotplug : allow hotplug of physical host /dev/ disks
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-04 18:09:38 +01:00
Wolfgang Bumiller
7d4e30f389 detect_zeroes is a boolean 2016-01-29 12:21:59 +01:00
Wolfgang Bumiller
47c28a687c Fix #878: disk-size format
disk-size is a format, not a type
2016-01-29 10:04:05 +01:00
Wolfgang Link
3457d090c6 Create firewall dir on VM restore 2016-01-28 11:02:55 +01:00
Wolfgang Bumiller
16a91d65f3 add hidden option to cpu type
This passes kvm=off to qemu's -cpu switch to disable KVM
identification via the cpuid instruction.
2016-01-26 16:57:13 +01:00
Wolfgang Link
5b61bff247 Use format raw if a disk is passthrough to VM.
To prevent error at VM starting, when we passthrough a harddrive from host to vm.
2016-01-25 17:32:21 +01:00
Wolfgang Bumiller
16d08ecfc3 use safe_string_ne for trunks
It's a list of numbers, not just one.
2016-01-18 11:00:28 +01:00