summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-17 12:21:37 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-08-17 16:08:13 +0100
commitdc66dd32c214db99467341caea0be517d2dd736f (patch)
tree82de6e3d7b60aa78095892d7152bc8e38acadab4 /generator
parent118932fbeac606919f8b96c81184f4f3e0910508 (diff)
downloadlibguestfs-dc66dd32c214db99467341caea0be517d2dd736f.tar.gz
libguestfs-dc66dd32c214db99467341caea0be517d2dd736f.tar.xz
libguestfs-dc66dd32c214db99467341caea0be517d2dd736f.zip
guestfs_lstatlist, guestfs_lxattrlist: Reimplement to avoid protocol limits.
Note that the code to do this was already in virt-ls, so this is change is mostly just moving the code into the core library.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml50
1 files changed, 48 insertions, 2 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index d614e75c..5e776519 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -2152,6 +2152,50 @@ C<path> does not exist, then a new file is created.
See also C<guestfs_write>." };
+ { defaults with
+ name = "lstatlist";
+ style = RStructList ("statbufs", "stat"), [Pathname "path"; StringList "names"], [];
+ shortdesc = "lstat on multiple files";
+ longdesc = "\
+This call allows you to perform the C<guestfs_lstat> operation
+on multiple files, where all files are in the directory C<path>.
+C<names> is the list of files from this directory.
+
+On return you get a list of stat structs, with a one-to-one
+correspondence to the C<names> list. If any name did not exist
+or could not be lstat'd, then the C<ino> field of that structure
+is set to C<-1>.
+
+This call is intended for programs that want to efficiently
+list a directory contents without making many round-trips.
+See also C<guestfs_lxattrlist> for a similarly efficient call
+for getting extended attributes." };
+
+ { defaults with
+ name = "lxattrlist";
+ style = RStructList ("xattrs", "xattr"), [Pathname "path"; StringList "names"], [];
+ optional = Some "linuxxattrs";
+ shortdesc = "lgetxattr on multiple files";
+ longdesc = "\
+This call allows you to get the extended attributes
+of multiple files, where all files are in the directory C<path>.
+C<names> is the list of files from this directory.
+
+On return you get a flat list of xattr structs which must be
+interpreted sequentially. The first xattr struct always has a zero-length
+C<attrname>. C<attrval> in this struct is zero-length
+to indicate there was an error doing C<lgetxattr> for this
+file, I<or> is a C string which is a decimal number
+(the number of following attributes for this file, which could
+be C<\"0\">). Then after the first xattr struct are the
+zero or more attributes for the first named file.
+This repeats for the second and subsequent files.
+
+This call is intended for programs that want to efficiently
+list a directory contents without making many round-trips.
+See also C<guestfs_lstatlist> for a similarly efficient call
+for getting standard stats." };
+
]
(* daemon_functions are any functions which cause some action
@@ -6281,9 +6325,10 @@ names, you will need to locate and parse the password file
yourself (Augeas support makes this relatively easy)." };
{ defaults with
- name = "lstatlist";
+ name = "internal_lstatlist";
style = RStructList ("statbufs", "stat"), [Pathname "path"; StringList "names"], [];
proc_nr = Some 204;
+ in_docs = false; in_fish = false;
shortdesc = "lstat on multiple files";
longdesc = "\
This call allows you to perform the C<guestfs_lstat> operation
@@ -6304,9 +6349,10 @@ this call to fail. The caller must split up such requests
into smaller groups of names." };
{ defaults with
- name = "lxattrlist";
+ name = "internal_lxattrlist";
style = RStructList ("xattrs", "xattr"), [Pathname "path"; StringList "names"], [];
proc_nr = Some 205;
+ in_docs = false; in_fish = false;
optional = Some "linuxxattrs";
shortdesc = "lgetxattr on multiple files";
longdesc = "\