Displaying 20 results from an estimated 44 matches for "drive_index".
2017 Apr 28
2
[PATCH] common/options: Change drv struct to store drive index instead of device name.
...= drv_d;
- drv->nr_drives = -1;
drv->d.guest = optarg;
drv->next = *drvsp;
@@ -111,22 +108,15 @@ option_d (const char *arg, struct drv **drvsp)
}
char
-add_drives_handle (guestfs_h *g, struct drv *drv, char next_drive)
+add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
{
int r;
struct guestfs_add_drive_opts_argv ad_optargs;
- if (next_drive > 'z')
- error (EXIT_FAILURE, 0, _("too many drives added on the command line"));
-
if (drv) {
- next_drive = add_drives (drv->next, next_drive);
+ drive_index = add_drives (drv-&...
2017 Jun 15
0
[PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
...arg) Noreturn;
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
value
-v2v_utils_drive_name (value indexv)
+guestfs_int_mlutils_drive_name (value indexv)
{
CAMLparam1 (indexv);
CAMLlocal1 (namev);
@@ -54,7 +54,7 @@ v2v_utils_drive_name (value indexv)
}
value
-v2v_utils_drive_index (value strv)
+guestfs_int_mlutils_drive_index (value strv)
{
CAMLparam1 (strv);
ssize_t r;
@@ -67,7 +67,7 @@ v2v_utils_drive_index (value strv)
}
value
-v2v_utils_shell_unquote (value strv)
+guestfs_int_mlutils_shell_unquote (value strv)
{
CAMLparam1 (strv);
CAMLlocal1 (retv);
dif...
2017 May 03
0
Re: [PATCH] common/options: Change drv struct to store drive index instead of device name.
...sed with -a or -d"));
>
> /* Add domains/drives from the command line (for a single guest). */
> - add_drives (drvs, 'a');
> + add_drives (drvs, 0);
This, and in all the other files, is using 0 as starting index.
Since add_drives is a macro, I'd remove its drive_index parameter, and
always pass 0 to add_drives_handle. The only change needed would be...
> char
> -add_drives_handle (guestfs_h *g, struct drv *drv, char next_drive)
> +add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
> {
> int r;
> struct guestfs_add_d...
2020 Feb 24
3
[PATCH commit] options: Compile blocksize code conditionally.
...d40df92e4a6c0423e136e005c
---
options/options.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/options/options.c b/options/options.c
index 63221ea..abdcbae 100644
--- a/options/options.c
+++ b/options/options.c
@@ -140,10 +140,12 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
ad_optargs.discard = drv->a.discard;
}
+#ifdef GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK
if (drv->a.blocksize) {
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
ad_o...
2015 Jul 01
12
[PATCH 1/9] v2v: Stable bus and slot numbers for removable drives (RHBZ#1238053).
This patch series adds stable bus and slot numbers for removable
drives (CDs and floppies) when the guest is converted using virt-v2v
or virt-p2v.
Previously we were a bit random about this. After this patch series,
the bus and slot numbers and preserved if at all possible.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1238053
Rich.
2018 Aug 09
2
[PATCH] v2v: parse_libvirt_xml: handle srN CDROM devices (RHBZ#1612785)
This device naming is mostly written by virt-p2v, so get the slot from
it directly without using the drive_index "decoding" function.
---
v2v/parse_libvirt_xml.ml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
index 36d2f66dd..55432f537 100644
--- a/v2v/parse_libvirt_xml.ml
+++ b/v2v/parse_libvirt_xml.ml
@@ -396,7 +3...
2020 Feb 13
1
[common PATCH v4 0/1] options: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
v4 fixes issues found during code review:
- whitespace-change-only hunks are removed
- options are alphabetically orderred now
v3 is just a spelling correction spotted by Eric Blake
https://www.redhat.com/archives/libguestfs/2020-February/msg00111.html
In v2 I've moved '--blocksize' parameter description into the separate
file called
2020 Feb 12
0
[common PATCH v2 1/1] options: add '--blocksize' option for C-based tools
...const char *format, struct drv **drvsp)
drv->uri.password = uri.password;
drv->uri.format = format;
drv->uri.orig_uri = arg;
+ drv->uri.blocksize = blocksize;
}
drv->next = *drvsp;
@@ -137,6 +140,10 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
ad_optargs.discard = drv->a.discard;
}
+ if (drv->a.blocksize) {
+ ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
+ ad_optargs.blocksize = drv->a.blocksize;
+ }...
2020 Feb 25
0
Re: [PATCH commit] options: Compile blocksize code conditionally.
...ions/options.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/options/options.c b/options/options.c
> index 63221ea..abdcbae 100644
> --- a/options/options.c
> +++ b/options/options.c
> @@ -140,10 +140,12 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
> ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
> ad_optargs.discard = drv->a.discard;
> }
> +#ifdef GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK
> if (drv->a.blocksize) {
> ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BL...
2020 Feb 11
1
[common PATCH] options: add '--blocksize' option for C-based tools
...const char *format, struct drv **drvsp)
drv->uri.password = uri.password;
drv->uri.format = format;
drv->uri.orig_uri = arg;
+ drv->uri.blocksize = blocksize;
}
drv->next = *drvsp;
@@ -137,6 +140,10 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
ad_optargs.discard = drv->a.discard;
}
+ if (drv->a.blocksize) {
+ ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
+ ad_optargs.blocksize = drv->a.blocksize;
+ }...
2020 Feb 12
1
[common PATCH v3 0/1] options: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
v3 is just a spelling correction spotted by Eric Blake
In v2 I've moved '--blocksize' parameter description into the separate
file called blocksize-option.pod so we can include it everywhere we need
similar to key-option.pod.
https://www.redhat.com/archives/libguestfs/2020-February/msg00099.html
v1 was here:
2020 Mar 10
2
[PATCH common] options: Require libguestfs >= 1.42.
...eys (ks, partitions[i], uuid);
assert (guestfs_int_count_strings (keys) > 0);
diff --git a/options/options.c b/options/options.c
index abdcbae5b..63221ea32 100644
--- a/options/options.c
+++ b/options/options.c
@@ -140,12 +140,10 @@ add_drives_handle (guestfs_h *g, struct drv *drv, size_t drive_index)
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
ad_optargs.discard = drv->a.discard;
}
-#ifdef GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK
if (drv->a.blocksize) {
ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
ad_o...
2019 Jan 14
1
[PATCH] inspect: fix inspection of partition-less devices (RHBZ#1661038)
...nt_of_string (PCRE.sub 2)
- and part = int_of_string (PCRE.sub 3) in
+ and part = PCRE.sub 3 in
(* Hurd disk devices are like /dev/hdNsM, where hdN is the
* N-th disk and M is the M-th partition on that disk.
@@ -504,7 +504,7 @@ and resolve_xdev typ disk part default =
let i = drive_index disk in
if i >= 0 && i < Array.length devices then (
let dev = Array.get devices i in
- let dev = dev ^ string_of_int part in
+ let dev = dev ^ part in
if is_partition dev then
Mountable.of_device dev
else
--
2.20.1
2020 Feb 12
3
[common PATCH v2 0/1] options: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com>
In v2 I've moved '--blocksize' parameter description into the separate
file called blocksize-option.pod so we can include it everywhere we need
similar to key-option.pod.
v1 was here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00096.html
Nikolay Ivanets (1):
options: add '--blocksize' option for C-based
2015 Nov 17
0
[PATCH 2/3] v2v: windows: Add a Windows '*.inf' file parser.
...+ try Sys.getenv "srcdir"
+ with Not_found -> failwith "environment variable $srcdir must be set"
+
let inspect_defaults = {
i_type = ""; i_distro = ""; i_arch = "";
i_major_version = 0; i_minor_version = 0;
@@ -126,6 +134,97 @@ let test_drive_index ctx =
assert_raises exn (fun () -> Utils.drive_index "Z");
assert_raises exn (fun () -> Utils.drive_index "aB")
+(* Test parsing a [*.inf] file. *)
+let test_windows_inf_of_string ctx =
+ let printer = Windows_inf.to_string in
+
+ (* There is nothing special abou...
2016 Dec 08
3
[PATCH 0/2] mllib: Add quote function to Common_utils module.
Doing this allows us to remove the Customize_utils module
completely, since it becomes empty.
Rich.
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
I believe this addresses everything raised in comments on that
patch series.
Rich.
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought.
We have lots of utility functions, spread all over the repository,
with not a lot of structure. This moves many of them under common/
and structures them so there are clear dependencies.
This doesn't complete the job by any means. Other items I had on my
to-do list for this change were:
- Split up mllib/common_utils into:
-
2018 Aug 10
0
Re: [PATCH] v2v: parse_libvirt_xml: handle srN CDROM devices (RHBZ#1612785)
On Thu, Aug 09, 2018 at 03:05:26PM +0200, Pino Toscano wrote:
> This device naming is mostly written by virt-p2v, so get the slot from
> it directly without using the drive_index "decoding" function.
> ---
> v2v/parse_libvirt_xml.ml | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
> index 36d2f66dd..55432f537 100644
> --- a/v2v/parse_libvirt_xml.ml
> +++...
2015 Oct 08
0
[PATCH] v2v: Add xpath_int64 functions, and use them to read memory values.
...match xpath_int xpathctx expr with
| None -> default
| Some i -> i
+let xpath_int64_default xpathctx expr default =
+ match xpath_int64 xpathctx expr with
+ | None -> default
+ | Some i -> i
external drive_name : int -> string = "v2v_utils_drive_name"
external drive_index : string -> int = "v2v_utils_drive_index"
--
2.5.0