bdev/gpt: fix UUID/GUID typo

These are UEFI-style GUIDs in little endian byte order, not standard
UUIDs.

Change-Id: I4d61afa2901830c784c24a5e039bba1d98f32e62
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368609
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
This commit is contained in:
Daniel Verkamp 2017-07-07 10:51:47 -07:00
parent 1c9e37f71d
commit 17c5ef7ab0
4 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@
#define SPDK_GPT_PART_TYPE_GUID SPDK_GPT_GUID(0x7c5222bd, 0x8f5d, 0x4087, 0x9c00, 0xbf9843c7b58c)
#define SPDK_GPT_BUFFER_SIZE 32768 /* 32KB */
#define SPDK_GPT_UUID_EQUAL(x,y) (memcmp(x, y, sizeof(struct spdk_gpt_guid)) == 0)
#define SPDK_GPT_GUID_EQUAL(x,y) (memcmp(x, y, sizeof(struct spdk_gpt_guid)) == 0)
struct spdk_gpt {
unsigned char *buf;

View File

@ -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_end = from_le64(&p->ending_lba);
if (!SPDK_GPT_UUID_EQUAL(&gpt->partitions[i].part_type_guid,
if (!SPDK_GPT_GUID_EQUAL(&gpt->partitions[i].part_type_guid,
&SPDK_GPT_PART_TYPE_GUID) ||
lba_start == 0) {
continue;

View File

@ -32,7 +32,7 @@ config_params='--enable-debug --enable-werror'
export UBSAN_OPTIONS='halt_on_error=1:print_stacktrace=1:abort_on_error=1'
export SPDK_GPT_UUID=`grep SPDK_GPT_PART_TYPE_GUID $rootdir/lib/bdev/gpt/gpt.h \
export SPDK_GPT_GUID=`grep SPDK_GPT_PART_TYPE_GUID $rootdir/lib/bdev/gpt/gpt.h \
| awk -F "(" '{ print $2}' | sed 's/)//g' \
| awk -F ", " '{ print $1 "-" $2 "-" $3 "-" $4 "-" $5}' | sed 's/0x//g'`

View File

@ -33,8 +33,8 @@ if [ $(uname -s) = Linux ] && [ -f /usr/sbin/sgdisk ]; then
if [ -e /dev/nbd0 ]; then
parted -s /dev/nbd0 mklabel gpt mkpart primary '0%' '50%' mkpart primary '50%' '100%'
# change the partition type GUID to SPDK GUID value
/usr/sbin/sgdisk -t 1:$SPDK_GPT_UUID /dev/nbd0
/usr/sbin/sgdisk -t 2:$SPDK_GPT_UUID /dev/nbd0
/usr/sbin/sgdisk -t 1:$SPDK_GPT_GUID /dev/nbd0
/usr/sbin/sgdisk -t 2:$SPDK_GPT_GUID /dev/nbd0
fi
killprocess $nbd_pid
fi