Displaying 20 results from an estimated 33 matches for "is_root_device".
2017 Apr 12
0
Re: [PATCH 2/2] daemon: add udev_settle_file to is_root_device
...butsykin@virtuozzo.com>
> ---
> daemon/guestfsd.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
> index dccfa15bc..9aa69301f 100644
> --- a/daemon/guestfsd.c
> +++ b/daemon/guestfsd.c
> @@ -402,6 +402,9 @@ int
> is_root_device (const char *device)
> {
> struct stat statbuf;
> +
> + udev_settle_file(device);
Add a space after the function name, but with that change ACK.
> if (stat (device, &statbuf) == -1) {
> perror (device);
> return 0;
Rich.
--
Richard Jones, Virtualizati...
2017 Apr 13
0
Re: [PATCH v2 2/2] daemon: add udev_settle_file to is_root_device
...butsykin@virtuozzo.com>
> ---
> daemon/guestfsd.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
> index b82c98acd..e6a4c65c4 100644
> --- a/daemon/guestfsd.c
> +++ b/daemon/guestfsd.c
> @@ -404,6 +404,9 @@ int
> is_root_device (const char *device)
> {
> struct stat statbuf;
> +
> + udev_settle_file (device);
> +
> if (stat (device, &statbuf) == -1) {
> perror (device);
> return 0;
This one is fine now, so ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://p...
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...+), 21 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index a40dc3834..02ae34a6f 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -62,6 +62,7 @@ extern dev_t root_device;
extern char *sysroot_path (const char *path);
extern char *sysroot_realpath (const char *path);
extern int is_root_device (const char *device);
+extern int is_device_parameter (const char *device);
extern int xwrite (int sock, const void *buf, size_t len)
__attribute__((__warn_unused_result__));
extern int xread (int sock, void *buf, size_t len)
diff --git a/daemon/dd.c b/daemon/dd.c
index 15f3f7a6c..0b61c87d8 10...
2017 Feb 14
0
[PATCH 2/2] GCC 7: Allocate sufficient space for sprintf output.
...v/%s", d->d_name);
+ CLEANUP_FREE char *dev_path;
+ if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) {
+ reply_with_perror ("asprintf");
+ closedir (dir);
+ return NULL;
+ }
/* Ignore the root device. */
if (is_root_device (dev_path))
@@ -167,8 +171,12 @@ add_partitions (const char *device, struct stringsbuf *r)
struct dirent *d;
while ((d = readdir (dir)) != NULL) {
if (STREQLEN (d->d_name, device, strlen (device))) {
- char part[256];
- snprintf (part, sizeof part, "/dev/%s", d->...
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...->d_name[2]))) {
- CLEANUP_FREE char *dev_path = NULL;
- if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) {
- reply_with_perror ("asprintf");
- closedir (dir);
- return NULL;
- }
-
- /* Ignore the root device. */
- if (is_root_device (dev_path))
- continue;
-
- /* RHBZ#514505: Some versions of qemu <= 0.10 add a
- * CD-ROM device even though we didn't request it. Try to
- * detect this by seeing if the device contains media.
- */
- fd = open (dev_path, O_RDONLY|O_CLOEXEC);
- if (f...
2017 Feb 14
0
[PATCH v2 2/2] GCC 7: Allocate sufficient space for sprintf output.
...v/%s", d->d_name);
+ CLEANUP_FREE char *dev_path;
+ if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) {
+ reply_with_perror ("asprintf");
+ closedir (dir);
+ return NULL;
+ }
/* Ignore the root device. */
if (is_root_device (dev_path))
@@ -167,8 +171,12 @@ add_partitions (const char *device, struct stringsbuf *r)
struct dirent *d;
while ((d = readdir (dir)) != NULL) {
if (STREQLEN (d->d_name, device, strlen (device))) {
- char part[256];
- snprintf (part, sizeof part, "/dev/%s", d->...
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 Feb 14
4
[PATCH v2 0/2] GCC 7: Misc fixes
v1 -> v2:
- Use intprops macro suggested by danpb.
Rich.
2017 Feb 14
2
[PATCH 1/2] GCC 7: Add __attribute__((noreturn)) to some usage functions which call exit.
This happens with GCC 7.0.1. The errors were all of the form:
qemu-speed-test.c: In function 'main':
qemu-speed-test.c:153:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
usage (EXIT_SUCCESS);
^~~~~~~~~~~~~~~~~~~~
qemu-speed-test.c:155:5: note: here
default:
^~~~~~~
---
builder/index-validate.c | 2 +-
2014 May 20
14
Re: [PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
On Tuesday 20 May 2014 15:56:16 Richard W.M. Jones wrote:
> On Tue, May 20, 2014 at 03:33:31PM +0200, Pino Toscano wrote:
> > Resolve the given path within the chroot, so scrub can be invoked
> > outside the chroot on an already-resolved path.
> > Given that realpath is used, its availability is checked manually,
> > since scrub-file already depends on the
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...me ->
+ push_back args "-E";
+ push_back args filename
+ );
+ let args = !args in
+ let r, _, err = commandr "udevadm" args in
+ if r <> 0 then
+ eprintf "udevadm settle: %s\n" err
+
+let root_device = lazy ((stat "/").st_dev)
+
+let is_root_device_stat statbuf =
+ statbuf.st_rdev = Lazy.force root_device
+
+let is_root_device device =
+ udev_settle ~filename:device ();
+ try
+ let statbuf = stat device in
+ is_root_device_stat statbuf
+ with
+ Unix_error (err, func, arg) ->
+ eprintf "is_root_device: %s: %s: %s: %s\...
2017 Jul 19
2
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...; + push_back args filename
> + );
> + let args = !args in
> + let r, _, err = commandr "udevadm" args in
> + if r <> 0 then
> + eprintf "udevadm settle: %s\n" err
> +
> +let root_device = lazy ((stat "/").st_dev)
> +
> +let is_root_device_stat statbuf =
> + statbuf.st_rdev = Lazy.force root_device
> +
> +let is_root_device device =
> + udev_settle ~filename:device ();
> + try
> + let statbuf = stat device in
> + is_root_device_stat statbuf
> + with
> + Unix_error (err, func, arg) ->
> +...
2017 Jun 03
3
[PATCH 0/3]: daemon: Reimplement ‘file’ API in OCaml.
This patch series is just FYI at the moment. However it
does pass the tests.
The daemon is a self-contained program. We don't need to write it all
in C. Writing parts of it in OCaml would make it simpler and less
error-prone. In particular if the daemon was written in a more sane
programming language then we could move the inspection code to run
entirely inside the appliance, which would
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...me ->
+ push_back args "-E";
+ push_back args filename
+ );
+ let args = !args in
+ let r, _, err = commandr "udevadm" args in
+ if r <> 0 then
+ eprintf "udevadm settle: %s\n" err
+
+let root_device = lazy ((stat "/").st_dev)
+
+let is_root_device_stat statbuf =
+ statbuf.st_rdev = Lazy.force root_device
+
+let is_root_device device =
+ udev_settle ~filename:device ();
+ try
+ let statbuf = stat device in
+ is_root_device_stat statbuf
+ with
+ Unix_error (err, func, arg) ->
+ eprintf "is_root_device: %s: %s: %s: %s\...
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.
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html
This patch series reimplements a few more APIs in OCaml, including
some very important core APIs like ?list_filesystems? and ?mount?.
All the tests pass after this.
The selection of APIs that I have moved may look a little random, but
in fact they are all APIs consumed by the inspection code (and some
more
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection
series here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html
What I've done is to extract just the parts related to rewriting
daemon APIs in OCaml, rebase them on top of the current master, fix a
few things, and recompile and test everything.
Rich.
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
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