Displaying 20 results from an estimated 35 matches for "stbuf".
Did you mean:
sbuf
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...G_SOURCE_REMOVE was added in glib 2.32, but QEMU only permits
stuff that is present in 2.22. Just use "FALSE" instead.
> +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> +{
> + char *filename = NULL;
> + int fd, idx;
> + struct stat stbuf;
> + struct pstore_read_arg *rarg = NULL;
> + Error *err = NULL;
> + int ret = -1;
> +
> + if (s->file_idx >= s->num_file) {
> + return 0;
> + }
> +
> + rarg = g_malloc(sizeof(*rarg));
> + if (rarg == NULL) {
> + return -1...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...G_SOURCE_REMOVE was added in glib 2.32, but QEMU only permits
stuff that is present in 2.22. Just use "FALSE" instead.
> +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> +{
> + char *filename = NULL;
> + int fd, idx;
> + struct stat stbuf;
> + struct pstore_read_arg *rarg = NULL;
> + Error *err = NULL;
> + int ret = -1;
> +
> + if (s->file_idx >= s->num_file) {
> + return 0;
> + }
> +
> + rarg = g_malloc(sizeof(*rarg));
> + if (rarg == NULL) {
> + return -1...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...iovec *in_sg,
> + unsigned int in_num,
> + struct virtio_pstore_res *res)
> +{
> + char path[PATH_MAX];
Don't declare PATH_MAX sized variables
> + int fd;
> + ssize_t len;
> + struct stat stbuf;
> + struct dirent *dent;
> + int sg_num = in_num;
> + struct iovec sg[sg_num];
'sg_num' is initialized from 'in_num' which comes from the
guest, and I'm not seeing anything which is bounds-checking
the 'in_num' value. So you've possibly got a secu...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...iovec *in_sg,
> + unsigned int in_num,
> + struct virtio_pstore_res *res)
> +{
> + char path[PATH_MAX];
Don't declare PATH_MAX sized variables
> + int fd;
> + ssize_t len;
> + struct stat stbuf;
> + struct dirent *dent;
> + int sg_num = in_num;
> + struct iovec sg[sg_num];
'sg_num' is initialized from 'in_num' which comes from the
guest, and I'm not seeing anything which is bounds-checking
the 'in_num' value. So you've possibly got a secu...
2016 Jul 30
0
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...struct virtio_pstore_res *res)
> > +{
> > + char path[PATH_MAX];
>
> Don't declare PATH_MAX sized variables
Will change to use g_strdup_printf() as you said.
>
> > + int fd;
> > + ssize_t len;
> > + struct stat stbuf;
> > + struct dirent *dent;
> > + int sg_num = in_num;
> > + struct iovec sg[sg_num];
>
> 'sg_num' is initialized from 'in_num' which comes from the
> guest, and I'm not seeing anything which is bounds-checking
> the 'in_num' value...
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.
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
2016 Aug 26
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...that is present in 2.22. Just use "FALSE" instead.
Didn't know that, will change.
>
> > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> > +{
> > + char *filename = NULL;
> > + int fd, idx;
> > + struct stat stbuf;
> > + struct pstore_read_arg *rarg = NULL;
> > + Error *err = NULL;
> > + int ret = -1;
> > +
> > + if (s->file_idx >= s->num_file) {
> > + return 0;
> > + }
> > +
> > + rarg = g_malloc(sizeof(*rarg));
> >...
2016 Jul 18
3
[PATCH 2/3] qemu: Implement virtio-pstore device
...if (s->dir == NULL) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static ssize_t virtio_pstore_do_read(VirtIOPstore *s, void *buf, size_t sz,
+ struct virtio_pstore_hdr *hdr)
+{
+ char path[PATH_MAX];
+ FILE *fp;
+ ssize_t len;
+ struct stat stbuf;
+ struct dirent *dent;
+
+ if (s->dir == NULL) {
+ return -1;
+ }
+
+ dent = readdir(s->dir);
+ while (dent) {
+ if (dent->d_name[0] != '.') {
+ break;
+ }
+ dent = readdir(s->dir);
+ }
+
+ if (dent == NULL) {
+...
2016 Jul 18
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...; +
> + return 0;
> +}
> +
> +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, void *buf, size_t sz,
> + struct virtio_pstore_hdr *hdr)
> +{
> + char path[PATH_MAX];
> + FILE *fp;
> + ssize_t len;
> + struct stat stbuf;
> + struct dirent *dent;
> +
> + if (s->dir == NULL) {
> + return -1;
> + }
> +
> + dent = readdir(s->dir);
> + while (dent) {
> + if (dent->d_name[0] != '.') {
> + break;
> + }
> + dent = re...
2016 Jul 18
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...; +
> > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, void *buf, size_t sz,
> > + struct virtio_pstore_hdr *hdr)
> > +{
> > + char path[PATH_MAX];
> > + FILE *fp;
> > + ssize_t len;
> > + struct stat stbuf;
> > + struct dirent *dent;
> > +
> > + if (s->dir == NULL) {
> > + return -1;
> > + }
> > +
> > + dent = readdir(s->dir);
> > + while (dent) {
> > + if (dent->d_name[0] != '.') {
> > +...
2016 Jul 18
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...; +
> > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, void *buf, size_t sz,
> > + struct virtio_pstore_hdr *hdr)
> > +{
> > + char path[PATH_MAX];
> > + FILE *fp;
> > + ssize_t len;
> > + struct stat stbuf;
> > + struct dirent *dent;
> > +
> > + if (s->dir == NULL) {
> > + return -1;
> > + }
> > +
> > + dent = readdir(s->dir);
> > + while (dent) {
> > + if (dent->d_name[0] != '.') {
> > +...
2009 Nov 04
0
PATCH: fast copy of files in local server mode
...f, char **data)
{
- static int32 residue;
+ static off_t residue;
static char *buf;
int32 n;
@@ -222,6 +222,21 @@
out_of_memory("simple_recv_token");
}
+ if (f < 0) {
+ /* fast copy handle */
+ f = -f;
+ if (!*data) {
+ /* start reading this file */
+ struct stat stbuf;
+ if (fstat(f, &stbuf) < 0)
+ return -1;
+ residue = stbuf.st_size;
+ *data = buf;
+ }
+ if (residue == 0)
+ return 0;
+ }
+
if (residue == 0) {
int32 i = read_int(f);
if (i <= 0)
2016 Jul 27
0
[PATCH 6/7] qemu: Implement virtio-pstore device
...return 0;
+}
+
+static ssize_t virtio_pstore_do_read(VirtIOPstore *s, struct iovec *in_sg,
+ unsigned int in_num,
+ struct virtio_pstore_res *res)
+{
+ char path[PATH_MAX];
+ int fd;
+ ssize_t len;
+ struct stat stbuf;
+ struct dirent *dent;
+ int sg_num = in_num;
+ struct iovec sg[sg_num];
+ struct virtio_pstore_fileinfo info;
+ size_t offset = sizeof(*res) + sizeof(info);
+
+ if (s->dirp == NULL) {
+ return -1;
+ }
+
+ dent = readdir(s->dirp);
+ while (dent) {
+ i...
2016 Jul 18
7
[RFC/PATCHSET 0/3] virtio-pstore: Implement virtio pstore device
Hello,
This patchset is a proof of concept of virtio-pstore idea [1]. It has
some rough edges and I'm not familiar with this area, so please give
me feedbacks and advices if I'm going to a wrong direction.
It started from the fact that dumping ftrace buffer at kernel
oops/panic takes too much time. Although there's a way to reduce the
size of the original data, sometimes I want to
2016 Jul 18
7
[RFC/PATCHSET 0/3] virtio-pstore: Implement virtio pstore device
Hello,
This patchset is a proof of concept of virtio-pstore idea [1]. It has
some rough edges and I'm not familiar with this area, so please give
me feedbacks and advices if I'm going to a wrong direction.
It started from the fact that dumping ftrace buffer at kernel
oops/panic takes too much time. Although there's a way to reduce the
size of the original data, sometimes I want to
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello,
This is v2 of the virtio-pstore work. In this patchset I addressed
most of feedbacks from previous version. Limiting disk size is not
implemented yet.
* changes in v2)
- update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan)
- make buffer size configurable (Cornelia)
- support PSTORE_TYPE_CONSOLE (Kees)
- use separate virtqueues for read and write
- support concurrent async
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello,
This is v2 of the virtio-pstore work. In this patchset I addressed
most of feedbacks from previous version. Limiting disk size is not
implemented yet.
* changes in v2)
- update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan)
- make buffer size configurable (Cornelia)
- support PSTORE_TYPE_CONSOLE (Kees)
- use separate virtqueues for read and write
- support concurrent async
2016 Aug 20
7
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3)
Hello,
This is another iteration of the virtio-pstore work. In this patchset
I addressed most of feedbacks from previous version and drooped the
support for PSTORE_TYPE_CONSOLE for simplicity. It'll be added once the basic implementation
* changes in v3)
- use QIOChannel API (Stefan, Daniel)
- add bound check for malcious guests (Daniel)
- drop support PSTORE_TYPE_CONSOLE for now