search for: attrval_len

Displaying 20 results from an estimated 36 matches for "attrval_len".

2020 Mar 12
0
[PATCH libguestfs 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...ith_error ("%s: extended attribute is too large", names[i]); goto error; } - r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]); - r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen); - r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen; + r->guestfs_int_xattr_list_val[i].attrname = strdup (&buf[i]); + r->guestfs_int_xattr_list_val[i].attrval.attrval_val = malloc (vlen); + r->guestfs_int_xattr_list_val[i].attrval.attrval_len = vlen; - if (r->guestfs_int_xattr_list_val[j].attrname == NULL || -...
2020 Mar 16
0
[PATCH libguestfs v2 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...ith_error ("%s: extended attribute is too large", names[i]); goto error; } - r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]); - r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen); - r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen; + r->guestfs_int_xattr_list_val[i].attrname = strdup (names[i]); + r->guestfs_int_xattr_list_val[i].attrval.attrval_val = malloc (vlen); + r->guestfs_int_xattr_list_val[i].attrval.attrval_len = vlen; - if (r->guestfs_int_xattr_list_val[j].attrname == NULL || -...
2020 Mar 12
8
[PATCH libguestfs 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
https://bugzilla.redhat.com/show_bug.cgi?id=1811539 Commands including virt-diff which read extended attributes will sometimes fail on NTFS filesystems that are using system compressed. The reason is complex, see comment 5 of the bug linked above. This patch filters out the troublesome xattr. For justification, see the comment I added in patch 3. Patch 1 & 2 are refactoring. I was on the
2020 Mar 16
6
[PATCH libguestfs v2 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
v1 here: https://www.redhat.com/archives/libguestfs/2020-March/msg00099.html This one fixes most of the points picked up in review, and does not strdup the strings which should keep down memory usage if that is a concern. Rich.
2014 Jan 07
8
RFC: copy-attributes command
Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a "file" to another, so for example in guestfish: copy-attributes foo bar permissions:true xattributes:false would only copy the permissions of foo to bar, not copying its extended attributes too. Just few notes: - my first daemon command, so
2015 Jan 02
2
(no subject)
Hi, we needed these changes when we had to build a guest image compatible with a starting guest image but not backed by it in any way? We needed some tool to check our progress, comparing original and? rebuilt (from scratch) images, and virt-diff seemed the best option, but? we had to soften the comparison to reduce the noise in the output. I added some options to ignore certain informations when
2014 Jan 13
0
[PATCH] New API: copy-attributes.
...b/daemon/xattr.c index ebacc02..abed5ff 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -541,8 +541,77 @@ do_lgetxattr (const char *path, const char *name, size_t *size_r) return buf; /* caller frees */ } +int +copy_xattrs (const char *src, const char *dest) +{ + ssize_t len, vlen, ret, attrval_len = 0; + CLEANUP_FREE char *buf = NULL, *attrval = NULL; + size_t i; + + buf = _listxattrs (src, listxattr, &len); + if (buf == NULL) + /* _listxattrs issues reply_with_perror already. */ + goto error; + + /* What we get from the kernel is a string "foo\0bar\0baz" of length +...
2014 Jan 07
0
Re: RFC: copy-attributes command
...now has its own branch ("oldlinux"), so the code might be made simpler by an accompanying patch which reduces all of the HAVE_*XATTR* macros down to a single one (HAVE_LINUX_XATTRS). > + ssize_t len, vlen, ret; > + CLEANUP_FREE char *buf = NULL, *attrval = NULL; > + size_t i, attrval_len = 0; > + > + CHROOT_IN; > + len = listxattr (src, NULL, 0); > + CHROOT_OUT; > + if (len == -1) { > + reply_with_perror ("listxattr: %s", src); > + goto error; > + } > + > + buf = malloc (len); > + if (buf == NULL) { > + reply_with_perror...
2015 Jan 02
0
[PATCH] virt-diff: add additional ignore options
...output_file (guestfs_h *g, struct file *file) } if (enable_xattrs) { - for (i = 0; i < file->xattrs->len; ++i) { - output_string (file->xattrs->val[i].attrname); - output_binary (file->xattrs->val[i].attrval, - file->xattrs->val[i].attrval_len); + for (i = 0; i < file->xattrs_orig->len; ++i) { + output_string (file->xattrs_orig->val[i].attrname); + output_binary (file->xattrs_orig->val[i].attrval, + file->xattrs_orig->val[i].attrval_len); } } } diff --git a/diff/virt-di...
2015 Mar 05
0
[PATCH v3] fish: add journal-view command
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err", -...
2015 Mar 03
2
[PATCH v2] RFE: journal reader in guestfish
This implements new guestfish only command called journal-view. There seems to be a minor issue when user wants to run it through pager (more) and wants cancel it. User will end up with stuck guestfish until journal-view transfers all journal items. Output is now configurable, it's the same format as virt-log has, since both uses same code now. Maros Zatko (1): fish: add journal-view
2015 Mar 05
2
[PATCH v3] RFE: journal reader in guestfish
There seems to be a minor issue when user wants to run it through pager (more) and wants cancel it. User will end up with stuck guestfish until journal-view transfers all journal items. Output is now configurable, it's the same format as virt-log has, since both uses same code now. Maros Zatko (1): fish: add journal-view command cat/Makefile.am | 1 + cat/log.c | 113
2015 Aug 31
0
[PATCH v5 1/2] cat: move get_journal_field to fish/journal.c
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err", -...
2015 Aug 27
0
[PATCH v4 1/2] cat: move get_journal_field to fish/journal.c
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err", -...
2015 Jan 06
0
[PATCH] virt-diff: add additional ignore options
...output_file (guestfs_h *g, struct file *file) } if (enable_xattrs) { - for (i = 0; i < file->xattrs->len; ++i) { - output_string (file->xattrs->val[i].attrname); - output_binary (file->xattrs->val[i].attrval, - file->xattrs->val[i].attrval_len); + for (i = 0; i < file->xattrs_orig->len; ++i) { + output_string (file->xattrs_orig->val[i].attrname); + output_binary (file->xattrs_orig->val[i].attrval, + file->xattrs_orig->val[i].attrval_len); } } } diff --git a/diff/virt-di...
2015 Aug 27
4
[PATCH v4 0/2] RFE: journal reader in guestfish
There seems to be a minor issue when user wants to run it through pager (more) and wants cancel it. User will end up with stuck guestfish until journal-view transfers all journal items. Output is configurable, it's the same format as virt-log has, since both uses same code. Maros Zatko (2): cat: move get_journal_field to fish/journal.c fish: add journal-view command cat/Makefile.am
2012 Mar 28
2
[PATCH v2] New APIs: mount-local and umount-local using FUSE
This version doesn't crash or cause hung processes or stuck mountpoints, so that's an improvement. Rich.
2015 Mar 03
0
[PATCH v2] fish: add journal-view command
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err", -...
2012 Mar 27
3
[PATCH 0/3] Enable FUSE support in the API via 'mount-local' call.
This patch is just for review. It enables FUSE support in the API via two new calls, 'guestfs_mount_local' and 'guestfs_umount_local'. FUSE turns out to be very easy to deadlock (necessitating that the machine be rebooted). Running the test from the third patch is usually an effective way to demonstrate this. However I have not yet managed to produce a simple reproducer that
2012 Mar 29
3
[PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
This changes the proposed API slightly. Previously 'mount-local' generating a 'mounted' event when the filesystem was ready, and from the 'mounted' event you had to effectively do a fork. Now, 'mount-local' just initializes the mountpoint and you have to call 'mount-local-run' to enter the FUSE main loop. Between these calls you can do a fork or whatever