search for: ext2_error_to_exception

Displaying 6 results from an estimated 6 matches for "ext2_error_to_exception".

2016 Jul 06
0
[PATCH] ext2: Don't load whole files into memory when copying to the appliance (RHBZ#1113065).
..., 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 file first with ext2_empty_inode, and + * the host file must be a regular file. + */ +static void +ext2_write_host_file (ext2_filsys fs, +...
2017 Jul 13
3
[PATCH supermin v2] ext2: Create symlinks properly (RHBZ#1470157).
...ty_inode. */ -static void -ext2_write_file (ext2_filsys fs, - ext2_ino_t ino, const char *buf, size_t size, - const char *filename) -{ - errcode_t err; - ext2_file_t file; - err = ext2fs_file_open2 (fs, ino, NULL, EXT2_FILE_WRITE, &file); - if (err != 0) - ext2_error_to_exception ("ext2fs_file_open2", err, filename); - - /* ext2fs_file_write cannot deal with partial writes. You have - * to write the entire file in a single call. - */ - unsigned int written; - err = ext2fs_file_write (file, buf, size, &written); - if (err != 0) - ext2_error_to_excep...
2017 Jul 12
3
[PATCH supermin] ext2: Create symlinks properly (RHBZ#1470157).
...ty_inode. */ -static void -ext2_write_file (ext2_filsys fs, - ext2_ino_t ino, const char *buf, size_t size, - const char *filename) -{ - errcode_t err; - ext2_file_t file; - err = ext2fs_file_open2 (fs, ino, NULL, EXT2_FILE_WRITE, &file); - if (err != 0) - ext2_error_to_exception ("ext2fs_file_open2", err, filename); - - /* ext2fs_file_write cannot deal with partial writes. You have - * to write the entire file in a single call. - */ - unsigned int written; - err = ext2fs_file_write (file, buf, size, &written); - if (err != 0) - ext2_error_to_excep...
2015 Dec 02
4
[PATCH 0/3] supermin: add --include-packagelist
Hi, to ease debugging issues with appliances (e.g. when used in libguestfs), using --include-packagelist will add a file containing the list of all the packages used. Thanks, Pino Toscano (3): ext2: add ext2fs_chmod and ext2fs_chown chroot: factor out file copy code Add --include-packagelist src/build.ml | 42 +++++++++++++++++++++++++------ src/chroot.ml | 29
2014 Jul 30
2
[PATCH 1/3] ext2: create a struct for the OCaml 't' type
...; - ext2_filsys fs; + struct ext2_data data; #ifdef EXT2_FLAG_64BITS fs_flags |= EXT2_FLAG_64BITS; #endif err = ext2fs_open (String_val (filev), fs_flags, 0, 0, - unix_io_manager, &fs); + unix_io_manager, &data.fs); if (err != 0) ext2_error_to_exception ("ext2fs_open", err, String_val (filev)); - fsv = Val_ext2fs (fs); + fsv = Val_ext2fs (&data); CAMLreturn (fsv); } @@ -145,7 +150,7 @@ supermin_ext2fs_close (value fsv) ext2_finalize (fsv); /* So we don't double-free in the finalizer. */ - Ext2fs_val (fsv) = NUL...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
.../custom.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/unixsupport.h> + +static void initialize (void) __attribute__((constructor)); + +static void +initialize (void) +{ + initialize_ext2_error_table (); +} + +static void ext2_error_to_exception (const char *fn, errcode_t err) __attribute__((noreturn)); + +static void +ext2_error_to_exception (const char *fn, errcode_t err) +{ + fprintf (stderr, "supermin: %s: %s\n", fn, error_message (err)); + caml_failwith (fn); +} + +static void ext2_handle_closed (void) __attribute__((noret...