Displaying 13 results from an estimated 13 matches for "orig_filename".
2018 Aug 22
1
[PATCH] lib: create: avoid one extra string allocation
...f --git a/lib/create.c b/lib/create.c
index 60e467fb6..fcc5855e0 100644
--- a/lib/create.c
+++ b/lib/create.c
@@ -250,11 +250,10 @@ is_power_of_2 (unsigned v)
VALID_FLAG_ALPHA|VALID_FLAG_DIGIT, "")
static int
-disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
+disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
const char *backingfile,
const struct guestfs_disk_create_argv *optargs)
{
- CLEANUP_FREE char *filename = NULL;
const char *backingformat = NULL;
const char *preallo...
2017 Oct 06
2
[PATCH] lib: Pick up qemu-img path at build time.
...d_string_unquoted (cmd, "file info ");
* guestfs_int_cmd_add_string_quoted (cmd, filename);
*
* =item 4.
diff --git a/lib/create.c b/lib/create.c
index fff5cf332..b4865172c 100644
--- a/lib/create.c
+++ b/lib/create.c
@@ -314,7 +314,7 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
}
/* Assemble the qemu-img command line. */
- guestfs_int_cmd_add_arg (cmd, "qemu-img");
+ guestfs_int_cmd_add_arg (cmd, QEMU_IMG);
guestfs_int_cmd_add_arg (cmd, "create");
guestfs_int_cmd_add_arg (cmd, "-f");
guestfs_int_cmd_add_arg (...
2017 Jun 08
1
[PATCH] lib: create: Allow any [[:alnum:]]+ string as a backingfmt parameter.
...$>
+ * (in C locale), but limit the length to something reasonable.
+ */
+#define VALID_FORMAT(format) \
+ guestfs_int_string_is_valid ((format), 1, 16, \
+ VALID_FLAG_ALPHA|VALID_FLAG_DIGIT, "")
+
static int
disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
const char *backingfile,
@@ -267,12 +275,7 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
if (optargs->bitmask & GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK) {
backingformat = optargs->backingformat;
- /* Conserva...
2017 Jun 25
0
Re: [PATCH 1/2] launch: add support for autodetection of appliance image format
...h-libvirt.c | 15 +++++++++------
> 4 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/lib/create.c b/lib/create.c
> index bd4c32ef7..aedfe8670 100644
> --- a/lib/create.c
> +++ b/lib/create.c
> @@ -272,7 +272,8 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
> */
> if (STRNEQ (backingformat, "raw") &&
> STRNEQ (backingformat, "qcow2") &&
> - STRNEQ (backingformat, "vmdk")) {
> + STRNEQ (backingformat, "vmdk") &&
> +...
2010 Mar 11
2
[PATCH FOR DISCUSSION ONLY] Rewrite libguestfs-supermin-helper in C.
...T_FAILURE);
+ }
+ cpio_append_stat (filename, &statbuf);
+}
+
+/* Append the file to the cpio output. */
+#define PADDING(len) ((((len) + 3) & ~3) - (len))
+
+#define CPIO_HEADER_LEN (6 + 13*8)
+
+static void
+cpio_append_stat (const char *filename, struct stat *statbuf)
+{
+ const char *orig_filename = filename;
+
+ if (*filename == '/')
+ filename++;
+ if (*filename == '\0')
+ filename = ".";
+
+ if (verbose >= 2)
+ fprintf (stderr, "cpio_append_stat %s 0%o -> %d\n",
+ orig_filename, statbuf->st_mode, out_fd);
+
+ /* Regular...
2014 Nov 23
0
[PATCH 1/3] lib: guestfs_disk_create: Allow vmdk as a valid backingformat.
...just adds "vmdk" to this whitelist.
---
src/create.c | 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 extend...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...filename);
- cpio_append_stat (filename, &statbuf);
-}
-
-/* Append the file to the cpio output. */
-#define PADDING(len) ((((len) + 3) & ~3) - (len))
-
-#define CPIO_HEADER_LEN (6 + 13*8)
-
-static void
-cpio_append_stat (const char *filename, const struct stat *statbuf)
-{
- const char *orig_filename = filename;
-
- if (*filename == '/')
- filename++;
- if (*filename == '\0')
- filename = ".";
-
- if (verbose >= 2)
- fprintf (stderr, "cpio_append_stat %s 0%o -> %d\n",
- orig_filename, statbuf->st_mode, out_fd);
-
- /* Regular...
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 Nov 23
7
[PATCH 0/3] patches needed for virt-bmap
See http://rwmj.wordpress.com/2014/11/23/mapping-files-to-disk/
2020 Feb 24
3
*** buffer overflow detected *** accessing invalid FD in libguestfs
.../command.c:662
#8 0x00007ffff47ee2f5 in guestfs_int_cmd_run (cmd=0x7fffbc02abe0) at
../../../lib/command.c:767
#9 0x00007ffff47efefc in disk_create_qcow2 (optargs=0x7fffbc008d60,
backingfile=0x7fffbc09ef30
"/var/lib/nova/instances/5ca86029-d296-4261-9a67-908bdd6c4eab/disk",
size=-1,
orig_filename=0x7fffbc0301f0 "/tmp/libguestfszZtmRI/overlay1.qcow2",
g=0x7fffbc008d60) at ../../../lib/create.c:348
#10 guestfs_impl_disk_create (g=g@entry=0x7fffbc008d60,
filename=filename@entry=0x7fffbc0301f0
"/tmp/libguestfszZtmRI/overlay1.qcow2", format=<optimized out>,
format@e...
2015 Aug 12
1
[PATCH 1/2] disk-create: Allow preallocation off/metadata/full.
...if (STREQ (optargs->preallocation, "off") ||
+ STREQ (optargs->preallocation, "sparse"))
allocated = 0;
else if (STREQ (optargs->preallocation, "full"))
allocated = 1;
@@ -273,8 +274,15 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
}
}
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
- preallocation = optargs->preallocation;
- if (STRNEQ (preallocation, "off") && STRNEQ (preallocation, "metadata")) {
+ if (STREQ (optargs->preallocat...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
..."refusing to overwrite char device '%s'"), filename);
+ error (g, _("refusing to overwrite char device ‘%s’"), filename);
return -1;
}
/* Block devices have to be handled specially. */
@@ -273,7 +273,7 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
if (STRNEQ (backingformat, "raw") &&
STRNEQ (backingformat, "qcow2") &&
STRNEQ (backingformat, "vmdk")) {
- error (g, _("invalid value for backingformat parameter '%s'"),
+ error (g, _(&q...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.
(http://stackoverflow.com/a/228797)
These large but completely mechanical patches change the illegal
identifiers to legal ones.
Rich.