search for: dev_path

Displaying 20 results from an estimated 46 matches for "dev_path".

2017 Apr 19
1
[PATCH] daemon: Remove use of fixed-size stack buffers.
...diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 584e7d8b8..eac79197e 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -125,13 +125,16 @@ foreach_block_device (block_dev_func_t func, bool return_md) static int add_device (const char *device, struct stringsbuf *r) { - char dev_path[256]; - snprintf (dev_path, sizeof dev_path, "/dev/%s", device); + CLEANUP_FREE char *dev_path; - if (add_string (r, dev_path) == -1) { + if (asprintf (&dev_path, "/dev/%s", device) == -1) { + reply_with_perror ("asprintf"); return -1; } + if (a...
2017 Feb 14
0
[PATCH 2/2] GCC 7: Allocate sufficient space for sprintf output.
...ntf (strs[i], 16, "%zu", i); ^~~~~ or this form: sync.c: In function 'fsync_devices': sync.c:108:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 251 [-Werror=format-truncation=] snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); ^~ Fixed by converting these into dynamic allocation, or making the output buffer larger, whichever was easier. --- cat/filesystems.c | 2 +- daemon/9p.c | 10 +++++++--- daemo...
2017 Feb 14
0
[PATCH v2 2/2] GCC 7: Allocate sufficient space for sprintf output.
...ntf (strs[i], 16, "%zu", i); ^~~~~ or this form: sync.c: In function 'fsync_devices': sync.c:108:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 251 [-Werror=format-truncation=] snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); ^~ Fixed by converting these into dynamic allocation, or making the output buffer larger, whichever was easier. There is a gnulib macro we can use to make this simpler for integers. It requires...
2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...sd", 2) == 0 || - strncmp (d->d_name, "hd", 2) == 0 || - strncmp (d->d_name, "vd", 2) == 0) { - snprintf (buf, sizeof buf, "/dev/%s", d->d_name); + /* Add a device to the list of devices */ + int add_to_device_list(const char *device) { + char dev_path[256]; + snprintf (dev_path, sizeof dev_path, "/dev/%s", device); - /* 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. - */ - int f...
2012 Sep 20
1
[PATCH] rename local variable to avoid clash with match macro
...estfs_h *g, Hash_table **map) mdadm_app_free); if (!*map) g->abort_cb(); - for (char **match = matches; *match != NULL; match++) { + for (char **_match = matches; *_match != NULL; _match++) { /* Get device name and uuid for each array */ - char *dev_path = safe_asprintf(g, "%s/devicename", *match); + char *dev_path = safe_asprintf(g, "%s/devicename", *_match); char *dev = guestfs_aug_get(g, dev_path); free(dev_path); if (!dev) goto error; - char *uuid_path = safe_asprintf(g, "%s/uuid", *match); +...
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 +-
2017 Feb 14
4
[PATCH v2 0/2] GCC 7: Misc fixes
v1 -> v2: - Use intprops macro suggested by danpb. Rich.
2017 Apr 19
2
[PATCH v2] daemon: Remove use of fixed-size stack buffers.
v1 -> v2: - Fixes as suggested by Pino. Rich.
2017 Apr 19
0
[PATCH v2] daemon: Remove use of fixed-size stack buffers.
...diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 584e7d8b8..82467b92f 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -125,13 +125,16 @@ foreach_block_device (block_dev_func_t func, bool return_md) static int add_device (const char *device, struct stringsbuf *r) { - char dev_path[256]; - snprintf (dev_path, sizeof dev_path, "/dev/%s", device); + char *dev_path; - if (add_string (r, dev_path) == -1) { + if (asprintf (&dev_path, "/dev/%s", device) == -1) { + reply_with_perror ("asprintf"); return -1; } + if (add_string_nod...
2017 Jan 19
3
[PATCH 1/2] daemon: Fix part-to-dev when the partition name includes p<N>.
From: Pino Toscano <ptoscano@redhat.com> If the device name ends with a number, Linux uses partition names of the form <device>p<N>. Handle this case by knocking off the 'p' character. --- daemon/devsparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 5862ae2..b764f63 100644 --- a/daemon/devsparts.c +++
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...d->d_name, "ubd", 3) || - STREQLEN (d->d_name, "vd", 2) || - STREQLEN (d->d_name, "sr", 2) || - (return_md && - STREQLEN (d->d_name, "md", 2) && c_isdigit (d->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; - -...
2011 Dec 01
2
[PATCH 0/2] handle MD devices in fstab
Only change from previous post is explicitly checking md_map for NULL before hash_free and lookup.
2011 Nov 25
2
[PATCH 0/2] MD device inspection
These patches are rebased on top of current master. In addition, I've made the following changes: * Fixed whitespace error. * Functions return -1 on error. * Added a debug message when guest contains md devices, but nothing was parsed from mdadm.conf.
2016 Jun 12
0
Re: [PATCH v2 2/2] v2v: remove the 'graphicsmodedisabled' entry in ESP BCD
...ests: BIOS -> I_BIOS. Please run the tests! (2) The code below > + let esp_temp_path = g#mkdtemp "/Windows/Temp/ESP_XXXXXX" in > + > + match inspect.i_firmware with > + | I_BIOS -> () > + | I_UEFI esp_list -> > + List.iter ( > + fun dev_path -> > + g#mount dev_path esp_temp_path; > + fix_win_uefi_bcd esp_temp_path; > + g#umount esp_temp_path; > + ) esp_list; > + > + g#rmdir esp_temp_path; doesn't do what you think. The match statement extends all the way through to the g#rmdir, so...
2017 Jan 19
0
[PATCH 2/2] daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510).
...STREQLEN (d->d_name, "vd", 2) || - STREQLEN (d->d_name, "sr", 2)) { + STREQLEN (d->d_name, "sr", 2) || + (return_md && + STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name); /* Ignore the root device. */ @@ -131,7 +134,12 @@ add_device (const char *device, struct stringsbuf *r) char ** do_list_devices (void) { - return foreach_block_device (add_device); + /* For backwards compatibility, don't retur...
2010 Jun 27
0
support for polygons with holes
Hi This is for developers of extension packages that provide extra *graphics devices* for R. In the *development* version of R, support has been added to the graphics engine for rendering polygons with holes (e.g., maps with lakes with islands ...). The API change is a new dev_Path() function for graphics devices. The R_GE_version constant (in GraphicsEngine.h) has been bumped up to 8 as a marker of this change. This means that, at a minimum, all graphics devices should be updated to provide dummy implementations of the new functions to just say that the feature is not ye...
2016 Jun 10
0
Re: [PATCH 2/2] v2v: remove the 'graphicsmodedisabled' entry in ESP BCD
...); > + with > + Not_found -> () > + in > + > + let esp_temp_path = g#mkdtemp "/Windows/Temp/ESP_XXXXXX" in > + > + match inspect.i_uefi with > + | None -> () > + | Some uefi_list -> > + List.iter ( > + fun dev_path -> > + g#mount dev_path esp_temp_path; > + fix_win_uefi_bcd esp_temp_path; > + g#umount esp_temp_path; > + ) uefi_list; > + > + g#rmdir esp_temp_path; > in > > (* Firstboot configuration. *) > @@ -480,6 +519,8 @@ if errorlevel 30...
2011 Aug 15
0
Problem importing virtual disk
...;/usr/lib/xen-common/xapi/sm/blktap2.py", line 1282, in activate writable, caching_params): File "/usr/lib/xen-common/xapi/sm/blktap2.py", line 32, in wrapper ret = op(self, *args) File "/usr/lib/xen-common/xapi/sm/blktap2.py", line 1314, in _activate_locked dev_path = self._activate(sr_uuid, vdi_uuid, writable, caching_params) File "/usr/lib/xen-common/xapi/sm/blktap2.py", line 1334, in _activate dev_path = self._tap_activate(phy_path, vdi_type, sr_uuid, writable) File "/usr/lib/xen-common/xapi/sm/blktap2.py", line 1126, in _tap_act...
2013 Apr 18
9
[PATCH v5 1/2] libxl: Introduce functions to add and remove USB devices to an HVM guest
...error (unimplemented type)"); + goto out; + } + + rc = 0; +out: + return rc; +} + +static int usb_add_xenstore(libxl__gc *gc, uint32_t domid, + libxl__device_usb *usbdev) +{ + libxl_ctx *ctx = libxl__gc_owner(gc); + flexarray_t *dev; + char *dev_path; + xs_transaction_t t = 0; + struct xs_permissions noperm[1]; + int rc = 0; + + noperm[0].id = 0; + noperm[0].perms = XS_PERM_NONE; + + dev = flexarray_make(gc, 16, 1); + + flexarray_append_pair(dev, "protocol", + GCSPRINTF("%s", +...
2012 Jul 03
8
[PATCH 0/7 v2] Fix and workaround for qcow2 issues in qemu causing data corruption.
https://bugzilla.redhat.com/show_bug.cgi?id=836710 https://bugzilla.redhat.com/show_bug.cgi?id=836913 There are at least two related bugs going on: (1) Linux sync(2) system call doesn't send a write barrier to the disk, so in effect it doesn't force the hard disk to flush its cache. libguestfs used sync(2) to force changes to disk. We didn't expect that qemu was caching anything