search for: guestfs_mkfs

Displaying 20 results from an estimated 31 matches for "guestfs_mkfs".

2013 Feb 04
1
Should we always do wipefs before mkfs? Discuss ...
https://bugzilla.redhat.com/show_bug.cgi?id=907554 In particular comments 2 & 3. We could change libguestfs's guestfs_mkfs (internally) so it always does an implicit wipefs on the filesystem. wipefs is not too onerous -- in particular I believe it only writes to a few chosen areas of the disk. Especially considering that we're about to run mkfs anyway which for some filesystems writes a lot of blocks. Thoughts?...
2014 Mar 18
2
[PATCH 1/2] php: make the test suite failures fatal
So far the failure of some test would have not reported a non-zero return value by run-tests.php. Since now all the PHP tests pass, we can ask for failures to be fatal, by exporting REPORT_EXIT_STATUS=1 for run-tests.php. --- php/run-php-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/run-php-tests.sh b/php/run-php-tests.sh index 6f9ae10..e498987 100755 ---
2016 Feb 03
5
[PATCH 0/3] tests: Various fixes for btrfs and aarch64.
These patches fix btrfs on aarch64. You still need btrfs-progs 4.4 which was only released a few days ago. Rich.
2012 Nov 14
1
Notes on compiling libguestfs 1.19.59 on Debian 7 (Wheezy) beta
In no particular order. Some of these need further investigation. ---------------------------------------------------------------------- I had to patch libguestfs not to use febootstrap-supermin-helper --copy-kernel option. See attachment #1. This could be avoided by providing a newer febootstrap in Wheezy. I had to patch libguestfs to make it not use the (not working) virtio-scsi in old
2016 Feb 12
0
[PATCH] php: restructure and expand tests
...ch ($g); + +guestfs_pvcreate ($g, "/dev/sda"); +guestfs_vgcreate ($g, "VG", array ("/dev/sda")); +guestfs_lvcreate ($g, "LV1", "VG", 200); +guestfs_lvcreate ($g, "LV2", "VG", 200); + +$lvs = guestfs_lvs ($g); +var_dump ($lvs); + +guestfs_mkfs ($g, "ext2", "/dev/VG/LV1"); +guestfs_mount ($g, "/dev/VG/LV1", "/"); +guestfs_mkdir ($g, "/p"); +guestfs_touch ($g, "/q"); + +function dir_cmp ($a, $b) +{ + return strcmp ($a["name"], $b["name"]); +} +function dir_ext...
2015 Jan 13
0
[PATCH] format, make-fs: specify the label on mkfs
...make-fs.c | 28 +++++++++++++++++----------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/format/format.c b/format/format.c index 4e6069f..cc371ab 100644 --- a/format/format.c +++ b/format/format.c @@ -434,13 +434,15 @@ do_format (void) } if (filesystem) { - if (guestfs_mkfs_opts (g, filesystem, dev, -1) == -1) - exit (EXIT_FAILURE); + struct guestfs_mkfs_opts_argv optargs = { .bitmask = 0 }; if (label) { - if (guestfs_set_label (g, dev, label) == -1) - exit (EXIT_FAILURE); + optargs.label = label; + optargs.bitmask |=...
2016 Feb 03
0
[PATCH 1/3] tests: Increase the size of the /dev/sda and /dev/sdb test devices.
...sdb> 1GB F</dev/sdb1> is an ext2 filesystem used for testing filesystem write operations. diff --git a/generator/actions.ml b/generator/actions.ml index 4078082..881ec4e 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -4779,7 +4779,8 @@ C<blocksize> option of C<guestfs_mkfs>." }; proc_nr = Some 62; tests = [ InitEmpty, Always, TestResult ( - [["blockdev_getsz"; "/dev/sda"]], "ret == 1024000"), [] + [["blockdev_getsz"; "/dev/sda"]], + "ret == INT64_C(10)*1024*1024*102...
2016 Feb 08
1
[PATCH] tests: reduce sizes of scratch disks to 2 GB
...db> 2 GB F</dev/sdb1> is an ext2 filesystem used for testing filesystem write operations. diff --git a/generator/actions.ml b/generator/actions.ml index 36b8680..eb45392 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -4780,7 +4780,7 @@ C<blocksize> option of C<guestfs_mkfs>." }; tests = [ InitEmpty, Always, TestResult ( [["blockdev_getsz"; "/dev/sda"]], - "ret == INT64_C(10)*1024*1024*1024/512"), [] + "ret == INT64_C(2)*1024*1024*1024/512"), [] ]; shortdesc = "get to...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of local disk. Rich.
2015 May 06
0
Re: libguestfs init problem
...exit (EXIT_FAILURE); > if (partitions[0] == NULL || partitions[1] != NULL) { > fprintf (stderr, "error: expected a single partition from > list-partitions\n"); > exit (EXIT_FAILURE); > } > > /* Create a filesystem on the partition. */ > if (guestfs_mkfs (g, "ext4", partitions[0]) == -1) > exit (EXIT_FAILURE); > > /* Now mount the filesystem so that we can add files. */ > if (guestfs_mount (g, partitions[0], "/") == -1) > exit (EXIT_FAILURE); > > /* Create some files and directories. */...
2015 Jan 13
3
[PATCH] mkfs: add 'label' optional argument
...ctorsize) + const char *features, int inode, int sectorsize, const char *label) { const char *argv[MAX_ARGS]; size_t i = 0; @@ -194,6 +194,47 @@ do_mkfs (const char *fstype, const char *device, int blocksize, ADD_ARG (argv, i, sectorsize_str); } + if (optargs_bitmask & GUESTFS_MKFS_LABEL_BITMASK) { + if (extfs) { + if (strlen (label) > EXT2_LABEL_MAX) { + reply_with_error ("%s: ext2 labels are limited to %d bytes", + label, EXT2_LABEL_MAX); + return -1; + } + + ADD_ARG (argv, i, "-L"); + ADD_...
2018 Aug 20
1
[PATCH nbdkit] tests: Add a root only test of the file plugin with
In libguestfs we have a few tests that require root privileges and they are skipped by default (normally you should not build or test as root), but you can do this to run them: sudo make check-root In nbdkit I wanted to check that the file plugin works with block devices (this is not tested), and the only way I can sensibly think to do this is using a loopback device and root. This commit
2015 May 05
3
libguestfs init problem
Hi ,all : thanks for helping me ! I am using libguestfs-1.28.1 on ubuntu 12.04 to manage vm disk created by KVM. I downloaded libguestfs-1.28.1.tar.gz ,and then executed (1) ./autogen.sh (2) ./configure (3) make (4) make check .there is the error. /usr/Libvmi/libguestfs-1.28.1/run --test guest-aux/make-fedora-img.pl md_create: feature 'mdadm' is not available in this
2019 Apr 01
1
[PATCH nbdkit v2] Add readahead filter.
Simpler, and including tests. Rich.
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
..._last_error (g)); CLEANUP_FREE char *part; - if (asprintf (&part, "%s1", device) == -1) { - perror ("asprintf"); - exit (EXIT_FAILURE); - } + if (asprintf (&part, "%s1", device) == -1) + error (EXIT_FAILURE, errno, "asprintf"); if (guestfs_mkfs (g, data->params[0], part) == -1) prep_error (data, filename, _("failed to create boot filesystem: %s"), guestfs_last_error (g)); CLEANUP_FREE char *part2; - if (asprintf (&part2, "%s2", device) == -1) { - perror ("asprintf"); -...
2015 Jul 21
0
ANNOUNCE: libguestfs 1.30 released
...upid parameter (Hu Tao). guestfs_set_uuid can set UUID of swap partitions, Btrfs (Hu Tao, Chen Hanxiao). guestfs_copy_device_to_file and guestfs_copy_file_to_file have a new optional append parameter, allowing you to append to the output file instead of truncating it. guestfs_mkfs has a new optional label parameter to set the initial label of the new filesystem (Pino Toscano). guestfs_set_label and guestfs_set_uuid now set ENOTSUP as errno when there is no implemented support for the filesystem of the specified mountable (Chen Hanxiao). Environment vari...
2017 Apr 20
1
[PATCH] tests: Replace test-max-disks with several tests.
...LURE, errno, "asprintf"); + } + else { + if (guestfs_part_disk (g, devices[i], "mbr") == -1) + exit (EXIT_FAILURE); + if (asprintf (&part, "%s1", devices[i]) == -1) + error (EXIT_FAILURE, errno, "asprintf"); + } + + if (guestfs_mkfs (g, "ext2", part) == -1) + exit (EXIT_FAILURE); + if (guestfs_mount (g, part, mp) == -1) + exit (EXIT_FAILURE); + + if (asprintf (&file, "%s/disk%zu", mp, i) == -1) + error (EXIT_FAILURE, errno, "asprintf"); + if (asprintf (&data, "...
2017 Mar 03
2
[PATCH] generator: Allow actions to be deprecated with no replacement.
...ze"], []; - deprecated_by = Some "mkfs"; + deprecated_by = Replaced_by "mkfs"; shortdesc = "set blocksize of block device"; longdesc = "\ This call does nothing and has never done anything @@ -186,7 +186,7 @@ C<blocksize> option of C<guestfs_mkfs>." }; { defaults with name = "tgz_in"; added = (1, 0, 3); style = RErr, [FileIn "tarball"; Pathname "directory"], []; - deprecated_by = Some "tar_in"; + deprecated_by = Replaced_by "tar_in"; cancellable = true; t...
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...ng. */ - if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) { - fprintf (stderr, - _("libguestfs-test-tool: failed to run part-disk\n")); + if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) exit (EXIT_FAILURE); - } - if (guestfs_mkfs (g, "ext2", "/dev/sda1") == -1) { - fprintf (stderr, - _("libguestfs-test-tool: failed to mkfs.ext2\n")); + if (guestfs_mkfs (g, "ext2", "/dev/sda1") == -1) exit (EXIT_FAILURE); - } - if (guestfs_mount (g, "/dev/sda1&qu...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...E); } alarm (0); @@ -216,31 +216,31 @@ main (int argc, char *argv[]) if (guestfs_sfdiskM (g, "/dev/sda", sfdisk_lines) == -1) { fprintf (stderr, _("libguestfs-test-tool: failed to run sfdisk\n")); - exit (1); + exit (EXIT_FAILURE); } if (guestfs_mkfs (g, "ext2", "/dev/sda1") == -1) { fprintf (stderr, _("libguestfs-test-tool: failed to mkfs.ext2\n")); - exit (1); + exit (EXIT_FAILURE); } if (guestfs_mount (g, "/dev/sda1", "/") == -1) { fprintf (stderr,...