search for: part_typ

Displaying 20 results from an estimated 42 matches for "part_typ".

Did you mean: part_type
2015 Mar 17
4
[PATCH] New API: part_get_part_type for showing partition type
...+ /* Notes: * * Parted 1.9 sends error messages to stdout, hence use of the @@ -1022,3 +1026,111 @@ do_part_get_name (const char *device, int partnum) reply_with_error ("cannot get the partition name from '%s' layouts", parttype); return NULL; } + +char * +do_part_get_part_type (const char *device, int partnum) +{ + CLEANUP_FREE char *parttype; + char *part_type; + + if (partnum <= 0) { + reply_with_error ("partition number must be >= 1"); + return NULL; + } + + parttype = do_part_get_parttype (device); + if (parttype == NULL) + return NULL...
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
...e. - */ - size_t start = 0, end = 0, row; - for (row = 0; lines[row] != NULL; ++row) - if (STRPREFIX (lines[row], "Number")) { - start = row+1; - break; + if (STRPREFIX (type_temp, "primary")) { + r->guestfs_int_partition_list_val[i].part_type = strdup("primary"); + if (r->guestfs_int_partition_list_val[i].part_type == NULL) + goto error4; + } else if (STRPREFIX (type_temp, "logical")) { + r->guestfs_int_partition_list_val[i].part_type = strdup("logical"); + if (r-&g...
2015 Mar 23
0
Re: [PATCH] New API: part_get_part_type for showing partition type
...nds error messages to stdout, hence use of the > @@ -1022,3 +1026,111 @@ do_part_get_name (const char *device, int partnum) > reply_with_error ("cannot get the partition name from '%s' layouts", parttype); > return NULL; > } > + > +char * > +do_part_get_part_type (const char *device, int partnum) > +{ > + CLEANUP_FREE char *parttype; > + char *part_type; > + > + if (partnum <= 0) { > + reply_with_error ("partition number must be >= 1"); > + return NULL; > + } > + > + parttype = do_part_get_parttype (...
2015 Mar 13
0
Re: [PATCH] part-list: add support for show partition type
...end = 0, row; > > - for (row = 0; lines[row] != NULL; ++row) > - if (STRPREFIX (lines[row], "Number")) { > - start = row+1; > - break; > + if (STRPREFIX (type_temp, "primary")) { > + r->guestfs_int_partition_list_val[i].part_type = strdup("primary"); > + if (r->guestfs_int_partition_list_val[i].part_type == NULL) > + goto error4; > + } else if (STRPREFIX (type_temp, "logical")) { > + r->guestfs_int_partition_list_val[i].part_type = strdup("logical"...
2015 Mar 24
2
Re: [PATCH] New API: part_get_part_type for showing partition type
> -----Original Message----- > From: Richard W.M. Jones [mailto:rjones@redhat.com] > Sent: Monday, March 23, 2015 9:29 PM > To: Chen, Hanxiao/陈 晗霄 > Cc: libguestfs@redhat.com > Subject: Re: [Libguestfs] [PATCH] New API: part_get_part_type for showing partition > type > > On Tue, Mar 17, 2015 at 02:45:46AM -0400, Chen Hanxiao wrote: > > This patch will add support for getting partition type > > of a partiton numbered device. > > > > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> >...
2015 Mar 24
1
[PATCH 2/2] New API: part_get_part_type for showing partition type
...arted.c index 64a7d3c..3aac102 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -1028,3 +1028,109 @@ do_part_get_name (const char *device, int partnum) reply_with_error ("cannot get the partition name from '%s' layouts", parttype); return NULL; } + +char * +do_part_get_part_type (const char *device, int partnum) +{ + CLEANUP_FREE char *parttype; + char *part_type; + + parttype = do_part_get_parttype (device); + if (parttype == NULL) + return NULL; + + /* machine parseable output by 'parted -m' did not provide + * partition type info. + * Use traditiona...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
Instead of parsing 'parted' output OCaml implementation relies on the following facts: 1. The function is applicable for MBR partitions only (as noted in documentation and as function name suggests). 2. An attempt to call the function for non-MBR partition fails with "part_get_mbr_part_type can only be used on MBR Partitions" error and NULL is returned. 3. MBR partition table can hold up to 4 "primary" partitions. 4. Partition with number >= 5 is logical partition. 5. Extnded partition number is <= 4 and has MBR id 0x05 or 0x0f (http://thestarman.pcministry.com/a...
2015 Jul 17
1
[PATCH] daemon: add a space after func/macro to fit code-style
...uot;-f"); /* For GFS, GFS2, assume a single node. */ if (STREQ (fstype, "gfs") || STREQ (fstype, "gfs2")) { diff --git a/daemon/parted.c b/daemon/parted.c index cb6c486..b7f560c 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -1092,7 +1092,7 @@ do_part_get_mbr_part_type (const char *device, int partnum) char temp_type[16] = {'\0'}; for (i = 0, row = start; row < end; ++i, ++row) { if (STREQ (parttype, "gpt")) { - memcpy (temp_type, "primary", strlen("primary")); + memcpy (temp_type, "primary&quot...
2015 Mar 24
4
[PATCH 0/2] New API: part_get_part_type
Chen Hanxiao (2): parted: introduce enum for whether parted has option -m New API: part_get_part_type for showing partition type daemon/parted.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++----- generator/actions.ml | 18 +++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 143 insertions(+), 13 deletions(-) -- 2.1.0
2018 May 10
2
[PATCH libldm v3 0/2] Make libldm to parse and return volume GUID.
v2: wrap commit message, "PATCH libldm" prefix. v3: correctly initialize and free GLib resources. The result of this patch might be used by libguestfs to return drive mappings for LDM volumes. Note, that "show volume" ldmtool command already returns hint which is a drive letter assigned by Windows to corresponding volume. But it is not reliable source of information. More
2018 May 14
3
[PATCH libldm v4 0/3] Make libldm to parse and return volume GUID.
v2: wrap commit message, "PATCH libldm" prefix. v3: correctly initialize and free GLib resources. v4: gtk-doc is updated to reflect presence of new volume GUID field. The result of this patch might be used by libguestfs to return drive mappings for LDM volumes. Note, that "show volume" ldmtool command already returns hint which is a drive letter assigned by Windows to
2014 Oct 08
0
[PATCH V5 4/4] resize: test: add support for resizing extended and logical partitions
...+75,6 @@ if (rand () <= 0.5) { # an extended partition (#4) and zero or more logical partitions. my $nr_parts = 1 + int (rand (7)); -# XXX Temporarily restriction XXX -# Currently virt-resize is broken when dealing with any extended -# partition, so don't test this for the moment. -if ($part_type eq "mbr" && $nr_parts >= 4) { - $nr_parts = 3; -} - # expand (1) or shrink (0) my $expand = 0; if (rand () >= 0.2) { @@ -120,31 +113,16 @@ my $i; for ($i = 1; $i <= $nr_parts; ++$i) { $parts[$i] = { name => "sda".$i, resize => 0 }; - if (...
2018 Jan 28
9
guestfs_list_filesystems: skip block devices which cannot hold file system
Initial discussion is here: https://www.redhat.com/archives/libguestfs/2018-January/msg00188.html. v2 was posted here: https://www.redhat.com/archives/libguestfs/2018-January/msg00246.html. v3 comparing to v2 is just a rebase with slightly changed commits comments.
2018 Jan 25
2
[PATCH v2 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
Instead of parsing 'parted' output OCaml implementation relies on the following facts: 1. The function is applicable for MBR partitions only (as noted in documentation and as function name suggests). 2. An attempt to call the function for non-MBR partition fails with "part_get_mbr_part_type can only be used on MBR Partitions" error and NULL is returned. 3. MBR partition table can hold up to 4 "primary" partitions. 4. Partition with number >= 5 is logical partition 5. Extnded partition number is <= 4 and has MBR id 0x05 or 0x0f (http://thestarman.pcministry.com/as...
2014 Sep 22
1
Re: [PATCH v3 3/7] resize: add function find_partitions
...ze.ml > index 8f2105c..cfd02fc 100644 > --- a/resize/resize.ml > +++ b/resize/resize.ml > @@ -446,14 +446,15 @@ read the man page virt-resize(1). > | MBR_ID _ | GPT_Type _ | No_ID -> false > in > > - let partitions : partition list = > + let find_partitions part_type = > let parts = Array.to_list (g#part_list "/dev/sda") in > > - if List.length parts = 0 then > - error (f_"the source disk has no partitions"); > - > (* Filter out logical partitions. See note above. *) > let parts = > + m...
2018 Apr 27
4
[PATCH v5 0/3] libguestfs: guestfs_list_filesystems: skip block devices which cannot hold file system
This patch series: 1. Addresses comments from last review: part_get_mbr_part_type doesn't break original implementation in C. 2. Rebased on top of master and little bit refactored for readability. Mykola Ivanets (1): tests: md: Test guestfish list-filesystems command skips partitioned md devices. Nikolay Ivanets (2): daemon: Reimplement 'part_get_mbr_part_type...
2015 Mar 30
1
[PATCH RFC] resize: add p_mbr_p_type as member of type partition
Add p_mbr_p_type as member of type partition to describe mbr partition type. Currently we use: List.filter (fun p -> parttype <> MBR || p.G.part_num <= 4_l) to filter out logical partitions. Commit 0c396a4bce578486dfc4a38e1f8c47fd5c2836ea introduce API part_get_mbr_part_type, we could use this to know the part_type. Furthermore, we could also use p_mbr_p_type for resizing logical partitions. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- resize/resize.ml | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 de...
2014 Sep 22
13
[PATCH v3 0/7] add support to resize MBR logical partitions
...the content of logical partitions 4. refactor to make logical partitions a seperate list Hu Tao (7): resize: introduce partition_type resize: simplify the code to filter parts resize: add function find_partitions resize: add function calculate_target_partitions resize: add function mbr_part_type resize: add partition type LogicalPartition resize: add support to resize logical partitions resize/resize.ml | 145 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 110 insertions(+), 35 deletions(-) -- 1.9.3
2018 May 01
9
[PATCH v6 0/7] daemon: list_filesystems: filter out block devices which cannot hold filesystem
...vices. daemon: list-filesystems: Change the way we filter out LDM partitions. daemon: list-filesystems: Filter out Microsoft Reserved and Windows Snapshot partitions. daemon: list-ilesystems: Filter out MBR extended partitions. Nikolay Ivanets (1): daemon: Reimplement 'part_get_mbr_part_type' API in OCaml. daemon/listfs.ml | 127 +++++++++++++----------- daemon/parted.c | 106 -------------------- daemon/parted.ml | 13 +++ generator/actions_core.ml | 1 + tests/md/Makefile.am...
2014 Oct 08
6
[PATCH V5 0/4] virt-resize: add support for resizing logical
...n expanding a logical partition (this problem can be reproduced in v4 by only expanding a logical partition, without resizing any other partitions) 3. update the test script to support logical partitions and extended partition 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 calculate_target_partitions 4. remove the code to restart...