search for: pathordevice

Displaying 20 results from an estimated 35 matches for "pathordevice".

2012 Jul 24
3
[PATCH V4 1/3] umount: add force umount and lazy umount
...t before many operations. * Hence we have an internal function which can test if something is * mounted on *or under* the sysroot directory. (It has to be *or @@ -187,12 +189,16 @@ do_mount_options (const char *options, const char *device, * is kept updated. */ int -do_umount (const char *pathordevice) +do_umount (const char *pathordevice, + int force, int lazyunmount) { int r; char *err; char *buf; int is_dev; + char prog[] = "umount"; + const char *argv[MAX_ARGS]; + size_t i = 0; is_dev = STREQLEN (pathordevice, "/dev/", 5); buf = is_dev ?...
2012 Jul 23
3
[PATCH V2 1/4] mount: add a macro to resolve path or device
...match CHROOT_IN and CHROOT_OUT even along error paths. * (2) You must not change directory! cwd must always be "/", otherwise diff --git a/daemon/mount.c b/daemon/mount.c index 0661eb8..1843165 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -192,18 +192,9 @@ do_umount (const char *pathordevice) int r; char *err; char *buf; - int is_dev; - is_dev = STREQLEN (pathordevice, "/dev/", 5); - buf = is_dev ? strdup (pathordevice) - : sysroot_path (pathordevice); - if (buf == NULL) { - reply_with_perror ("malloc"); - return -1; - } - - if (...
2012 Jul 21
5
[PATCH 1/5] mount: add a macro to resolve path or device
...match CHROOT_IN and CHROOT_OUT even along error paths. * (2) You must not change directory! cwd must always be "/", otherwise diff --git a/daemon/mount.c b/daemon/mount.c index 0661eb8..1bac1a7 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -192,18 +192,9 @@ do_umount (const char *pathordevice) int r; char *err; char *buf; - int is_dev; - is_dev = STREQLEN (pathordevice, "/dev/", 5); - buf = is_dev ? strdup (pathordevice) - : sysroot_path (pathordevice); - if (buf == NULL) { - reply_with_perror ("malloc"); - return -1; - } - - if (...
2012 Jul 23
1
[PATCH V3 1/2] umount: add force umount and lazy umount
...t before many operations. * Hence we have an internal function which can test if something is * mounted on *or under* the sysroot directory. (It has to be *or @@ -187,12 +189,16 @@ do_mount_options (const char *options, const char *device, * is kept updated. */ int -do_umount (const char *pathordevice) +do_umount (const char *pathordevice, + int force, int lazyunmount) { int r; char *err; char *buf; int is_dev; + char prog[] = "umount"; + const char *argv[MAX_ARGS]; + size_t i = 0; is_dev = STREQLEN (pathordevice, "/dev/", 5); buf = is_dev ?...
2009 Aug 12
1
do_umount adjustment
...without a complete patch. Given that I already ensure that stubs.c invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE just before calling do_umount, does this new version of do_umount look ok? /* Again, use the external /bin/umount program, so that /etc/mtab * is kept updated. */ int do_umount (const char *pathordevice) { int r; char *err; char *buf = sysroot_path (pathordevice); if (buf == NULL) { reply_with_perror ("malloc"); return -1; } r = command (NULL, &err, "umount", buf, NULL); if (r == -1) { reply_with_error ("umount: %s: %s", pathordevice, e...
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...ce_parameter path in (* For non-dev, check this is a regular file, else just return the * file type as a string (RHBZ#582484). diff --git a/daemon/mount.c b/daemon/mount.c index bf58bd527..61ce64449 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -120,7 +120,7 @@ do_umount (const char *pathordevice, const char *argv[MAX_ARGS]; size_t i = 0; - is_dev = STREQLEN (pathordevice, "/dev/", 5); + is_dev = is_device_parameter (pathordevice); buf = is_dev ? strdup (pathordevice) : sysroot_path (pathordevice); if (buf == NULL) { diff --git a/daemon/stubs-macros.h b/daemon...
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device. --- generator/bindtests.ml | 2 +- generator/c.ml | 7 +++++-- generator/csharp.ml | 6 ++++-- generator/daemon.ml | 4 ++-- generator/erlang.ml | 6 +++--- generator/fish.ml | 8 ++++---- generator/gobject.ml | 11 ++++++----- generator/haskell.ml | 11 +++++++---- generator/java.ml | 10 +++++-----
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...(STREQLEN (vmchannel, "tcp:", 4)) { /* Resolve the hostname. */ struct addrinfo *res, *rr; struct addrinfo hints; diff --git a/daemon/mount.c b/daemon/mount.c index 463e789..5a27cea 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -112,7 +112,7 @@ do_umount (const char *pathordevice) char *buf; int is_dev; - is_dev = strncmp (pathordevice, "/dev/", 5) == 0; + is_dev = STREQLEN (pathordevice, "/dev/", 5); buf = is_dev ? strdup (pathordevice) : sysroot_path (pathordevice); if (buf == NULL) { diff --git a/daemon/upload.c b/daemon...
2017 Aug 03
9
[PATCH 0/6] tests: Fix handling of device API parameters (RHBZ#1477623).
https://bugzilla.redhat.com/show_bug.cgi?id=1477623 The first two patches are cleanups. The third patch changes the way that we handle Device and Dev_or_Path parameters so that a parameter marked as such can really only contain a block device name (and not, for instance, a chardev). Using a chardev here caused hangs in the API. The next two patches fix API usage to conform to this new stricter
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-
2017 Mar 02
1
[PATCH] generator: Move some deprecated functions to actions_core_deprecated.ml.
...ntent cannot contain embedded ASCII NULs). - -I<NB.> Owing to a bug, writing content containing ASCII NUL -characters does I<not> work, even if the length is specified." }; - - { defaults with name = "umount"; added = (0, 0, 8); style = RErr, [Dev_or_Path "pathordevice"], [OBool "force"; OBool "lazyunmount"]; fish_alias = ["unmount"]; @@ -5479,26 +5425,6 @@ calls to associate logical volumes and volume groups. See also C<guestfs_vgpvuuids>." }; { defaults with - name = "copy_size"; added = (1,...
2017 Jul 14
0
[PATCH 09/27] daemon: Reimplement ‘mount’, ‘mount_ro’, ‘mount_options’, ‘mount_vfs’ APIs in OCaml.
...able, mountpoint); -} - -int -do_mount_options (const char *options, const mountable_t *mountable, - const char *mountpoint) -{ - return do_mount_vfs (options, NULL, mountable, mountpoint); -} - /* Takes optional arguments, consult optargs_bitmask. */ int do_umount (const char *pathordevice, diff --git a/daemon/mount.ml b/daemon/mount.ml new file mode 100644 index 000000000..4bb74fb82 --- /dev/null +++ b/daemon/mount.ml @@ -0,0 +1,62 @@ +(* guestfs-inspection + * Copyright (C) 2009-2017 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it un...
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...f (&options_plus, "subvol=%s,%s", - mountable->volume, options) == -1) - { + mountable->volume, options) == -1) { reply_with_perror ("asprintf"); return -1; } @@ -227,7 +226,7 @@ do_umount (const char *pathordevice, is_dev = STREQLEN (pathordevice, "/dev/", 5); buf = is_dev ? strdup (pathordevice) - : sysroot_path (pathordevice); + : sysroot_path (pathordevice); if (buf == NULL) { reply_with_perror ("malloc"); return -1; diff --git a/daemon/parted.c b/...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste. --- align/scan.c | 35 ++++++++++--------- cat/cat.c | 39 +++++++++++---------- cat/filesystems.c | 69 +++++++++++++++++++------------------- cat/log.c | 35 ++++++++++--------- cat/ls.c | 61 +++++++++++++++++---------------- df/main.c | 43 ++++++++++++------------ diff/diff.c | 67
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
..."mount", "-o", options, device, mp, NULL); + str_mount, "-o", options, device, mp, NULL); free (mp); if (r == -1) { reply_with_error ("%s on %s (options: '%s'): %s", @@ -213,7 +216,7 @@ do_umount (const char *pathordevice, /* Use the external /bin/umount program, so that /etc/mtab is kept * updated. */ - ADD_ARG (argv, i, "umount"); + ADD_ARG (argv, i, str_umount); if (force) ADD_ARG (argv, i, "-f"); @@ -382,7 +385,7 @@ do_umount_all (void) /* Unmount them. */ for (...
2012 Aug 30
1
[PATCH] collect list of called external commands
..."mount", "-o", options, device, mp, NULL); + str_mount, "-o", options, device, mp, NULL); free (mp); if (r == -1) { reply_with_error ("%s on %s (options: '%s'): %s", @@ -213,7 +216,7 @@ do_umount (const char *pathordevice, /* Use the external /bin/umount program, so that /etc/mtab is kept * updated. */ - ADD_ARG (argv, i, "umount"); + ADD_ARG (argv, i, str_umount); if (force) ADD_ARG (argv, i, "-f"); @@ -382,7 +385,7 @@ do_umount_all (void) /* Unmount them. */ for (...
2012 Jan 12
1
Libguestfs gobject bindings
I'm currently working on gobject bindings for libguestfs. I haven't got as far as compiling anything yet, but I've attached the C header for initial review. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490 -------------- next part -------------- An embedded and
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...tions_plus ? options_plus : options, + "mount", "-o", options_plus ? options_plus : options, device, mp, NULL); if (r == -1) { reply_with_error ("%s on %s (options: '%s'): %s", @@ -238,7 +235,7 @@ do_umount (const char *pathordevice, /* Use the external /bin/umount program, so that /etc/mtab is kept * updated. */ - ADD_ARG (argv, i, str_umount); + ADD_ARG (argv, i, "umount"); if (force) ADD_ARG (argv, i, "-f"); @@ -412,7 +409,7 @@ do_umount_all (void) for (i = 0; i < mounts.size...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...tions_plus ? options_plus : options, + "mount", "-o", options_plus ? options_plus : options, device, mp, NULL); if (r == -1) { reply_with_error ("%s on %s (options: '%s'): %s", @@ -238,7 +237,7 @@ do_umount (const char *pathordevice, /* Use the external /bin/umount program, so that /etc/mtab is kept * updated. */ - ADD_ARG (argv, i, str_umount); + ADD_ARG (argv, i, "umount"); if (force) ADD_ARG (argv, i, "-f"); @@ -412,7 +411,7 @@ do_umount_all (void) for (i = 0; i < mounts.size...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...optional = Some "lvm2"; tests = [ InitEmpty, Always, TestResult ( @@ -2239,7 +2239,7 @@ on the volume group C<volgroup>, with C<size> megabytes." }; { defaults with name = "umount"; added = (0, 0, 8); - style = RErr, [Dev_or_Path "pathordevice"], [OBool "force"; OBool "lazyunmount"]; + style = RErr, [String (Dev_or_Path, "pathordevice")], [OBool "force"; OBool "lazyunmount"]; fish_alias = ["unmount"]; once_had_no_optargs = true; tests = [ @@ -2320,7 +2320,...