5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-10 09:17:37 +03:00
Commit Graph

444 Commits

Author SHA1 Message Date
Wolfgang Bumiller
d0229d1d82 fix O_PATH value 2016-04-05 06:14:12 +02:00
Dietmar Maurer
8506c60dba generate_typetext: avoid warning with aliases 2016-04-03 16:09:07 +02:00
Dietmar Maurer
ed258d2884 update changelog 2016-04-01 09:02:37 +02:00
Wolfgang Bumiller
2ec5361456 generate_typetext: handle enums and booleans automatically 2016-04-01 09:01:30 +02:00
Wolfgang Bumiller
445e8267b2 property strings: introduce key grouping feature
Use case: networks for kvm use a <model>=<macaddr> scheme
where the model represents the network card. The schema
previously could not represent this, so we now introduce a
'group' key which works similar to an alias with the
difference that the data structure also gets an entry named
after the group filled with the name of the key that was
used to fill it.

Usage:
{
    virtio => { group => 'model' },
    e1000 => { group => 'model' },
    model => {
        type => 'string',
        pattern => ... # pattern for mac address
        ...
    }
}

Now the string 'virtio=aa:bb:cc:dd:ee:ff' gets parsed into:
{
    model => 'virtio',
    virtio => 'aa:bb:cc:dd:ee:ff'
}

Error examples:
  With bad value:
    virtio: value does not match the regex pattern
  Missing group:
    model: property is missing and it is not optional

parse_net() however used the 'macaddr' key for the mac
address, which can be achieved by aliasing 'model' to
'macaddr':
{
    virtio => { group => 'model' },
    e1000 => { group => 'model' },
    model => { alias => 'macaddr' },
    macaddr => {
        type => 'string',
        pattern => ... # pattern for mac address
        ...
    }
}

Then the above string will be parsed into:
{
    model => 'virtio',
    macaddr => 'aa:bb:cc:dd:ee:ff'
}

The error output now always shows the 'macaddr' key:
Error examples:
  With bad value:
    macaddr: value does not match the regex pattern
  Missing group:
    macaddr: property is missing and it is not optional

In order to support specifying no mac address we can now set
model.default_key = 1 and macaddr.optional = 1.
That way `virtio,bridge=vmbr2` gets parsed correctly into
just a model with no macaddr. This works because default
keys as aliases have previously not been supported and would
not have been aliased accordingly. This case is now also
taken into account when printing default keys, which is now
skipped if it is also an alias.
2016-04-01 09:00:53 +02:00
Dietmar Maurer
c3608045b8 bump version to 4.0-57 2016-04-01 07:17:09 +02:00
Fabian Grünbichler
34f860a262 fix #923: uninitalized value in remove_lock 2016-04-01 07:15:21 +02:00
Dietmar Maurer
df79b4284d get_property_description: introduce new $style parameter
config => colon separated config files
arg => command line argument
fixed => fixed command line argument (see usage_str())
2016-03-31 05:57:37 +02:00
Wolfgang Bumiller
166e27c74f cleanup: whitespace and than/then typo 2016-03-23 11:38:26 +01:00
Dietmar Maurer
a736ac996c get_property_description: add new 'text' format 2016-03-23 10:19:15 +01:00
Dietmar Maurer
921f91d1d5 get_property_description: use correct base name opt[n] 2016-03-23 09:27:18 +01:00
Dietmar Maurer
8fa050cd62 new PVE::RESTHandler::dump_properties
The plan is to replace code in PodParser.
2016-03-23 06:58:10 +01:00
Dietmar Maurer
8ff24fe8cb fix spelling errors 2016-03-22 10:39:16 +01:00
Dietmar Maurer
ee9e7f3dc4 bump version to 4.0-56 2016-03-21 08:47:39 +01:00
Wolfgang Bumiller
c77b4c9640 add the 'urlencoded' string format 2016-03-21 08:09:22 +01:00
Wolfgang Bumiller
28a2669d9b cleanup: full path package references to self
This started happening when moving the 'pve-storage-id'
option from pve-storage and curously kept on going since
then...
2016-03-21 08:08:40 +01:00
Wolfgang Bumiller
b14889b1c8 cleanup: newlines in die/warn 2016-03-21 08:04:17 +01:00
Wolfgang Bumiller
ae6682cd08 property strings: check for commas in values 2016-03-21 08:03:55 +01:00
Dietmar Maurer
0ed28a89eb bump version to 4.0-55 2016-03-16 16:48:44 +01:00
Fabian Grünbichler
5f80891404 add missing check for undef in is_mounted 2016-03-16 16:47:51 +01:00
Dietmar Maurer
9e23d2fb61 bump version to 4.0-54 2016-03-15 06:46:20 +01:00
Wolfgang Bumiller
ab08ec798d net: don't die in get_active_interfaces() and try both address families 2016-03-15 06:45:29 +01:00
Wolfgang Bumiller
c4534006af cleanup: regex match group reference
Don't refer to the regex match group via $1 after running
other code.
2016-03-09 17:58:08 +01:00
Wolfgang Bumiller
1b915170db net: improve ingress tc filter
Instead of doing a dummy "0 == 0" comparison with the u32
filter just use the 'basic' filter.
2016-03-08 15:58:57 +01:00
Dietmar Maurer
b7248cc7b1 bump version to 4.0-53 2016-03-08 15:51:30 +01:00
Wolfgang Bumiller
bce2a5b34c net: tap_plug() needs to apply rate limiting
Any action we take in tap_plug() when using OVS will undo
our rate limiting, which means any hotplug change must
restore the previous rate setting.
Since this means tap_plug() would always be followed by a
tap_rate_limit() call anyway we just include the rate
parameter here and let the caller decide whether the full
tap_plug() is required or the simple tap_rate_limit()
suffices.
2016-03-08 15:50:17 +01:00
Wolfgang Bumiller
ad066ae2de network: tap_rate_limit: fix uninitialized value 2016-03-08 15:50:03 +01:00
Wolfgang Bumiller
5a917b429a pod: skip aliases in generate_property_text
These are special and have no other properties to access.
2016-03-08 12:00:56 +01:00
Dietmar Maurer
b249031c64 bump version to 4.0-52 2016-03-08 11:34:42 +01:00
Fabian Grünbichler
246232024f Decide whether volume is added as unused in subclass
since we need the volume ID of the volume/drive/mp, which is
only available after parsing, this needs to be done in the
subclasses.

