search for: create_mbr_partition_table_entry

Displaying 15 results from an estimated 15 matches for "create_mbr_partition_table_entry".

2019 Jan 20
1
[PATCH nbdkit] partitioning: Support MBR logical partitions.
An evolution of the patch I posted yesterday to qemu-devel (https://www.mail-archive.com/qemu-devel@nongnu.org/msg588920.html) which (a) works and (b) has a test. Rich.
2019 Jan 21
0
[PATCH nbdkit v2 1/4] partitioning plugin: Support MBR logical partitions.
...e MBR code, but - * are not meant to be called from the main plugin. +/* Internal function for creating a single MBR PTE. The GPT code + * calls this for creating the protective MBR. */ -extern void create_mbr_partition_table (unsigned char *out) - __attribute__((__nonnull__ (1))); extern void create_mbr_partition_table_entry (const struct region *, bool bootable, int partition_id, unsigned char *) __attribute__((__nonnull__ (1, 4))); + +/* Create MBR or GPT layout. */ +extern void create_mbr_layout (void); extern void crea...
2019 Jan 21
8
[PATCH nbdkit v2 0/4] Support MBR logical partitions.
This is a revised version of the two series previously posted here: https://www.redhat.com/archives/libguestfs/2019-January/msg00137.html https://www.redhat.com/archives/libguestfs/2019-January/msg00139.html There have been many smaller changes but the highlights are: - Using SECTOR_SIZE instead of hard-coding 512 everywhere. - Additional safety checks that the EBR chain doesn't jump
2018 Sep 17
0
[PATCH nbdkit v3 3/3] Add partitioning plugin.
...rt + 1); + if (i+1 < nr_regions) { + assert (regions[i].end + 1 == regions[i+1].start); + } + } + + return create_partition_table (); +} + +/* Create the partition table (and for GPT the secondary/backup). */ +static void create_mbr_partition_table (unsigned char *out); +static void create_mbr_partition_table_entry (const struct region *, int bootable, int partition_id, unsigned char *); +static void create_gpt_partition_header (const void *pt, int is_primary, unsigned char *out); +static void create_gpt_partition_table (unsigned char *out); +static void create_gpt_partition_table_entry (const struct region *...
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...te__((__nonnull__ (1, 2))); /* Internal functions for creating MBR and GPT layouts. These are * published here because the GPT code calls into the MBR code, but * are not meant to be called from the main plugin. */ -extern void create_mbr_partition_table (unsigned char *out); -extern void create_mbr_partition_table_entry (const struct region *, int bootable, int partition_id, unsigned char *); +extern void create_mbr_partition_table (unsigned char *out) + __attribute__((__nonnull__ (1))); +extern void create_mbr_partition_table_entry (const struct region *, + int bootab...
2018 Sep 17
4
[PATCH nbdkit 0/3] Add partitioning plugin.
nbdkit partitioning boot.img swap.img root.img ... creates a virtual disk by adding a partition table. In ancient times Xen used to do this. Rich.
2018 Sep 17
7
[PATCH nbdkit v3 0/3] Add partitioning plugin.
The partitioning plugin patch is the same (except for rebasing). However I have changed the first two patches based on feedback received. In particular this fixes a very serious bug found by Eric Blake in the current truncate filter. Rich.
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here: https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html In v2 I have provided two patches: The first patch extends attribute((nonnull)) to most internal functions, but not to the external API. The second patch uses a macro so that attribute((format)) is only used in the public API on GCC or Clang. At least in theory these headers could be used by a C compiler which
2020 Apr 15
0
[PATCH nbdkit 4/9] common/regions: Use new vector type to store the list of regions.
...ut (void) */ eptr0 = find_ebr_region (3, &j); region.start = eptr0->start; - region.end = virtual_size (&regions) - 1; /* to end of disk */ + region.end = virtual_size (&the_regions) - 1; /* to end of disk */ region.len = region.end - region.start + 1; create_mbr_partition_table_entry (&region, false, 0xf, &primary[0x1ee]); @@ -144,8 +144,8 @@ find_file_region (size_t i, size_t *j) { const struct region *region; - for (; *j < nr_regions (&regions); ++(*j)) { - region = get_region (&regions, *j); + for (; *j < nr_regions (&the_regions); ++(*...
2019 Feb 22
0
[PATCH nbdkit v3 4/4] Add linuxdisk plugin.
...reate_gpt_partition_header (disk, disk->pt, false, disk->secondary_header); + + return 0; +} + +static void +chs_too_large (unsigned char *out) +{ + const int c = 1023, h = 254, s = 63; + + out[0] = h; + out[1] = (c & 0x300) >> 2 | s; + out[2] = c & 0xff; +} + +static void +create_mbr_partition_table_entry (const struct region *region, + bool bootable, int partition_id, + unsigned char *out) +{ + uint64_t start_sector, nr_sectors; + uint32_t u32; + + assert (IS_ALIGNED (region->start, SECTOR_SIZE)); + + start_sector = region-&gt...
2019 Feb 19
0
[PATCH nbdkit 4/4] Add linuxdisk plugin.
...reate_gpt_partition_header (disk, disk->pt, false, disk->secondary_header); + + return 0; +} + +static void +chs_too_large (unsigned char *out) +{ + const int c = 1023, h = 254, s = 63; + + out[0] = h; + out[1] = (c & 0x300) >> 2 | s; + out[2] = c & 0xff; +} + +static void +create_mbr_partition_table_entry (const struct region *region, + bool bootable, int partition_id, + unsigned char *out) +{ + uint64_t start_sector, nr_sectors; + uint32_t u32; + + assert (IS_ALIGNED (region->start, SECTOR_SIZE)); + + start_sector = region-&gt...
2019 Feb 22
5
[PATCH nbdkit v3 0/4] Add linuxdisk plugin.
For v3 I reimplemented this using mke2fs -d. This obviously makes the implementation a whole lot simpler, but cannot support multiple directory merging. Patches 1-3 are the same as before. I've also reproduced the notes from v2 below. v2: - Fix inconsistent tab/space. - All 3 plugins now contain a block of text pointing to the other 2 plugins. - TMDIR -> TMPDIR - Unlink the
2019 Feb 19
6
[PATCH nbdkit v2 0/5] Add linuxdisk plugin.
Another interesting thing you can do with this plugin: https://rwmj.wordpress.com/2019/02/19/nbdkit-linuxdisk-plugin/ v2: - Fix inconsistent tab/space. - All 3 plugins now contain a block of text pointing to the other 2 plugins. - TMDIR -> TMPDIR - Unlink the temporary file and other cleanups along error paths. - fclose -> pclose, and check the return value for errors. -
2019 Feb 19
7
[PATCH nbdkit 0/4] New plugin: Add linuxdisk plugin.
Turns out Japanese trains are good for coding! In supermin we have a bunch of code to create the libguestfs appliance. It creates it directly using libext2fs (part of e2fsprogs). We can use the same technique to create ext2 virtual disks in nbdkit, which is what this new plugin does. Why a new plugin instead of modifying the floppy plugin? See the 4/4 commit message for an explanation. The
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated! The basic purpose of the patch series is to set $nbdkit_stdio_safe to "0" or "1" in sh and eval plugin scripts. To do that, I ended up adding a nicer way to manipulate environ lists, and to do that, I ended up adding a whole generic vector implementation which is applicable in a lot of different places.