search for: resolve_device

Displaying 20 results from an estimated 20 matches for "resolve_device".

2017 Apr 20
6
[PATCH 0/5] generator: daemon: Various simplifications to stubs code.
This is a series of simplifications to the stubs code. It's all refactoring, there is no functional change. Rich.
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
2
[PATCH] parted: add more udev_settle calls.
add udev_settle calls to print_partition_table and sgdisk_info_extract_field because the inspect-os calls guestfs_part_get_parttype and guestfs_part_get_gpt_guid for all parition devices found and this causes intermittent with opening block devices that are certainly present yet RESOLVE_DEVICE macro would fail wiht ENOENT. --- daemon/parted.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/daemon/parted.c b/daemon/parted.c index 124d1e9..03e83cb 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -320,6 +320,8 @@ print_partition_table (const char *device, bool add_m_optio...
2009 Aug 12
1
factorization would be nice
...function | Pathname n -> pr " char *%s = args.%s;\n" n n; pr " ABS_PATH (%s, goto done);\n" n; | Device n -> pr " char *%s = args.%s;\n" n n; pr " RESOLVE_DEVICE (%s, goto done);" n; | Dev_or_Path n -> pr " char *%s = args.%s;\n" n n; pr " REQUIRE_ROOT_OR_RESOLVE_DEVICE (%s, goto done);" n; | String n -> pr " char *%s = args.%s;\n" n n | OptString n...
2016 Jul 06
1
Re: list-filesystems and btrfs snapshots
...shots: btrfs > btrfsvol:/dev/sda2/@/.snapshots/1/snapshot: btrfs > btrfsvol:/dev/sda2/@/.snapshots/2/snapshot: btrfs > ... > btrfsvol:/dev/sda2/@/.snapshots/16/snapshot: btrfs > /dev/sda2: btrfs > > > The btrfs snapshots are not block devices, so an error is thrown by > RESOLVE_DEVICE macro in stubs.c. That means we will get an error > trying to call blockdev - oriented functions at these devices. > > ========================= > > After grepping "list_filesystems" issues were found in: > - virt-sparsify (in-place and copying): is_lv > - virt-file...
2012 Jul 24
3
[PATCH V4 1/3] umount: add force umount and lazy umount
...*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 ? strdup (pathordevice) @@ -205,7 +211,22 @@ do_umount (const char *pathordevice) if (is_dev) RESOLVE_DEVICE (buf, , { free (buf); return -1; }); - r = command (NULL, &err, "umount", buf, NULL); + if (!(optargs_bitmask & GUESTFS_UMOUNT_FORCE_BITMASK)) + force = 0; + if (!(optargs_bitmask & GUESTFS_UMOUNT_LAZYUNMOUNT_BITMASK)) + lazyunmount = 0; + + ADD_ARG (argv, i, prog)...
2012 Jul 23
3
[PATCH V2 1/4] mount: add a macro to resolve path or device
Add a macro STRDUP_RESOLVE_DEVICE_OR_PATH to resolve path or device. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- daemon/daemon.h | 16 ++++++++++++++++ daemon/mount.c | 13 ++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index 85eec45..f7d0c...
2012 Jul 23
1
[PATCH V3 1/2] umount: add force umount and lazy umount
...*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 ? strdup (pathordevice) @@ -205,7 +211,22 @@ do_umount (const char *pathordevice) if (is_dev) RESOLVE_DEVICE (buf, , { free (buf); return -1; }); - r = command (NULL, &err, "umount", buf, NULL); + if (!(optargs_bitmask & GUESTFS_UMOUNT_FORCE_BITMASK)) + force = 0; + if (!(optargs_bitmask & GUESTFS_UMOUNT_LAZYUNMOUNT_BITMASK)) + lazyunmount = 0; + + ADD_ARG (argv, i, prog)...
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...er (pathordevice); buf = is_dev ? strdup (pathordevice) : sysroot_path (pathordevice); if (buf == NULL) { diff --git a/daemon/stubs-macros.h b/daemon/stubs-macros.h index e9da16227..2a90938c6 100644 --- a/daemon/stubs-macros.h +++ b/daemon/stubs-macros.h @@ -30,16 +30,11 @@ */ #define RESOLVE_DEVICE(path,path_out,is_filein) \ do { \ - if (STRNEQLEN ((path), "/dev/", 5)) { \ + if (!is_device_parameter ((path))) { \ if (is_filein) cancel_receive (); \ reply_with_erro...
2011 Jun 22
1
[PATCH v1] Allow 9p filesystems to be mounted and listed (RHBZ#714981) *UNTESTED*.
The two patches attached allow 9p filesystems to be mounted and listed. Note that I did *not* test the new list-9p function, because I don't have a guest with a new enough kernel handy. 9p filesystems are not included in the output of list-filesystems. Because a lot of existing code feeds the output of list-filesystems directly into the input of mount-options, mount-ro or (even worse) plain
2012 Jul 21
5
[PATCH 1/5] mount: add a macro to resolve path or device
Add a macro DUP_RESOLVE_DEVICE_OR_PATH to resolve path or device. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- daemon/daemon.h | 18 ++++++++++++++++++ daemon/mount.c | 13 ++----------- po/POTFILES | 8 ++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/daemon/daemon.h b/dae...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky for development (too easy to miss new ones) so I spent some time last week and today working on removing them. The first patch gets us down to almost no warnings with the original -Wall setting. That was by far the hardest part. Once I'd done that, I enabled nearly all of gcc's warnings via gnulib's warnings and manywarnings modules
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...o-xml.c | 2 +- src/generator.ml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index 3f4c480..1cdb480 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -164,7 +164,7 @@ extern void reply (xdrproc_t xdrp, char *ret); */ #define RESOLVE_DEVICE(path,fail_stmt) \ do { \ - if (strncmp ((path), "/dev/", 5) != 0) { \ + if (STRNEQLEN ((path), "/dev/", 5)) { \ reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \ fail_stmt; \ } \ diff -...
2013 Aug 24
67
[PATCH 00/67] Proposed patches for libguestfs 1.22.6.
In the kernel and qemu communities it is routine for patches that will be backported to stable branches to be posted for review. I'm proposing we do the same for libguestfs stable branches. All of the attached have been tested with 'make check-release'. Rich.
2020 Mar 05
5
[PATCH v2 0/4] daemon: Translate device names if Linux device is unstable (RHBZ#1804207).
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00220.html This patch series is a little bit better. It's still a bit of a hack. The _real_ fix for this is outlined in the TODO file (see patch 1) but that requires a lot more work than we could do before 1.42 is released, unless we delay 1.42 for a lot longer. I'm hoping with this to have something which works
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...pr_args n; pr " ABS_PATH (%s, %s, goto done);\n" n (if is_filein then "cancel_receive ()" else ""); - | Device n -> + | Device n | Mountable n -> pr_args n; pr " RESOLVE_DEVICE (%s, %s, goto done);\n" n (if is_filein then "cancel_receive ()" else ""); diff --git a/generator/erlang.ml b/generator/erlang.ml index 357335b..004aee4 100644 --- a/generator/erlang.ml +++ b/generator/erlang.ml @@ -293,7 +293,7 @@ extern void free_strings...
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
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...List.iter ( function - | Pathname n -> + | String (Pathname, n) -> pr_args n; pr " ABS_PATH (%s, %b, return);\n" n is_filein; - | Device n -> + | String (Device, n) -> pr " RESOLVE_DEVICE (args.%s, %s, %b);\n" n n is_filein; - | Mountable n -> + | String (Mountable, n) -> pr " RESOLVE_MOUNTABLE (args.%s, %s, %b);\n" n n is_filein; - | Dev_or_Path n -> + | String (Dev_or_Path, n) -> pr &quot...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator. Rich.