bdev, gpt: change SPDK_ERRLOG to SPDK_TRACE_LOG

It should not print error if there is no GPT
signature

Change-Id: I6e5f8d31aed62dfb420f0ff0560bfbf8a7e8afb3
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/368476
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2017-07-07 09:38:22 +08:00 committed by Jim Harris
parent 7d101fe6c6
commit da1c360de1

View File

@ -33,13 +33,13 @@
#include "spdk_internal/event.h"
#include "spdk_internal/bdev.h"
#include "spdk_internal/log.h"
#include "gpt.h"
#include "spdk/event.h"
#include "spdk/endian.h"
#include "spdk/env.h"
#include "spdk/log.h"
#include "spdk/io_channel.h"
#define GPT_PRIMARY_PARTITION_TABLE_LBA 0x1
@ -202,15 +202,16 @@ spdk_gpt_check_mbr(struct spdk_gpt *gpt)
mbr = (struct spdk_mbr *)gpt->buf;
if (from_le16(&mbr->mbr_signature) != SPDK_MBR_SIGNATURE) {
SPDK_ERRLOG("Signature mismatch, provided=%x, expected=%x\n", from_le16(&mbr->disk_signature),
SPDK_MBR_SIGNATURE);
SPDK_TRACELOG(SPDK_TRACE_GPT_PARSE, "Signature mismatch, provided=%x,"
"expected=%x\n", from_le16(&mbr->disk_signature),
SPDK_MBR_SIGNATURE);
return -1;
}
to_le32(&expected_start_lba, GPT_PRIMARY_PARTITION_TABLE_LBA);
if (mbr->partitions[0].start_lba != expected_start_lba) {
SPDK_ERRLOG("start lba mismatch, provided=%u, expected=%u\n",
mbr->partitions[0].start_lba, expected_start_lba);
SPDK_TRACELOG(SPDK_TRACE_GPT_PARSE, "start lba mismatch, provided=%u, expected=%u\n",
mbr->partitions[0].start_lba, expected_start_lba);
return -1;
}
@ -251,7 +252,7 @@ spdk_gpt_parse(struct spdk_gpt *gpt)
rc = spdk_gpt_check_mbr(gpt);
if (rc) {
SPDK_ERRLOG("Failed to check mbr_info\n");
SPDK_TRACELOG(SPDK_TRACE_GPT_PARSE, "Failed to detect gpt in MBR\n");
return rc;
}
@ -269,3 +270,5 @@ spdk_gpt_parse(struct spdk_gpt *gpt)
return 0;
}
SPDK_LOG_REGISTER_TRACE_FLAG("gpt_parse", SPDK_TRACE_GPT_PARSE)