File: prepopts.c

package info (click to toggle)
libguestfs 1%3A1.18.1-1%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,156 kB
  • sloc: ansic: 282,408; ml: 22,707; sh: 16,121; perl: 5,946; java: 5,047; cs: 4,329; makefile: 3,191; haskell: 2,564; erlang: 1,510; python: 1,502; xml: 509; ruby: 217; pascal: 142; cpp: 11
file content (102 lines) | stat: -rw-r--r-- 5,432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* libguestfs generated file
 * WARNING: THIS FILE IS GENERATED FROM:
 *   generator/generator_*.ml
 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
 *
 * Copyright (C) 2009-2012 Red Hat Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include <stdio.h>

#include "fish.h"
#include "prepopts.h"

static struct prep_param disk_args[] = {
  { "size", "100M", "the size of the disk image" },
};

static struct prep_param part_args[] = {
  { "size", "100M", "the size of the disk image" },
  { "partition", "mbr", "partition table type" },
};

static struct prep_param fs_args[] = {
  { "filesystem", "ext2", "the type of filesystem to use" },
  { "size", "100M", "the size of the disk image" },
  { "partition", "mbr", "partition table type" },
};

static struct prep_param lv_args[] = {
  { "name", "/dev/VG/LV", "the name of the VG and LV to use" },
  { "size", "100M", "the size of the disk image" },
  { "partition", "mbr", "partition table type" },
};

static struct prep_param lvfs_args[] = {
  { "name", "/dev/VG/LV", "the name of the VG and LV to use" },
  { "filesystem", "ext2", "the type of filesystem to use" },
  { "size", "100M", "the size of the disk image" },
  { "partition", "mbr", "partition table type" },
};

static struct prep_param bootroot_args[] = {
  { "bootfs", "ext2", "the type of filesystem to use for boot" },
  { "rootfs", "ext2", "the type of filesystem to use for root" },
  { "size", "100M", "the size of the disk image" },
  { "bootsize", "32M", "the size of the boot filesystem" },
  { "partition", "mbr", "partition table type" },
};

static struct prep_param bootrootlv_args[] = {
  { "name", "/dev/VG/LV", "the name of the VG and LV for root" },
  { "bootfs", "ext2", "the type of filesystem to use for boot" },
  { "rootfs", "ext2", "the type of filesystem to use for root" },
  { "size", "100M", "the size of the disk image" },
  { "bootsize", "32M", "the size of the boot filesystem" },
  { "partition", "mbr", "partition table type" },
};

const struct prep preps[] = {
  { "disk", 1, disk_args,
    "create a blank disk",
    "  Create a blank disk, size 100MB (by default).\n\n  The default size can be changed by supplying an optional parameter.",
    prep_prelaunch_disk, prep_postlaunch_disk },
  { "part", 2, part_args,
    "create a partitioned disk",
    "  Create a disk with a single partition.  By default the size of the disk\n  is 100MB (the available space in the partition will be a tiny bit smaller)\n  and the partition table will be MBR (old DOS-style).\n\n  These defaults can be changed by supplying optional parameters.",
    prep_prelaunch_part, prep_postlaunch_part },
  { "fs", 3, fs_args,
    "create a filesystem",
    "  Create a disk with a single partition, with the partition containing\n  an empty filesystem.  This defaults to creating a 100MB disk (the available\n  space in the filesystem will be a tiny bit smaller) with an MBR (old\n  DOS-style) partition table and an ext2 filesystem.\n\n  These defaults can be changed by supplying optional parameters.",
    prep_prelaunch_fs, prep_postlaunch_fs },
  { "lv", 3, lv_args,
    "create a disk with logical volume",
    "  Create a disk with a single partition, set up the partition as an\n  LVM2 physical volume, and place a volume group and logical volume\n  on there.  This defaults to creating a 100MB disk with the VG and\n  LV called /dev/VG/LV.  You can change the name of the VG and LV\n  by supplying an alternate name as the first optional parameter.\n\n  Note this does not create a filesystem.  Use 'lvfs' to do that.",
    prep_prelaunch_lv, prep_postlaunch_lv },
  { "lvfs", 4, lvfs_args,
    "create a disk with logical volume and filesystem",
    "  Create a disk with a single partition, set up the partition as an\n  LVM2 physical volume, and place a volume group and logical volume\n  on there.  Then format the LV with a filesystem.  This defaults to\n  creating a 100MB disk with the VG and LV called /dev/VG/LV, with an\n  ext2 filesystem.",
    prep_prelaunch_lvfs, prep_postlaunch_lvfs },
  { "bootroot", 5, bootroot_args,
    "create a boot and root filesystem",
    "  Create a disk with two partitions, for boot and root filesystem.\n  Format the two filesystems independently.  There are several optional\n  parameters which control the exact layout and filesystem types.",
    prep_prelaunch_bootroot, prep_postlaunch_bootroot },
  { "bootrootlv", 6, bootrootlv_args,
    "create a boot and root filesystem using LVM",
    "  This is the same as 'bootroot' but the root filesystem (only) is\n  placed on a logical volume, named by default '/dev/VG/LV'.  There are\n  several optional parameters which control the exact layout.",
    prep_prelaunch_bootrootlv, prep_postlaunch_bootrootlv },
};