Skip to content

Add support for GPT partition schema#288

Merged
Ivan-Velickovic merged 1 commit into
mainfrom
gpt_partition_support
Mar 27, 2025
Merged

Add support for GPT partition schema#288
Ivan-Velickovic merged 1 commit into
mainfrom
gpt_partition_support

Conversation

@terryzbai

@terryzbai terryzbai commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

The changes in block virtualiser check if the first sector is a Protective MBR in a GPT disk, and then accordingly initialise the disk. The main workflow is:

The changes in the block virtualiser check If the first sector is a Protective MBR sector, then request the following blocks containing partition table (block 1 to 4 in most cases) and the last blocks containing backup partition header and table (block -5 to -1 in most cases). After receiving all requested blocks, validate the partition header and table as well as backup partition header and table, and check if two partition headers match.

The script mkvirtdisk creates a MBR or GPT disk according to the last parameter.

@Ivan-Velickovic

Copy link
Copy Markdown
Collaborator

If you do git commit --amend -s and then git push -f it should fix the DCO check.

@terryzbai terryzbai force-pushed the gpt_partition_support branch 2 times, most recently from b7444f8 to 73f6ac1 Compare November 14, 2024 02:28
@midnightveil

midnightveil commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

Would it be possible to either cherry pick this commit into this branch or merge it in first? This separates the functionality of reading the MBR from the main virtualiser logic (something more necessary for hotplugging) but also makes PRs like this less invasive (as most of this code really isn't core to the virtualiser).

@terryzbai terryzbai force-pushed the gpt_partition_support branch from d01d25e to 14cf83f Compare November 17, 2024 23:54
@terryzbai

Copy link
Copy Markdown
Contributor Author

Would it be possible to either cherry pick this commit into this branch or merge it in first? This separates the functionality of reading the MBR from the main virtualiser logic (something more necessary for hotplugging) but also makes PRs like this less invasive (as most of this code really isn't core to the virtualiser).

Done. Would you like to test it with your hotplugging features?

@midnightveil midnightveil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Would you like to test it with your hotplugging features?

That might take a few days (I'm busy with end of term assignments), and most of this shouldn't affect hotplugging itself — it was 90% just moving to another file. So nah, not a blocker, and if there's issues with hotplugging I can resolve them later in the hotplugging PR.

Comment thread blk/components/virt.c Outdated
Comment thread blk/components/virt.h Outdated
Comment thread blk/components/blk_components.mk Outdated
@terryzbai terryzbai force-pushed the gpt_partition_support branch from 8e3fec9 to ab708d4 Compare March 26, 2025 06:20
Comment thread blk/components/partitioning.c Outdated
Comment thread blk/components/partitioning.c Outdated
Comment thread blk/components/partitioning.c Outdated
Comment thread blk/components/virt.c Outdated
Comment thread blk/components/virt.h Outdated
@Ivan-Velickovic Ivan-Velickovic force-pushed the gpt_partition_support branch 5 times, most recently from 027dc91 to 4915890 Compare March 27, 2025 03:48
The changes in block virtualiser check if the first sector is a Protective MBR
in a GPT disk, and then accordingly initialise the disk.

The script `mkvirtdisk` creates a MBR or GPT disk according to the last parameter.

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
@Ivan-Velickovic Ivan-Velickovic merged commit 41705e6 into main Mar 27, 2025
@Ivan-Velickovic Ivan-Velickovic deleted the gpt_partition_support branch March 27, 2025 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants