Displaying 10 results from an estimated 10 matches for "udev_settle_file".
2017 Apr 12
0
Re: [PATCH 2/2] daemon: add udev_settle_file to is_root_device
..., 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, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization...
2017 Apr 13
0
Re: [PATCH v2 2/2] daemon: add udev_settle_file to is_root_device
..., 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://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpres...
2017 Apr 12
0
Re: [PATCH 1/2] daemon: run 'udevadm settle' with --exit-if-exists option
On Wed, Apr 12, 2017 at 05:01:10PM +0300, Pavel Butsykin wrote:
> Add udev_settle_file() to run 'udevadm settle' with --exit-if-exists option. It
> will slightly reduce the waiting-time for pending events if we need to wait
> for events related to a particular device/file.
>
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> ---
> daemon/dae...
2017 Apr 13
0
Re: [PATCH v2 1/2] daemon: run 'udevadm settle' with --exit-if-exists option
On Thursday, 13 April 2017 16:55:26 CEST Pavel Butsykin wrote:
> Add udev_settle_file() to run 'udevadm settle' with --exit-if-exists option. It
> will slightly reduce the waiting-time for pending events if we need to wait
> for events related to a particular device/file.
>
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> ---
> daemon/dae...
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 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...ction tests if the parameter is a block
+ * device name.
+ *
+ * It can also be used in daemon code to test if the string passed
+ * as a C<Dev_or_Path> parameter is a device or path.
+ */
+int
+is_device_parameter (const char *device)
+{
+ struct stat statbuf;
+ int fd;
+ uint64_t n;
+
+ udev_settle_file (device);
+
+ if (!STRPREFIX (device, "/dev/"))
+ return 0;
+
+ /* Allow any /dev/sd device, so device name translation works. */
+ if (STRPREFIX (device, "/dev/sd"))
+ return 1;
+
+ /* Is it a block device in the appliance? */
+ if (stat (device, &statbuf) == -1)...
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...dex b3f40628b..bcded501a 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -63,9 +63,6 @@
#include "daemon.h"
-GUESTFSD_EXT_CMD(str_udevadm, udevadm);
-GUESTFSD_EXT_CMD(str_uuidgen, uuidgen);
-
#ifndef MAX
# define MAX(a,b) ((a)>(b)?(a):(b))
#endif
@@ -1095,7 +1092,7 @@ udev_settle_file (const char *file)
size_t i = 0;
int r;
- ADD_ARG (argv, i, str_udevadm);
+ ADD_ARG (argv, i, "udevadm");
if (verbose)
ADD_ARG (argv, i, "--debug");
@@ -1124,7 +1121,7 @@ get_random_uuid (void)
char *out;
CLEANUP_FREE char *err = NULL;
- r = command...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...exit (EXIT_FAILURE);
}
+ /* Handle the --print-external-commands option. */
+ if (do_print_external_commands) {
+ print_external_commands ();
+ exit (EXIT_SUCCESS);
+ }
+
#ifndef WIN32
/* Make sure SIGPIPE doesn't kill us. */
struct sigaction sa;
@@ -1095,7 +1112,7 @@ udev_settle_file (const char *file)
size_t i = 0;
int r;
- ADD_ARG (argv, i, str_udevadm);
+ ADD_ARG (argv, i, "udevadm");
if (verbose)
ADD_ARG (argv, i, "--debug");
@@ -1124,7 +1141,7 @@ get_random_uuid (void)
char *out;
CLEANUP_FREE char *err = NULL;
- r = command...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.