]> git.proxmox.com Git - pve-container.git/commitdiff
add manual page for container configuration format
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 6 Aug 2015 14:37:51 +0000 (16:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 6 Aug 2015 14:37:51 +0000 (16:37 +0200)
src/Makefile
src/PVE/LXC.pm
src/PVE/Makefile
src/gen-pct-conf-pod.pl [new file with mode: 0755]

index 6b43d659e3fb50f60a017d42d502359587dcf15c..6a9a8a2795b01931981545371229ed76dc6b9b8f 100644 (file)
@@ -11,6 +11,7 @@ LXC_HOOK_DIR=${LXC_SCRIPT_DIR}/hooks
 LXC_COMMON_CONFIG_DIR=${LXC_SCRIPT_DIR}/config/common.conf.d
 PODDIR=${DOCDIR}/pod
 MAN1DIR=${MANDIR}/man1/
+MAN5DIR=${MANDIR}/man5/
 export PERLDIR=${PREFIX}/share/perl5
 
 all:
@@ -19,14 +20,21 @@ all:
        rm -f $@
        cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
 
+%.5.gz: %.5.pod
+       rm -f $@
+       cat $<|pod2man -n $* -s 5 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
+
 pct.1.pod: pct
        perl -I. -T ./pct printmanpod >$@
 
+pct.conf.5.pod: gen-pct-conf-pod.pl PVE/LXC.pm
+       perl -I. ./gen-pct-conf-pod.pl >$@
+
 lxc-pve-mount-hook.1.pod: lxc-pve-mount-hook
        perl -I. -T ./lxc-pve-mount-hook printmanpod >$@
 
 .PHONY: install
-install: pct lxc-pve.conf lxc-pve-mount-hook lxcnetaddbr lxc-pve-mount-hook.1.pod lxc-pve-mount-hook.1.gz pct.1.pod pct.1.gz
+install: pct lxc-pve.conf lxc-pve-mount-hook lxcnetaddbr lxc-pve-mount-hook.1.pod lxc-pve-mount-hook.1.gz pct.1.pod pct.1.gz pct.conf.5.pod pct.conf.5.gz
        perl -T -I. ./pct verifyapi
        install -d ${SBINDIR}
        install -m 0755 pct ${SBINDIR}
@@ -38,9 +46,12 @@ install: pct lxc-pve.conf lxc-pve-mount-hook lxcnetaddbr lxc-pve-mount-hook.1.po
        install -m 0644 lxc-pve.conf ${LXC_COMMON_CONFIG_DIR}/01-pve.conf
        make -C PVE install
        install -d ${MAN1DIR}
+       install -d ${MAN5DIR}
        install -d ${PODDIR}
        install -m 0644 pct.1.gz ${MAN1DIR}
        install -m 0644 pct.1.pod ${PODDIR}
+       install -m 0644 pct.conf.5.pod ${PODDIR}
+       install -m 0644 pct.conf.5.gz ${MAN5DIR}
 
 .PHONY: test
 test:
index 1aab3339615a8e7abf71a1bd025ab613215b7e33..21f03a42010441dc1acf64c518d73b0857b8277f 100644 (file)
@@ -99,7 +99,7 @@ my $confdesc = {
        description => "CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.\n\nNOTE: You can disable fair-scheduler configuration by setting this to 0.",
        minimum => 0,
        maximum => 500000,
-       default => 1000,
+       default => 1024,
     },
     memory => {
        optional => 1,
index b78960e6ec0ad1a2ce6d0849d2f8383e148f20bf..8b399beeabde1532992054652384e8cac6a4c9f5 100644 (file)
@@ -1,7 +1,7 @@
 SOURCES=LXC.pm LXCSetup.pm LXCCreate.pm
 
 .PHONY: install
-install:
+install: ${SOURCES} 
        install -d -m 0755 ${PERLDIR}/PVE
        for i in ${SOURCES}; do install -D -m 0644 $$i ${PERLDIR}/PVE/$$i; done
        make -C API2 install
diff --git a/src/gen-pct-conf-pod.pl b/src/gen-pct-conf-pod.pl
new file mode 100755 (executable)
index 0000000..ac9eeb0
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+
+package main;
+
+use lib '.';
+use strict;
+use warnings;
+use PVE::Tools;
+use PVE::LXC;
+use PVE::PodParser;
+
+my $properties = PVE::LXC::json_config_properties();
+my $format = PVE::PodParser::dump_properties($properties);
+
+my $parser = PVE::PodParser->new();
+$parser->{include}->{format} = $format;
+$parser->parse_from_file($0);
+
+exit 0;
+
+__END__
+
+=head1 NAME
+
+pct.conf - Proxmox VE Container (LXC) configuration files.
+
+=head1 SYNOPSYS
+
+The F</etc/pve/lxc/C<VMID>.conf> files stores container
+configuration, where C<VMID> is the numeric ID of the given VM. Note
+that C<VMID <= 100> are reserved for internal purposes.
+
+=head1 FILE FORMAT
+
+Configuration files use a simple colon separated key/value format. Each
+line has the following format:
+
+ OPTION: value
+
+Blank lines in the file are ignored, and lines starting with a C<#>
+character are treated as comments and are also ignored.
+
+One can use the F<pct> command to generate and modify those files.
+
+=head1 OPTIONS
+
+=include format
+
+=include pve_copyright