search for: optargs_bitmask

Displaying 20 results from an estimated 187 matches for "optargs_bitmask".

2012 Aug 31
1
[PATCH V1] NEW API:ext:mke2fs
...ckspercentage_s[64]; + char numberofinodes_s[64]; + char mmpupdateinterval_s[84]; + char stridesize_s[74]; + char stripewidth_s[84]; + char maxonlineresize_s[74]; + char blockscount_s[64]; + size_t i = 0; + int feature = 0; + char features[256]; + + ADD_ARG (argv, i, str_mke2fs); + + if (optargs_bitmask & GUESTFS_MKE2FS_CHECKBADBLOCK_BITMASK) { + if (checkbadblock) + ADD_ARG (argv, i, "-c"); + } + if (optargs_bitmask & GUESTFS_MKE2FS_BADBLOCKFILE_BITMASK) { + if (badblockfile) { + ADD_ARG (argv, i, "-l"); + ADD_ARG (argv, i, badblockfile); + }...
2012 Aug 21
1
[PATCH] xfs: add a new api xfs_repair
...t char *logdev, const char *rtdev) +{ + int r; + char *err = NULL; + const char *argv[MAX_ARGS]; + char maxmem_s[64]; + char ihashsize_s[70]; + char bhashsize_s[70]; + char agstride_s[74]; + size_t i = 0; + + ADD_ARG (argv, i, "xfs_repair"); + + /* Optional arguments */ + if (!(optargs_bitmask & GUESTFS_XFS_REPAIR_IMGFILE_BITMASK)) + imgfile = 0; + if (!(optargs_bitmask & GUESTFS_XFS_REPAIR_FORCELOGZERO_BITMASK)) + forcelogzero = 0; + if (!(optargs_bitmask & GUESTFS_XFS_REPAIR_DANGEROUS_BITMASK)) + dangerous = 0; + if (!(optargs_bitmask & GUESTFS_XFS_REPAIR_NO...
2011 Nov 24
1
[PATCH] Rename mdadm_ apis to md_
...---- src/inspect_fs_unix.c | 4 ++-- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/daemon/md.c b/daemon/md.c index 82ddb82..8e4ff88 100644 --- a/daemon/md.c +++ b/daemon/md.c @@ -50,9 +50,9 @@ count_bits (uint64_t bitmap) /* Takes optional arguments, consult optargs_bitmask. */ int -do_mdadm_create (const char *name, char *const *devices, - int64_t missingbitmap, int nrdevices, int spare, - int64_t chunk, const char *level) +do_md_create (const char *name, char *const *devices, + int64_t missingbitmap, int nrdevices, int s...
2012 Aug 20
1
[PATCH] xfs: add new api xfs_admin
...int printlabel, int projid32bit, int printuuid, + int lazycounter, const char *label, const char *uuid) +{ + int r; + char *out = NULL, *err = NULL; + const char *argv[MAX_ARGS]; + size_t i = 0; + + ADD_ARG (argv, i, "xfs_admin"); + + /* Optional arguments */ + if (!(optargs_bitmask & GUESTFS_XFS_ADMIN_EXTUNWRITTEN_BITMASK)) + extunwritten = 0; + if (!(optargs_bitmask & GUESTFS_XFS_ADMIN_IMGFILE_BITMASK)) + imgfile = 0; + if (!(optargs_bitmask & GUESTFS_XFS_ADMIN_V2LOG_BITMASK)) + v2log = 0; + if (!(optargs_bitmask & GUESTFS_XFS_ADMIN_PRINTLABEL_BIT...
2012 Jul 31
1
[PATCH] xfs: add new api xfs-growfs
...64]; + char rtsize_s[64]; + char rtextsize_s[64]; + char maxpct_s[32]; + size_t i = 0; + + buf = sysroot_path (path); + if (buf == NULL) { + reply_with_perror ("malloc"); + return NULL; + } + + ADD_ARG (argv, i, "xfs_growfs"); + + /* Optional arguments */ + if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_DATASEC_BITMASK)) + datasec = 0; + if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_LOGSEC_BITMASK)) + logsec = 0; + if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_RTSEC_BITMASK)) + rtsec = 0; + + if (datasec) + ADD_ARG (argv, i, "-d"); + if (logsec)...
2014 Jan 10
2
Re: RFC: copy-attributes command
...ue). How about: int copy_mode, copy_xattributes, copy_ownership; /* Set defaults. */ if (all) copy_mode = copy_xattributes = copy_ownership = 1; else copy_mode = copy_xattributes = copy_ownership = 0; /* If set in the original struct, copy those settings overriding * the defaults. */ if ((optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_MODE_BITMASK)) copy_mode = mode; if ((optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_XATTRIBUTES_BITMASK)) copy_xattributes = xattributes; if ((optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_OWNERSHIP_BITMASK)) copy_ownership = ownership; if (!copy_mode &&...
2015 Jul 15
1
[PATCH 1/2] actions: tar_out: add xattrs and selinux optargs
...erator/actions.ml | 10 +++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/daemon/tar.c b/daemon/tar.c index d6f8f2f..68af749 100644 --- a/daemon/tar.c +++ b/daemon/tar.c @@ -311,7 +311,7 @@ make_exclude_from_file (char *const *excludes) /* Takes optional arguments, consult optargs_bitmask. */ int do_tar_out (const char *dir, const char *compress, int numericowner, - char *const *excludes) + char *const *excludes, int xattrs, int selinux) { CLEANUP_FREE char *buf = NULL; struct stat statbuf; @@ -349,6 +349,12 @@ do_tar_out (const char *dir, const char *...
2012 Apr 02
2
[PATCH 0/2] Fix btrfs blocksize and bind mkfs.btrfs (RHBZ#807905).
https://bugzilla.redhat.com/show_bug.cgi?id=807905 Currently if you specify the blocksize parameter to mkfs-opts with a btrfs filesystem, then it fails, because mkfs.btrfs interprets the -b option as meaning filesystem size. The first patch fixes this by disallowing blocksize (it cannot be mapped meaningfully into btrfs parameters). The second patch adds the full /sbin/mkfs.btrfs utility to the
2011 Nov 10
5
[PATCH v2] Add tune2fs command.
The changes since the previous patch: - safe ADD_ARG macro for adding arguments to a fixed size stack array - support for testing functions that return RHashtable, ie. tune2fs-l. - add tests that set (tune2fs) and get (tune2fs-l) various parameters. - only one 'intervalbetweenchecks' parameter (in seconds) Rich.
2012 Jan 13
3
[PATCH v2 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)
From: Wanlong Gao <gaowanlong at cn.fujitsu.com> Tweak the error message "e2fsck -f" and "e2fsck -fy". Indicate the user to use the correct and/or forceall options. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- daemon/ext2.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/ext2.c b/daemon/ext2.c index
2017 Jul 14
0
[PATCH 07/27] daemon: Reimplement ‘is_dir’, ‘is_file’ and ‘is_symlink’ APIs in OCaml.
...7 @@ SOURCES_ML = \ blkid.ml \ devsparts.ml \ file.ml \ + is.ml \ callbacks.ml \ daemon.ml diff --git a/daemon/is.c b/daemon/is.c index 4d5e911c2..a91dab32b 100644 --- a/daemon/is.c +++ b/daemon/is.c @@ -39,36 +39,6 @@ do_exists (const char *path) /* Takes optional arguments, consult optargs_bitmask. */ int -do_is_file (const char *path, int followsymlinks) -{ - mode_t mode; - int r; - - if (!(optargs_bitmask & GUESTFS_IS_FILE_FOLLOWSYMLINKS_BITMASK)) - followsymlinks = 0; - - r = get_mode (path, &mode, followsymlinks); - if (r <= 0) return r; - return S_ISREG (mode); -} -...
2011 Nov 09
6
[PATCH] Add tune2fs support to libguestfs.
At the moment OpenStack uses kpartx and nbd to resize filesystems and inject files to guests. I sincerely hope they don't allow untrusted users to upload guest images / AMIs :-( To fix this I'm looking into adding libguestfs support as an optional backend in OpenStack. The only missing feature in libguestfs is the ability to call tune2fs on a filesystem. This patch series adds tune2fs
2012 Oct 24
1
[PATCH] NEW API: add a new api restorecon
...n, + int force) +{ + int r; + size_t i = 0; + char *buf; + char *exdir; + char *err; + const char *argv[MAX_ARGS]; + + buf = sysroot_path (pathname); + if (!buf) { + reply_with_error ("malloc"); + return -1; + } + + ADD_ARG (argv, i, str_restorecon); + + if (optargs_bitmask & GUESTFS_RESTORECON_EXCLUDEDIR_BITMASK) { + if (excludedir) { + exdir = sysroot_path (excludedir); + if (!exdir) { + reply_with_error ("malloc"); + return -1; + } + ADD_ARG (argv, i, "-e"); + ADD_ARG (argv, i, exdir); + } + } +...
2015 Mar 17
2
[PATCH v2] New API: btrfs-image
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- v2: add optargs_bitmask check daemon/btrfs.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 22 ++++++++++++++++++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index d4b3207..340b548 100644 --- a/...
2012 Feb 13
0
[PATCH] daemon: Don't xdr_free uninitialized args struct on error paths.
From: "Richard W.M. Jones" <rjones at redhat.com> For stubs of functions that had arguments, code did this: static void mount_stub (XDR *xdr_in) { int r; struct guestfs_mount_args args; if (optargs_bitmask != 0) { //... goto done; } // possibly other tests here memset (&args, 0, sizeof args); [...] done: xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args); return; } This caused xdr_free to be called on uninitialized 'args' struct, causing a segfault....
2015 Mar 05
1
Re: [PATCH 1/2] New API: btrfs-image
...snprintf (compresslevel_s, sizeof compresslevel_s, "%d", compresslevel); > + ADD_ARG (argv, i, "-c"); > + ADD_ARG (argv, i, compresslevel_s); > + } Because compresslevel is an optional parameter, you can't just use it directly like this. You have to check optargs_bitmask. The condition should be something like: if ((optargs_bitmask & GUESTFS_BTRFS_IMAGE_COMPRESSLEVEL_BITMASK) && compresslevel >= 0) { ... } > + if (numthreads) { I would prefer not to expose the -t parameter, since it's essentially an implementation detail. I...
2013 Jun 14
3
[PATCH 0/2] Fix inspection of Fedora guests (RHBZ#974489).
Here is a preliminary fix for this bug. I'm running the test suite on this now. Rich.
2014 Nov 21
1
Re: [PATCH 2/6] btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot
...*argv[MAX_ARGS]; > @@ -231,6 +231,15 @@ do_btrfs_subvolume_snapshot (const char *source, > const char *dest) ADD_ARG (argv, i, str_btrfs); > ADD_ARG (argv, i, "subvolume"); > ADD_ARG (argv, i, "snapshot"); > + > + /* Optional arguments. */ > + if (!(optargs_bitmask & > GUESTFS_BTRFS_SUBVOLUME_SNAPSHOT_RO_BITMASK)) + ro = 0; > + > + if (ro) { > + ADD_ARG (argv, i, "-r"); > + } > + I would make this bit simplier: if ((optargs_bitmask & GUESTFS_BTRFS_SUBVOLUME_SNAPSHOT_RO_BITMASK) && ro) ADD_ARG (arg...
2015 Jun 23
2
[PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...@@ copy (const char *src, const char *src_display, int do_copy_device_to_device (const char *src, const char *dest, int64_t srcoffset, int64_t destoffset, int64_t size, - int sparse) + int sparse, int append) { + if ((optargs_bitmask & GUESTFS_COPY_DEVICE_TO_DEVICE_APPEND_BITMASK) && + append) { + reply_with_error ("the append flag cannot be set for this call"); + return -1; + } return copy (src, src, dest, dest, DEST_DEVICE_FLAGS, 0, srcoffset, destoffset, size, sparse); }...
2012 Aug 04
2
[PATCH 0/2] Add support for rsync.
An experimental series that adds support for rsync. Rich.