__snapshot_delete_vol_snapshot() gets a new parameter, and
pushes the volid to this array if it should be added as
unused.
2016-03-08 11:33:28 +01:00
Fabian Grünbichler
ba9db5df17 Introduce __snapshot_create_vol_snapshots_hook
This hook runs before and after creating volume snapshots,
as well as after unfreezing. Only needed for Qemu right now,
so the base case in PVE::AbstractConfig is a noop.
2016-03-08 11:32:24 +01:00
Dietmar Maurer
bf536088d7 bump version to 4.0-51 2016-03-03 10:12:55 +01:00
Fabian Grünbichler
53c255218e Add AbstractConfig base class
This class contains common code formerly duplicated in
PVE::LXC and PVE::QemuServer, as well as abstract methods
that must be implemented for LXC and Qemu seperately.

Currently implemented in PVE::LXC::Config, Qemu refactoring
will follow.
2016-03-03 10:11:51 +01:00
Dietmar Maurer
724dc41878 bump version to 4.0-50 2016-03-02 06:23:40 +01:00
Thomas Lamprecht
19e95cd08f Add since and until parameter to dump_journal
journalctl can check their validness itself
2016-03-02 06:22:47 +01:00
Wolfgang Bumiller
7b1e4b04b2 pod: generate property string documentation
Generate the more detailed documentation with the
'description' property provided in the property-string
format schema for the '*.conf'(5) manpages.
2016-02-27 10:38:38 +01:00
Dietmar Maurer
6a4950944d bump version to 4.0-49 2016-02-18 09:40:53 +01:00
Wolfgang Bumiller
f0ba41a135 schema: error on missing keys without default keys 2016-02-18 09:40:13 +01:00
Dominik Csapak
50ae94c97b limit vmid with JSON format
if we do not do this, vmids < 100 (not really bad) and
vmids > 999999999 are possible, which can lead to vms which you can
only get rid of, if you delete the config files manually

also this makes the api consistent with the webgui for vmids

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-15 12:52:54 +01:00
Wolfgang Bumiller
f029c1d092 network: get rid of ioctl.ph 2016-02-12 11:17:20 +01:00
Wolfgang Bumiller
d1e490c12f schema: disable additional properties in property strings
Changed the default additional_properties parameter when
verifying them from undefined (which defaults to 1) to 0.

parse_property_strings() now takes an optional
additional_properties parameter, too.
2016-02-11 12:03:00 +01:00
Dietmar Maurer
c9f0e76bc4 bump version to 4.0-48 2016-02-11 11:25:02 +01:00
Wolfgang Bumiller
44acb12c27 added syncfs syscall and sync_mountpoint helper 2016-02-11 11:24:11 +01:00
Dietmar Maurer
dde69c3200 update changelog 2016-02-10 12:21:05 +01:00
Wolfgang Bumiller
12a235d624 Fix #882: active state of interfaces depends on ipv6
read_etc_network_interfaces used the content of
/proc/net/if_inet6 to decide whether an interface's state is
"active", which means an interface is only active when it
has an ipv6 address, thus using net.ipv6.conf.*.disable_ipv6
on an interface will cause it to show as inactive in the web
interface.

We now filter the interfaces found in /proc/dev/net by their
IFF_UP flag read via an SIOCGIFFLAGS ioctl().
2016-02-10 12:20:21 +01:00
Dietmar Maurer
2701dc7479 bump version to 4.0-47 2016-02-10 11:14:06 +01:00
Fabian Grünbichler
f127adaba5 Implement refcounting for flocks
This was already implemented in PVE::LXC::lock_aquire() and
lock_release(). Enabling refcounting in the general
PVE::Tools::lock_file() and lock_file_full() methods allows
us to use one code base for flocking.

Furthermore, we could get rid of various xx_no_lock methods
that were required because the old non-refcounting version
did not support nested flocks (the inner most flock would
close the file handle and thus release the flock).
2016-02-10 11:12:12 +01:00
Wolfgang Bumiller
881eb75531 CLIHandler: add missing use PVE::INotify
It uses PVE::INotify::inotify_init() in run_cli_handler().
2016-02-10 10:26:33 +01:00
Dietmar Maurer
8cbc26d3a8 bump version to 4.0-46 2016-01-27 16:56:00 +01:00
Thomas Lamprecht
c1073fdc48 add upid_wait method
Waits for a process identified by a UPID to end by busy waiting
and is intended for long running workers.

waitfunc gets called every wait cycle after min $sleep_interval
seconds and can be used for outputting/logging something or timing
out the wait.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-01-27 16:54:50 +01:00