search for: copy_in

Displaying 20 results from an estimated 46 matches for "copy_in".

2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait) asynchronously commands cmd: add a child-setup callback cmd: add the possibility to g...
2015 Feb 02
1
Re: [PATCH 5/6] New APIs: copy-in and copy-out
...@@ -3310,6 +3310,34 @@ In non-C language bindings, this allows you to retrieve the underlying > C pointer to the handle (ie. C<guestfs_h *>). The purpose of this is > to allow other libraries to interwork with libguestfs." }; > > + { defaults with > + name = "copy_in"; > + style = RErr, [String "localpath"; Pathname "remotedir"], []; > + visibility = VPublicNoFish; > + shortdesc = "copy local files or directories into an image"; > + longdesc = "\ > +C<guestfs_copy_in> copies local files or...
2019 Oct 30
1
[PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core
...ze = val; > +} > + > static int vsock_stream_setsockopt(struct socket *sock, > int level, > int optname, > @@ -1405,17 +1432,19 @@ static int vsock_stream_setsockopt(struct socket > *sock, > switch (optname) { > case SO_VM_SOCKETS_BUFFER_SIZE: > COPY_IN(val); > - transport->set_buffer_size(vsk, val); > + vsock_update_buffer_size(vsk, transport, val); > break; > > case SO_VM_SOCKETS_BUFFER_MAX_SIZE: > COPY_IN(val); > - transport->set_max_buffer_size(vsk, val); > + vsk->buffer_max_size = val; > + vso...
2017 May 09
1
[PATCH] RHBZ#1406906: check return value of Python object functions
...t;/dev/sda", "mbr") + g.mkfs("ext4", "/dev/sda1") + g.mount("/dev/sda1", "/") + + # touch file with illegal unicode character + open(os.path.join(self.tempdir, "\udcd4"), "w").close() + + g.copy_in(self.tempdir, "/") + + if sys.version_info.major == 3: + with self.assertRaises(UnicodeDecodeError): + g.find("/") # segfault here on Python 3 -- 2.11.0
2015 Nov 11
2
[PATCH 1/2] dib: Make the interface between cmdline.ml and dib.ml explicit.
...ve for elements and binaries. *) g#add_drive_scratch (unit_GB 5); - (match drive with + (match cmdline.drive with | None -> g#add_drive_scratch (unit_GB 5) | Some drive -> @@ -667,12 +673,12 @@ let main () = g#mount "/dev/sdb" "/"; copy_in g auxtmpdir "/"; - copy_in g basepath "/lib"; + copy_in g cmdline.basepath "/lib"; g#umount "/"; (* Prepare the /aux/perm partition. *) let drive_partition = - match drive with + match cmdline.drive with | None ->...
2019 Sep 27
0
[RFC PATCH 07/13] vsock: handle buffer_size sockopts in the core
..._buffer_size(vsk, &val); + + vsk->buffer_size = val; +} + static int vsock_stream_setsockopt(struct socket *sock, int level, int optname, @@ -1397,17 +1424,19 @@ static int vsock_stream_setsockopt(struct socket *sock, switch (optname) { case SO_VM_SOCKETS_BUFFER_SIZE: COPY_IN(val); - transport->set_buffer_size(vsk, val); + vsock_update_buffer_size(vsk, transport, val); break; case SO_VM_SOCKETS_BUFFER_MAX_SIZE: COPY_IN(val); - transport->set_max_buffer_size(vsk, val); + vsk->buffer_max_size = val; + vsock_update_buffer_size(vsk, transport, vsk-&g...
2019 Oct 23
0
[PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core
..._buffer_size(vsk, &val); + + vsk->buffer_size = val; +} + static int vsock_stream_setsockopt(struct socket *sock, int level, int optname, @@ -1405,17 +1432,19 @@ static int vsock_stream_setsockopt(struct socket *sock, switch (optname) { case SO_VM_SOCKETS_BUFFER_SIZE: COPY_IN(val); - transport->set_buffer_size(vsk, val); + vsock_update_buffer_size(vsk, transport, val); break; case SO_VM_SOCKETS_BUFFER_MAX_SIZE: COPY_IN(val); - transport->set_max_buffer_size(vsk, val); + vsk->buffer_max_size = val; + vsock_update_buffer_size(vsk, transport, vsk-&g...
2017 May 06
0
[Bug 1406906] [PATCH 3/3] python: add regression test for RHBZ#1406906
...guestfs.mkfs("ext3", "/dev/sda1", blocksize=1024) + self.guestfs.mount("/dev/sda1", "/") + + # touch file with illegal unicode character + open(os.path.join(self.tempdir, "\udcd4"), "w").close() + + self.guestfs.copy_in(self.tempdir, "/") + + # segfault here on Python 3 + try: + self.guestfs.find("/") + except UnicodeDecodeError: + pass -- 2.11.0
2015 Feb 02
0
[PATCH 7/7] customize: add copy-in operation (RHBZ#1135585).
...00644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -175,6 +175,10 @@ exec >>%s 2>&1 * read when their arguments are met. *) () + | `CopyIn (localpath, remotedir) -> + msg (f_"Copying: %s to %s") localpath remotedir; + g#copy_in localpath remotedir + | `Delete path -> msg (f_"Deleting: %s") path; g#rm_rf path diff --git a/generator/customize.ml b/generator/customize.ml index c041f82..1c9092b 100644 --- a/generator/customize.ml +++ b/generator/customize.ml @@ -85,6 +85,19 @@ as if they were s...
2015 Mar 23
1
[PATCH] customize: add --copy
From: Maros Zatko <hacxman@gmail.com> This adds --copy SOURCE:DEST, equivalent of calling g#cp_a src dst. RFE: RHBZ#1203817 Maros Zatko (1): customize: add --copy builder/cmdline.ml | 2 +- customize/customize_run.ml | 4 ++++ generator/customize.ml | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) -- 1.9.3
2017 Oct 09
2
[PATCH] daemon: proto: Remove pervasive but useless debugging messages.
If you spend your time looking at libguestfs debugging output you'll see many messages from the daemon main loop like this: guestfsd: main_loop: new request, len 0x54 guestfsd: main_loop: proc 278 (mkfs) took 0.02 seconds I don't think these messages really bring much value. This commit removes them entirely. An alternative might be to change them to make them shorter and/or less
2020 Jan 22
0
[v2v PATCH 3/3] v2v: try to get windows driver files from libosinfo
...else ( + let target_name = String.lowercase_ascii (Filename.basename f) in + let target = destdir ^ "/" ^ target_name in + debug "windows: copying guest tools bits: 'host:%s' -> '%s'" + source target; + + g#copy_in source destdir; + Some target_name + ) + ) driver.Libosinfo.files + with Not_found -> [] + (* The following function is only exported for unit tests. *) module UNIT_TESTS = struct let virtio_iso_path_matches_guest_os = virtio_iso_path_matches_guest_os -- 2.24.1
2017 May 06
5
[Bug 1406906] [PATCH 0/3] Fix segmentation fault in Python bindings
This series addresses the issue where non UTF8 file names in a guest image lead to libguestfs segfault with Python 3 APIs. The core issue is the APIs are not checking the return value when constructing a new PyObject. Therefore NULL pointers are added to Python collections (lists and dictionaries) crashing the application. Few notes regarding the comments on the previous patch. - Added a
2015 Jan 26
0
[PATCH 5/6] New APIs: copy-in and copy-out
...+ b/generator/actions.ml @@ -3310,6 +3310,34 @@ In non-C language bindings, this allows you to retrieve the underlying C pointer to the handle (ie. C<guestfs_h *>). The purpose of this is to allow other libraries to interwork with libguestfs." }; + { defaults with + name = "copy_in"; + style = RErr, [String "localpath"; Pathname "remotedir"], []; + visibility = VPublicNoFish; + shortdesc = "copy local files or directories into an image"; + longdesc = "\ +C<guestfs_copy_in> copies local files or directories recursively...
2017 Feb 21
0
[PATCH 3/3] dib: rename "aux" to "in_target.aux"
...tput_format.check_formats_appliance_prerequisites cmdline.formats g; - (* Prepare the /aux partition. *) + (* Prepare the /in_target.aux partition. *) g#mkfs "ext2" "/dev/sdb"; g#mount "/dev/sdb" "/"; @@ -723,7 +723,7 @@ let main () = copy_in g cmdline.basepath "/lib"; g#umount "/"; - (* Prepare the /aux/perm partition. *) + (* Prepare the /in_target.aux/perm partition. *) let drive_partition = match cmdline.drive with | None -> @@ -746,9 +746,9 @@ let main () = g, fn, fmt, dri...
2016 Aug 03
0
[PATCH] dib: rework run of extra-data.d hooks (RHBZ#1362354)
...try let scripts = Hashtbl.find final_hooks hook in if debug >= 1 then ( @@ -597,8 +619,6 @@ let main () = run_parts ~debug ~sysroot ~blockdev ~log_file ~new_wd g hook scripts with Not_found -> "" in - run_hook_host "extra-data.d"; - let copy_in (g : Guestfs.guestfs) srcdir destdir = let desttar = Filename.temp_file ~temp_dir:tmpdir "virt-dib." ".tar.gz" in let cmd = [ "tar"; "czf"; desttar; "-C"; srcdir; "--owner=root"; @@ -608,18 +628,6 @@ let main () = g#tar_in ~...
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...dev/sda1", "/") + + self.assertEqual(g.find("/"), ['lost+found']) + + # touch file with illegal unicode character + non_utf8_fname = "\udcd4" + open(os.path.join(self.tempdir, non_utf8_fname), "w").close() + + g.copy_in(self.tempdir, "/") + + if sys.version_info >= (3, 0): + with self.assertRaises(UnicodeDecodeError): + g.find("/") # segfault here on Python 3 + elif sys.version_info >= (2, 0): + self.assertTrue( + any(path...
2017 Feb 21
3
[PATCH 1/3] dib: unset all temporary dirs envvars in fake-sudo
The real sudo does it as well, and leaving them when preserving the environment (-E) maybe breaks the applications, as e.g. chroot will have a TMPDIR path pointing outside of it. --- dib/dib.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dib/dib.ml b/dib/dib.ml index df83ba1..d15cd19 100644 --- a/dib/dib.ml +++ b/dib/dib.ml @@ -301,6 +301,11 @@ if [ -z \"$preserve_env\" ];
2016 Aug 03
3
[PATCH] mllib: move _exit from v2v as Exit module
Move the OCaml binding to C _exit to an own module. Just code motion, adapting v2v in the process. --- docs/C_SOURCE_FILES | 2 +- mllib/Makefile.am | 5 ++++- mllib/exit-c.c | 33 +++++++++++++++++++++++++++++++++ mllib/exit.ml | 19 +++++++++++++++++++ mllib/exit.mli | 20 ++++++++++++++++++++ v2v/Makefile.am | 1 - v2v/changeuid-c.c | 33
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
--- src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++------- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7 @@ debug_command (struct command *cmd) } static int -run_command (struct command *cmd)