diff --git a/1.1/libboot_control_qti/libboot_control_qti.cpp b/1.1/libboot_control_qti/libboot_control_qti.cpp
index d0f3045..99b15e8 100644
--- a/1.1/libboot_control_qti/libboot_control_qti.cpp
+++ b/1.1/libboot_control_qti/libboot_control_qti.cpp
@@ -27,6 +27,7 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+//#define LOG_NDEBUG 0
 #define LOG_TAG "bootcontrolhal"
 
 #include <libboot_control_qti.h>
@@ -47,6 +48,7 @@
 #include <limits.h>
 #include <cutils/properties.h>
 #include <gpt-utils.h>
+#include <bootloader_message/bootloader_message.h>
 #include <libboot_control/libboot_control.h>
 
 #define BOOTDEV_DIR "/dev/block/bootdevice/by-name"
@@ -425,13 +427,13 @@
 	char platform[256];
 	property_get(BOARD_PLATFORM_PROP , platform, "");
 	if (!strncmp(platform, GVMQ_PLATFORM, strlen(GVMQ_PLATFORM)))
-		mPlatform = true;
+		mGvmqPlatform = true;
 	return InitMiscVirtualAbMessageIfNeeded();
 }
 
 unsigned get_number_slots()
 {
-	if(mPlatform)
+	if (mGvmqPlatform)
 		return 2;
 
 	struct dirent *de = NULL;
@@ -490,8 +492,35 @@
 	return 0;
 }
 
-int mark_boot_successful()
-{
+int mark_boot_successful(){
+	if (mGvmqPlatform) {
+		std::string err;
+		std::string misc_blk_device = get_bootloader_message_blk_device(&err);
+		if (misc_blk_device.empty()) {
+			ALOGE("Could not find bootloader message block device: %s", err.c_str());
+			return -1;
+		}
+		bootloader_message boot;
+		if (!read_bootloader_message_from(&boot, misc_blk_device, &err)) {
+			ALOGE(" Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV(" bootloader_message is : boot.reserved[0] = %c, boot.reserved[1] = %c",
+					boot.reserved[0], boot.reserved[1]);
+		boot.reserved[2] = 'y';
+		if (!write_bootloader_message_to(boot, misc_blk_device, &err)) {
+			ALOGE("Failed to write to %s  because : %s", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		bootloader_message boot_verify;
+		if (!read_bootloader_message_from(&boot_verify, misc_blk_device, &err)) {
+			ALOGE("Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV(" bootloader_message : boot_verify.reserved[0] = %c, boot_verify.reserved[1] = %c,boot_verify.reserved[2] = %c",
+				boot_verify.reserved[0],boot_verify.reserved[1], boot_verify.reserved[2]);
+	}
+
 	unsigned cur_slot = 0;
 	cur_slot = get_current_slot();
 	if (update_slot_attribute(slot_suffix_arr[cur_slot],
@@ -506,6 +535,41 @@
 
 int set_active_boot_slot(unsigned slot)
 {
+	if (mGvmqPlatform) {
+		std::string err;
+		std::string misc_blk_device = get_bootloader_message_blk_device(&err);
+		if (misc_blk_device.empty()) {
+			ALOGE("Could not find bootloader message block device: %s", err.c_str());
+			return -1;
+		}
+		unsigned current_slot = get_current_slot();
+		uint32_t num_slots = get_number_slots();
+		if ((num_slots < 1) || (current_slot > num_slots - 1)) {
+			ALOGE("Invalid slot number");
+			return -1;
+		}
+		bootloader_message boot;
+		if(current_slot == 0)
+			boot.reserved[0] = 'a';
+		else
+			boot.reserved[0] = 'b';
+		if(slot == 0)
+			boot.reserved[1] = 'a';
+		else
+			boot.reserved[1] = 'b';
+		boot.reserved[2] = '\0';
+		if (!write_bootloader_message_to(boot, misc_blk_device, &err)) {
+			ALOGE("Failed to write to %s  because : %s", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		bootloader_message boot_verify;
+		if (!read_bootloader_message_from(&boot_verify, misc_blk_device, &err)) {
+			ALOGE("Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV("bootloader_message is : boot_verify.reserved[0] = %c, boot_verify.reserved[1] = %c,boot_verify.reserved[2] = %c",
+			boot_verify.reserved[0],boot_verify.reserved[1], boot_verify.reserved[2]);
+	}
 	map<string, vector<string>> ptn_map;
 	vector<string> ptn_vec;
 	const char ptn_list[][MAX_GPT_NAME_SIZE] = { AB_PTN_LIST };
@@ -597,7 +661,6 @@
 	ALOGE("%s: Failed to mark slot unbootable", __func__);
 	return -1;
 }
-
 int is_slot_bootable(unsigned slot)
 {
 	int attr = 0;
diff --git a/1.1/libboot_control_qti/libboot_control_qti.h b/1.1/libboot_control_qti/libboot_control_qti.h
index 2b1d18d..c669a0e 100644
--- a/1.1/libboot_control_qti/libboot_control_qti.h
+++ b/1.1/libboot_control_qti/libboot_control_qti.h
@@ -49,4 +49,4 @@
 bool set_snapshot_merge_status(MergeStatus status);
 MergeStatus get_snapshot_merge_status();
 
-bool mPlatform = false;
+bool mGvmqPlatform = false;
