search for: ext2_copy_fil

Displaying 13 results from an estimated 13 matches for "ext2_copy_fil".

Did you mean: ext2_copy_file
2014 Jul 30
2
[PATCH 1/3] ext2: create a struct for the OCaml 't' type
..., const char *buf, size_t size, const char *filename); static void ext2_link (ext2_filsys fs, ext2_ino_t dir_ino, const char *basename, ext2_ino_t ino, int dir_ft); static void ext2_clean_path (ext2_filsys fs, ext2_ino_t dir_ino, const char *dirname, const char *basename, int isdir); -static void ext2_copy_file (ext2_filsys fs, const char *src, const char *dest); +static void ext2_copy_file (struct ext2_data *data, const char *src, const char *dest); /* Copy the host filesystem file/directory 'src' to the destination * 'dest'. Directories are NOT copied recursively - the directory i...
2014 Jul 29
4
[PATCH 0/2] supermin: improve handling of memory
Hi, the two patches improve the way memory is handled in supermin, by cleanly exiting on memory allocation failures, and free'ing memory when not needed (to keep working and not run out of memory). Pino Toscano (2): Check for failures in memory allocations Free memory buffers when not used src/ext2fs-c.c | 13 +++++++++++-- src/init.c | 13 +++++++++++++ 2 files changed, 24
2016 Jan 22
1
[supermin] [PATCH] ext2: check for needed block size
...@@ -52,6 +52,9 @@ /* fts.h in glibc is broken, forcing us to use the GNUlib alternative. */ #include "fts_.h" +/* How many blocks of size S are needed for storing N bytes. */ +#define ROUND_UP(N, S) (((N) + (S) - 1) / (S)) + struct ext2_data { ext2_filsys fs; @@ -629,6 +632,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) errcode_t err; struct stat statbuf; struct statvfs statvfsbuf; + size_t blocks; if (data->debug >= 3) printf ("supermin: ext2: copy_file %s -> %s\n", src, dest); @@ -649,6 +653,20 @@ ext2_copy_file (...
2016 Jul 06
0
[PATCH] ext2: Don't load whole files into memory when copying to the appliance (RHBZ#1113065).
...xt2_ino_t ino, const char *src, const char *filename); static void ext2_link (ext2_filsys fs, ext2_ino_t dir_ino, const char *basename, ext2_ino_t ino, int dir_ft); static void ext2_clean_path (ext2_filsys fs, ext2_ino_t dir_ino, const char *dirname, const char *basename, int isdir); static void ext2_copy_file (struct ext2_data *data, const char *src, const char *dest); @@ -500,6 +501,81 @@ ext2_write_file (ext2_filsys fs, ext2_error_to_exception ("ext2fs_write_inode", err, filename); } +/* Same as ext2_write_file, but it copies the file contents from the + * host. You must create the...
2019 Nov 26
0
[PATCH supermin] ext2: Build symbolic links correctly (RHBZ#1770304).
...correctly too. Thanks: Toolybird for identifying the problem and kernel patch. --- src/ext2fs-c.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c index e8ab972..8903f74 100644 --- a/src/ext2fs-c.c +++ b/src/ext2fs-c.c @@ -782,12 +782,6 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) } /* Create a symlink. */ else if (S_ISLNK (statbuf.st_mode)) { - ext2_ino_t ino; - ext2_empty_inode (data->fs, dir_ino, dirname, basename, - statbuf.st_mode, statbuf.st_uid, statbuf.st_gid, -...
2016 Apr 14
1
[PATCH supermin] ext2: fix printf formatters
....cb9282b 100644 --- a/src/ext2fs-c.c +++ b/src/ext2fs-c.c @@ -31,6 +31,7 @@ #include <limits.h> #include <errno.h> #include <assert.h> +#include <inttypes.h> /* Inlining is broken in the ext2fs header file. Disable it by * defining the following: @@ -659,9 +660,9 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) */ blocks = ROUND_UP (statbuf.st_size, data->fs->blocksize); if (blocks > ext2fs_free_blocks_count (data->fs->super)) { - fprintf (stderr, "supermin: %s: needed %lu blocks (%d each) for " -...
2016 Nov 15
2
Libguestfs debugging issue
...l7.x86_64 supermin: kernel: modules /lib/modules/3.10.0-327.36.3.el7.x86_64 supermin: ext2: creating empty ext2 filesystem '/var/tmp/.guestfs-0/appliance.d.o5v90gm5/root' supermin: ext2: populating from base image supermin: ext2: copying files from host filesystem supermin5: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] != '/'' failed. libguestfs: error: /usr/bin/supermin5 killed by signal 6 (Aborted), see debug messages above libguestfs: clear_socket_create_context: setsockcreatecon failed: NULL: Invalid argument [you can ignore this UNLESS using SELinux + sVirt] libgu...
2017 Jul 12
3
[PATCH supermin] ext2: Create symlinks properly (RHBZ#1470157).
...irst with ext2_empty_inode, and - * the host file must be a regular file. +/* Copies the file contents from the host. You must create the file + * first with ext2_empty_inode, and the host file must be a regular + * file. */ static void ext2_write_host_file (ext2_filsys fs, @@ -833,7 +792,8 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) ssize_t r = readlink (src, buf, sizeof buf); if (r == -1) unix_error (errno, (char *) "readlink", caml_copy_string (src)); - ext2_write_file (data->fs, ino, buf, r, dest); + buf[r] = '\0'; +...
2015 Jun 25
0
Re: Problem with supermin and symlink in ibm_powerkvm ppc64le distro
...ar 19 09:35 .. > drwxr-xr-x. 9 root root 4.0K May 7 14:33 powerkvm > lrwxrwxrwx. 1 root root 36 May 7 14:32 powerkvm-licenses -> > /usr/share/doc/pkvm/licenses > drwxr-xr-x. 6 root root 4.0K May 7 14:33 seprovider > > I've tracked the problem down to the function 'ext2_copy_file' in > src/ext2fs-c.c You might want to check if it works with the upstream supermin. (Perhaps d7bb984889257f5b87963dcca6456fc6e4cc804e fixes it?) However probably the easiest thing to do is to add /opt/ibm and perhaps /opt/ibm/powerkvm and maybe /usr/share/doc/pkvm/licenses to the applian...
2016 Nov 15
0
Re: Libguestfs debugging issue
...; libguestfs: command: run: \ --copy-kernel > libguestfs: command: run: \ -f ext2 > libguestfs: command: run: \ --host-cpu x86_64 > libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d > libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d > supermin5: ext2fs-c.c:584: ext2_copy_file: Assertion `n == 1 || dest[n-1] > != '/'' failed. > libguestfs: error: /usr/bin/supermin5 killed by signal 6 (Aborted), see > debug messages above This is an actual bug in supermin. There are a couple of things you can do: (1) Try upgrading to a newer version of supermin....
2015 Jun 25
3
Problem with supermin and symlink in ibm_powerkvm ppc64le distro
...wxr-xr-x. 3 root root 4.0K Mar 19 09:35 .. drwxr-xr-x. 9 root root 4.0K May 7 14:33 powerkvm lrwxrwxrwx. 1 root root 36 May 7 14:32 powerkvm-licenses -> /usr/share/doc/pkvm/licenses drwxr-xr-x. 6 root root 4.0K May 7 14:33 seprovider I've tracked the problem down to the function 'ext2_copy_file' in src/ext2fs-c.c Thanks, Daniel
2017 Jul 13
3
[PATCH supermin v2] ext2: Create symlinks properly (RHBZ#1470157).
...st with ext2_empty_inode, and - * the host file must be a regular file. +/* Copies the file contents from the host. You must create the file + * first with ext2_empty_inode, and the host file must be a regular + * file. */ static void ext2_write_host_file (ext2_filsys fs, @@ -829,11 +788,17 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, 0, 0, EXT2_FT_SYMLINK, &ino); - char buf[PATH_MAX+1]; - ssize_t r = readlink (src, buf, sizeof buf); + char *buf = malloc (...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
..., const char *buf, size_t size, const char *filename); +static void ext2_link (ext2_filsys fs, ext2_ino_t dir_ino, const char *basename, ext2_ino_t ino, int dir_ft); +static void ext2_clean_path (ext2_filsys fs, ext2_ino_t dir_ino, const char *dirname, const char *basename, int isdir); +static void ext2_copy_file (ext2_filsys fs, const char *src, const char *dest); + +/* Copy the host filesystem file/directory 'src' to the destination + * 'dest'. Directories are NOT copied recursively - the directory is + * simply created. See function below for recursive copy. + */ +value +supermin_ext2f...