search for: roundup64

Displaying 20 results from an estimated 52 matches for "roundup64".

2014 Sep 22
0
[PATCH v3 7/7] resize: add support to resize logical partitions
...ad) in @@ -799,6 +816,28 @@ read the man page virt-resize(1). ) ); + (* handle resizing of logical partitions *) + List.iter ( + fun p -> + if p.p_type = ContentExtendedPartition then ( + let alignment = if alignment = 1L then 2L else alignment in + let size = roundup64 p.p_part.G.part_size sectsize in + let logical_sizes = List.fold_left ( + fun total p -> + match p.p_operation with + | OpDelete -> total +^ 0L + | OpCopy | OpIgnore -> total +^ (roundup64 p.p_part.G.part_size (alignment *^ sectsize)) +...
2014 Oct 08
0
[PATCH V5 2/4] resize: add support to resize logical partitions
...ad) in @@ -799,6 +816,29 @@ read the man page virt-resize(1). ) ); + (* handle resizing of logical partitions *) + List.iter ( + fun p -> + if p.p_type = ContentExtendedPartition then ( + let alignment = if alignment = 1L then 2L else alignment in + let size = roundup64 p.p_part.G.part_size sectsize in + let logical_sizes = List.fold_left ( + fun total p -> + match p.p_operation with + | OpDelete -> total +^ 0L + (* the start of logical partitions is aligned *) + | OpCopy | OpIgnore -> tota...
2014 Oct 08
6
[PATCH V5 0/4] virt-resize: add support for resizing logical
Hi Rich, This is v5 series to add support for resizing MBR logical partitions. please review. Thanks! changes to v4: 1. add support to resize extended partition (--resize or --expand extended partition) 2. fix the problem of deficit of 512 bytes when expanding a logical partition (this problem can be reproduced in v4 by only expanding a logical partition, without resizing any other
2014 Oct 30
8
[PATCH v5 REBASE 0/4] virt-resize: add support for resizing logical
Hi Rich, This is rebase of v5 series. Meanwhile, I found a bug when shrinking partitions, and the fix is incuded in this version (patch 2). Regards, Hu changes to v4: 1. add support to resize extended partition (--resize or --expand extended partition) 2. fix the problem of deficit of 512 bytes when expanding a logical partition (this problem can be reproduced in v4 by only expanding a
2017 Apr 12
1
[PATCH] mllib: Bind %identity C primitive to Common_utils.identity.
...n_utils.ml b/mllib/common_utils.ml index 63d8dd92e..6a9b08973 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -282,6 +282,8 @@ let ( /^ ) = Int64.div let ( &^ ) = Int64.logand let ( ~^ ) = Int64.lognot +external identity : 'a -> 'a = "%identity" + let roundup64 i a = let a = a -^ 1L in (i +^ a) &^ (~^ a) let div_roundup64 i a = (i +^ a -^ 1L) /^ a diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index ec41a8ff8..0669a42bf 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -142,6 +142,8 @@ val ( &^ ) : int64 -> in...
2014 Oct 08
0
[PATCH V5 3/4] resize: support resize extended partition
...man page virt-resize(1). start_overhead_sects +^ alignment_sects +^ gpt_end_sects in sectsize *^ overhead_sects in + let required_logical = List.fold_left ( + fun total p -> + let newsize = + match p.p_operation with + | OpCopy | OpIgnore -> roundup64 p.p_part.G.part_size (alignment *^ sectsize) + | OpDelete -> 0L + | OpResize newsize -> roundup64 newsize (alignment *^ sectsize) in + total +^ newsize + ) 0L logical_partitions in + let required_logical = required_logical +^ alignment *^ sectsize in + let re...
2015 May 20
15
[PATCH v2 00/11] virt-resize: add support for resizing MBR logical partitions
In current virt-resize, only primary partitions(including extended partition) are supported. They are collected in an array for resize operations. Logical partitions are not supported. This series add support for resizing logical partitions. v2: 1) Add 3 variables to describe relationship of logical and extended partitions: - partitions flat list of primary partitions (as now, the global
2015 Jun 03
13
[PATCH v3 00/11] virt-resize: add support for resizing MBR logical partitions
In current virt-resize, only primary partitions(including extended partition) are supported. They are collected in an array for resize operations. Logical partitions are not supported. This series add support for resizing logical partitions. v3: 1) rewrite partitions/logical_partitions/extended_partition section by the comments from Rich and Pino. 2) in 03/11 introduce logical_align for
2015 Jun 17
13
[PATCH v4 00/11] virt-resize: add support for resizing MBR logical partitions
In current virt-resize, only primary partitions(including extended partition) are supported. They are collected in an array for resize operations. Logical partitions are not supported. This series add support for resizing logical partitions. v4: rebase on upstream. v3: 1) rewrite partitions/logical_partitions/extended_partition section by the comments from Rich and Pino. 2) in 03/11
2015 Jul 06
13
[PATCH rebase v4 00/11] virt-resize: add support for resizing MBR logical partitions
In current virt-resize, only primary partitions(including extended partition) are supported. They are collected in an array for resize operations. Logical partitions are not supported. This series add support for resizing logical partitions. v4: rebase on upstream. v3: 1) rewrite partitions/logical_partitions/extended_partition section by the comments from Rich and Pino. 2) in 03/11
2014 Sep 26
0
[RFC PATCH v4 7/7] resize: support resize extended partition
...man page virt-resize(1). start_overhead_sects +^ alignment_sects +^ gpt_end_sects in sectsize *^ overhead_sects in + let required_logical = List.fold_left ( + fun total p -> + let newsize = + match p.p_operation with + | OpCopy | OpIgnore -> roundup64 p.p_part.G.part_size (alignment *^ sectsize) + | OpDelete -> 0L + | OpResize newsize -> roundup64 newsize (alignment *^ sectsize) in + total +^ newsize + ) 0L logical_partitions in + let required_extended = List.fold_left ( + fun total p -> + let...
2014 Sep 19
22
[PATCH v2 00/13] virt-resize: add support for resizing MBR logical partitions
...nges to v1: 1. spit the patches so it's easier to review 2. fix the parted error caused by unaligned logical partitions 3. extend the content of logical partitions 4. refactor to make logical partitions a seperate list Hu Tao (13): resize: convert sectsize to int64 add function div_roundup64 resize: introduce partition type resize: introduce filter_part resize: add function find_partition resize: add function print_summmary resize: expose loop to calculate new partitions' positions resize: add function mbr_part_type resize: add function copy_partition resize: add fu...
2014 Sep 22
13
[PATCH v3 0/7] add support to resize MBR logical partitions
Hi Rich, This is v3 series to add support for resizing MBR logical partitions. changes to v2: 1. remove p_part_num 2. remove filter_parts 3. name the function calculate_target_partitions 4. remove the code to restart guest introduced in v2 changes to v1: 1. spit the patches so it's easier to review 2. fix the parted error caused by unaligned logical partitions 3. extend the
2015 Dec 14
4
[PATCH 0/2] resize: Split out the command line parsing into Cmdline
Some simple refactoring of virt-resize. I originally had the idea that we could turn virt-resize into a library (cf. virt-customize) and use it from virt-builder, but I now don't think that would make any meaningful difference. In particular we'd still have to open the handle the same number of times. These two patches are left over from my work on that. Rich.
2014 Sep 26
9
[PATCH v4 0/7] virt-resize: add support for resizing logical partitions
Hi Rich, This is v3 series to add support for resizing MBR logical partitions. changes to v3: 1. merge patch 1 and patch 3 in v3 2. let mbr_part_type return 'primary' for GPT partitions 3. add test for resizing logical partitions 4. fix extending the extended partition (yet). see patch 7. changes to v2: 1. remove p_part_num 2. remove filter_parts 3. name the function
2017 Jan 31
1
Re: [PATCH v6 3/3] v2v: ova: don't extract files from OVA if it's not needed
...error (f_"file '%s' not found in the ova") filename > + in > + (* QEMU requires size aligned to 512 bytes. This is safe because > + * tar also works with 512 byte blocks. > + *) > + let size = roundup64 size 512L in > + let doc = [ > + "file", JSON.Dict [ > + "driver", JSON.String "raw"; > + "offset", JSON.Int64 offset; > + "size", JSON.Int64 size; > +...
2014 Jul 16
2
Re: virt-resize: support to MBR logical partitions and some question
On Tue, Jul 15, 2014 at 09:01:47AM +0100, Richard W.M. Jones wrote: > The answer is I don't know. But there are a few things you can try: > > (1) Most importantly, enable tracing (export LIBGUESTFS_TRACE=1) and > get a list of operations that are performed in the order they are > performed. This is vital for debugging this. > > (2) When the error happens, run
2016 Nov 04
0
[PATCH 4/5] v2v: ova: don't extract files from OVA if it's not needed
..._found -> + error (f_"file '%s' not found in the ova") filename + in + (* QEMU requires size aligned to 512 bytes. This is safe because + * tar also works with 512 byte blocks. + *) + let size = roundup64 size 512L in + sprintf + "json:{ \"file\": { \"driver\":\"raw\", \"offset\":\"%Ld\", \"size\":\"%Ld\", \"file\": { \"filename\":\"%s\" } } }" + of...
2017 Mar 13
0
[PATCH 2/2] v2v: -i ova: Factor out the OVF parsing into a separate module.
...'%s' not found in the ova") filename - | Failure msg -> error (f_"%s") msg in - (* QEMU requires size aligned to 512 bytes. This is safe because - * tar also works with 512 byte blocks. - *) - let size = roundup64 size 512L in - let doc = [ + let qemu_uri = + if not partial then ( + filename + ) + else ( + let offset, size = + try find_file_in_tar ova filename + with + | Not_found -> +...
2016 Nov 12
0
[PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
..._found -> + error (f_"file '%s' not found in the ova") filename + in + (* QEMU requires size aligned to 512 bytes. This is safe because + * tar also works with 512 byte blocks. + *) + let size = roundup64 size 512L in + sprintf + "json:{ \"file\": { \"driver\":\"raw\", \"offset\":\"%Ld\", \"size\":\"%Ld\", \"file\": { \"filename\":\"%s\" } } }" + of...