search for: guestfs_disk_create

Displaying 20 results from an estimated 23 matches for "guestfs_disk_create".

2014 Nov 23
0
[PATCH 1/3] lib: guestfs_disk_create: Allow vmdk as a valid backingformat.
...| 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/create.c b/src/create.c index 621ace5..bfb8b76 100644 --- a/src/create.c +++ b/src/create.c @@ -261,7 +261,12 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size, if (optargs->bitmask & GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK) { backingformat = optargs->backingformat; - if (STRNEQ (backingformat, "raw") && STRNEQ (backingformat, "qcow2")) { + /* Conservative whitelist. This can be extended with other + * valid formats as required. + */ + if (STR...
2020 Feb 06
3
[PATCH] lib: Autodetect backing format and specify it explicitly.
In the guestfs_disk_create API we have traditionally allowed you to set backingfile without setting backingformat. The meaning of this is to let qemu autodetect the backing format when opening the overlay disk. However libvirt >= 6.0 refuses to even pass such disks to qemu (see https://bugzilla.redhat.com/show_bug.cgi?i...
2017 Sep 20
1
Re: [PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...1; > - filename = safe_asprintf (g, "%s/scratch.%d", g->tmpdir, ++g->unique); > + filename = guestfs_int_make_temp_path (g, "scratch", "img"); > + if (!filename) > + return -1; > > /* Create a raw format temporary disk. */ > if (guestfs_disk_create (g, filename, "raw", size, -1) == -1) The calls to guestfs_int_lazy_make_tmpdir can be removed in the files above, like done already in the launch-*.c files. -- Pino Toscano
2020 Mar 09
3
Re: [PATCH] lib: Autodetect backing format and specify it explicitly.
On Mon, Mar 09, 2020 at 11:07:20AM +0100, Pino Toscano wrote: > On Thursday, 6 February 2020 18:20:19 CET Richard W.M. Jones wrote: > > In the guestfs_disk_create API we have traditionally allowed you to > > set backingfile without setting backingformat. The meaning of this is > > to let qemu autodetect the backing format when opening the overlay > > disk. > > > > However libvirt >= 6.0 refuses to even pass such disks to qe...
2014 Jan 28
0
[PATCH 05/10] examples: Update various examples to use new disk-create API.
...exit (EXIT_FAILURE); - } - if (close (fd) == -1) { - perror ("disk.img: close"); - exit (EXIT_FAILURE); } /* Set the trace flag so that we can see each libguestfs call. */ guestfs_set_trace (g, 1); + /* Create a raw-format sparse disk image, 512 MB in size. */ + if (guestfs_disk_create (g, "disk.img", "raw", UINT64_C(512)*1024*1024, + -1) == -1) + exit (EXIT_FAILURE); + /* Add the disk image to libguestfs. */ if (guestfs_add_drive_opts (g, "disk.img", GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", /* raw f...
2020 Mar 09
2
Re: [PATCH] lib: Autodetect backing format and specify it explicitly.
...09, 2020 at 12:07:08PM +0100, Pino Toscano wrote: > On Monday, 9 March 2020 11:40:46 CET Richard W.M. Jones wrote: > > On Mon, Mar 09, 2020 at 11:07:20AM +0100, Pino Toscano wrote: > > > On Thursday, 6 February 2020 18:20:19 CET Richard W.M. Jones wrote: > > > > In the guestfs_disk_create API we have traditionally allowed you to > > > > set backingfile without setting backingformat. The meaning of this is > > > > to let qemu autodetect the backing format when opening the overlay > > > > disk. > > > > > > > > However libvi...
2016 Dec 11
3
[PATCH 0/2] generic function for temporary path generation
Cosmetic change as suggested in this previous patch: https://www.redhat.com/archives/libguestfs/2016-November/msg00111.html Matteo Cafasso (2): lib: generic function for temporary path generation lib: use guestfs_int_make_temp_path to generate temporary files src/drives.c | 5 ++--- src/file.c | 22 +++++++++------------- src/guestfs-internal.h | 1 + src/journal.c
2020 Mar 09
0
Re: [PATCH] lib: Autodetect backing format and specify it explicitly.
On Thursday, 6 February 2020 18:20:19 CET Richard W.M. Jones wrote: > In the guestfs_disk_create API we have traditionally allowed you to > set backingfile without setting backingformat. The meaning of this is > to let qemu autodetect the backing format when opening the overlay > disk. > > However libvirt >= 6.0 refuses to even pass such disks to qemu (see > https://bugz...
2020 Mar 09
0
Re: [PATCH] lib: Autodetect backing format and specify it explicitly.
On Monday, 9 March 2020 11:40:46 CET Richard W.M. Jones wrote: > On Mon, Mar 09, 2020 at 11:07:20AM +0100, Pino Toscano wrote: > > On Thursday, 6 February 2020 18:20:19 CET Richard W.M. Jones wrote: > > > In the guestfs_disk_create API we have traditionally allowed you to > > > set backingfile without setting backingformat. The meaning of this is > > > to let qemu autodetect the backing format when opening the overlay > > > disk. > > > > > > However libvirt >= 6.0 refuses to e...
2020 Mar 09
0
Re: [PATCH] lib: Autodetect backing format and specify it explicitly.
...PM +0100, Pino Toscano wrote: > > On Monday, 9 March 2020 11:40:46 CET Richard W.M. Jones wrote: > > > On Mon, Mar 09, 2020 at 11:07:20AM +0100, Pino Toscano wrote: > > > > On Thursday, 6 February 2020 18:20:19 CET Richard W.M. Jones wrote: > > > > > In the guestfs_disk_create API we have traditionally allowed you to > > > > > set backingfile without setting backingformat. The meaning of this is > > > > > to let qemu autodetect the backing format when opening the overlay > > > > > disk. > > > > > > > &gt...
2016 Dec 11
0
[PATCH 2/2] lib: use guestfs_int_make_temp_path to generate temporary files
...(tmpfile == NULL) return NULL; /* Because we create a special file, there is no point forcing qemu @@ -429,8 +430,6 @@ create_drive_dev_null (guestfs_h *g, */ data->readonly = false; - tmpfile = safe_asprintf (g, "%s/devnull%d", g->tmpdir, ++g->unique); - if (guestfs_disk_create (g, tmpfile, "raw", 4096, -1) == -1) return NULL; diff --git a/src/file.c b/src/file.c index d57c4e1..53b859d 100644 --- a/src/file.c +++ b/src/file.c @@ -86,11 +86,10 @@ guestfs_impl_read_file (guestfs_h *g, const char *path, size_t *size_r) char *ret = NULL; struct stat stat...
2017 Sep 19
0
[PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...ake_tmpdir (g) == -1) return -1; - filename = safe_asprintf (g, "%s/scratch.%d", g->tmpdir, ++g->unique); + filename = guestfs_int_make_temp_path (g, "scratch", "img"); + if (!filename) + return -1; /* Create a raw format temporary disk. */ if (guestfs_disk_create (g, filename, "raw", size, -1) == -1) diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c index 3e44b23eb..533e9fb4b 100644 --- a/lib/inspect-icon.c +++ b/lib/inspect-icon.c @@ -390,7 +390,9 @@ icon_cirros (guestfs_h *g, size_t *size_r) return NOT_FOUND; /* Use pbmtext to rende...
2015 May 06
0
Re: libguestfs init problem
...perror ("failed to create libguestfs handle"); > exit (EXIT_FAILURE); > } > > /* Set the trace flag so that we can see each libguestfs call. */ > guestfs_set_trace (g, 1); > > /* Create a raw-format sparse disk image, 512 MB in size. */ > if (guestfs_disk_create (g, "disk.img", "raw", UINT64_C(512)*1024*1024, > -1) == -1) > exit (EXIT_FAILURE); > > /* Add the disk image to libguestfs. */ > if (guestfs_add_drive_opts (g, "disk.img", > GUESTFS_ADD_DRIVE_OPTS_FORM...
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.
2014 Jan 28
11
[PATCH 00/10] New API: disk-create for creating blank disks.
A lot of code runs 'qemu-img create' or 'truncate' to create blank disk images. In the past I resisted adding an API to do this, since it essentially duplicates what you can already do using other tools (ie. qemu-img). However this does simplify calling code quite a lot since qemu-img is somewhat error-prone to use (eg: don't try to create a disk called "foo:bar")
2014 Mar 27
4
ANNOUNCE: libguestfs 1.26 released
...truct returned through the API, libguestfs now generates guestfs_compare_* and guestfs_copy_* functions to allow you to compare and copy structs. guestfs_copy_attributes Copy attributes (like permissions, xattrs, ownership) from one file to another. (Pino Toscano) guestfs_disk_create A flexible API for creating empty disk images from scratch. This avoids the need to call out to external programs like qemu-img(1). guestfs_get_backend_settings guestfs_set_backend_settings Per-backend settings (can also be set via the environment variable LIBGUE...
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory. Rich.
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
2016 Jan 06
0
ANNOUNCE: libguestfs 1.32 released
...lly virt-v2v). "guestfs_vfs_minimum_size" Return the minimum size of a filesystem (when shrunk). This supports ext2/3/4, XFS and btrfs, and can support other filesystem types in future (Maxim Perevedentsev). Other API changes "guestfs_disk_create": add "preallocation" = "off"/"metadata"/"full". For raw, this allows "off" as a synonym for "sparse" (making it consistent with qcow2). For qcow2, this allows "sparse" as a synonym for &quo...
2015 Jul 21
0
ANNOUNCE: libguestfs 1.30 released
...s_part_get_mbr_part_type Get MBR partition type (Chen Hanxiao). guestfs_set_uuid_random Set the UUID of a filesystem to a randomly generated value; supported filesystems currently are ext2/3/4, XFS, Btrfs, and swap partitions. (Chen Hanxiao). Other API changes guestfs_disk_create can now use VMDK files as backing files. guestfs_btrfs_subvolume_snapshot takes extra optional parameters (all added by Hu Tao): ro for creating a read-only Btrfs snapshot qgroupid for adding the snapshot to a qgroup guestfs_btrfs_subvolume_create can also take...