bdev/gpt: SPDK GUID should be in partition type
Fix the partition type GUID comparison to actually look at the partition type GUID, not the unique per-partition GUID, and fix the test to match. Change-Id: Ie64f1effcc75883f17ccf6240f6469161d2a5aa5 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/368606 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
6fb1ce422e
commit
1c9e37f71d
@ -330,7 +330,7 @@ vbdev_gpt_create_bdevs(struct spdk_gpt_bdev *gpt_bdev)
|
|||||||
uint64_t lba_start = from_le64(&p->starting_lba);
|
uint64_t lba_start = from_le64(&p->starting_lba);
|
||||||
uint64_t lba_end = from_le64(&p->ending_lba);
|
uint64_t lba_end = from_le64(&p->ending_lba);
|
||||||
|
|
||||||
if (!SPDK_GPT_UUID_EQUAL(&gpt->partitions[i].unique_partition_guid,
|
if (!SPDK_GPT_UUID_EQUAL(&gpt->partitions[i].part_type_guid,
|
||||||
&SPDK_GPT_PART_TYPE_GUID) ||
|
&SPDK_GPT_PART_TYPE_GUID) ||
|
||||||
lba_start == 0) {
|
lba_start == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -32,9 +32,9 @@ if [ $(uname -s) = Linux ] && [ -f /usr/sbin/sgdisk ]; then
|
|||||||
|
|
||||||
if [ -e /dev/nbd0 ]; then
|
if [ -e /dev/nbd0 ]; then
|
||||||
parted -s /dev/nbd0 mklabel gpt mkpart primary '0%' '50%' mkpart primary '50%' '100%'
|
parted -s /dev/nbd0 mklabel gpt mkpart primary '0%' '50%' mkpart primary '50%' '100%'
|
||||||
#change the GUID to SPDK GUID value
|
# change the partition type GUID to SPDK GUID value
|
||||||
/usr/sbin/sgdisk -u 1:$SPDK_GPT_UUID /dev/nbd0
|
/usr/sbin/sgdisk -t 1:$SPDK_GPT_UUID /dev/nbd0
|
||||||
/usr/sbin/sgdisk -u 2:$SPDK_GPT_UUID /dev/nbd0
|
/usr/sbin/sgdisk -t 2:$SPDK_GPT_UUID /dev/nbd0
|
||||||
fi
|
fi
|
||||||
killprocess $nbd_pid
|
killprocess $nbd_pid
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user