summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinhyung Choi <jinh0.choi@samsung.com>2016-01-06 21:35:39 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2016-01-07 20:08:47 +0900
commit51d3ee1ed5be4fc7a62d0855b6b03d2d35f4f7f5 (patch)
treecef84610f28a956091814d216a509ad11d3e7b32
parent653be6489c13e5e6fa4bdb538cec06c03b8a8256 (diff)
downloadqemu-51d3ee1ed5be4fc7a62d0855b6b03d2d35f4f7f5.tar.gz
qemu-51d3ee1ed5be4fc7a62d0855b6b03d2d35f4f7f5.tar.bz2
qemu-51d3ee1ed5be4fc7a62d0855b6b03d2d35f4f7f5.zip
hds: change the policy from unmodifiable to hidden
ECP UI did not allow unmount when unmodifiable level is chosen. But, it is changed to hide. Change-Id: Ib33a61a3a0217f015676cd76e10878799818a4d7 Signed-off-by: Jinhyung Choi <jinh0.choi@samsung.com>
-rw-r--r--tizen/src/ecs/ecs_hds.c6
-rw-r--r--tizen/src/util/hds.c14
-rw-r--r--tizen/src/util/hds.h11
3 files changed, 17 insertions, 14 deletions
diff --git a/tizen/src/ecs/ecs_hds.c b/tizen/src/ecs/ecs_hds.c
index 65747b2a66..7faf988b5f 100644
--- a/tizen/src/ecs/ecs_hds.c
+++ b/tizen/src/ecs/ecs_hds.c
@@ -102,7 +102,7 @@ static void ecs_hds_do_umount(char* cmd, type_group group, type_action action, c
{
int level = 0;
int len = 0;
- int tag_level = 0;
+ enum hds_level tag_level = 0;
char token[] = "\n";
char* tag;
char* level_token;
@@ -261,7 +261,7 @@ void msgproc_injector_do_hds(char* cat, type_action action, const char* data)
char msg [OUT_BUF_SIZE];
char *host;
char *guest;
- int level = 0;
+ enum hds_level level;
LOG_INFO("hds status is %d, %s\n", action, data);
switch (action) {
@@ -275,7 +275,7 @@ void msgproc_injector_do_hds(char* cat, type_action action, const char* data)
break;
}
- if (!add_hds_list(DEFAULT_STATIC_HDS_ID, entry->path, DEFAULT_HDS_GUEST_PATH, 0)) {
+ if (!add_hds_list(DEFAULT_STATIC_HDS_ID, entry->path, DEFAULT_HDS_GUEST_PATH, hds_level_normal)) {
LOG_WARNING("cannot add into hds list.\n");
break;
}
diff --git a/tizen/src/util/hds.c b/tizen/src/util/hds.c
index 434d3eec65..5eed1cb6f4 100644
--- a/tizen/src/util/hds.c
+++ b/tizen/src/util/hds.c
@@ -41,7 +41,7 @@ typedef struct hds_list {
char *id;
char *host;
char *guest;
- int level; // 0: normal, 1: unmodifiable
+ enum hds_level level;
QTAILQ_ENTRY(hds_list) next;
} hds_list;
@@ -87,7 +87,7 @@ static char* find_new_id(void)
return NULL;
}
-bool add_hds_list(const char* id, const char* host, const char* guest, int level)
+bool add_hds_list(const char* id, const char* host, const char* guest, enum hds_level level)
{
hds_list* list;
@@ -112,16 +112,14 @@ bool add_hds_list(const char* id, const char* host, const char* guest, int level
list->host = strdup(host);
list->guest = strdup(guest);
- if (level != 0) {
- list->level = 1;
- }
+ list->level = level;
QTAILQ_INSERT_TAIL(&lists, list, next);
return true;
}
-char* new_hds_list(const char* host, const char* guest, int level)
+char* new_hds_list(const char* host, const char* guest, enum hds_level level)
{
char* id = find_new_id();
if (id == NULL) {
@@ -181,14 +179,14 @@ char* get_guest_path_by_id(const char* id)
return NULL;
}
-int get_hds_level_by_id(const char* id)
+enum hds_level get_hds_level_by_id(const char* id)
{
LOG_TRACE("get_hds_level_by_id request: %s\n", id);
hds_list *list = find_list(id);
if (list != NULL) {
return list->level;
}
- return 0;
+ return hds_level_normal;
}
bool is_hds_attached(const char* id)
diff --git a/tizen/src/util/hds.h b/tizen/src/util/hds.h
index d0acb7a80c..af4141ab3b 100644
--- a/tizen/src/util/hds.h
+++ b/tizen/src/util/hds.h
@@ -39,13 +39,18 @@
#include "qemu-common.h"
-bool add_hds_list(const char* id, const char* host, const char* guest, int level);
-char* new_hds_list(const char* host, const char* guest, int level);
+enum hds_level {
+ hds_level_normal = 0,
+ hds_level_hidden
+};
+
+bool add_hds_list(const char* id, const char* host, const char* guest, enum hds_level level);
+char* new_hds_list(const char* host, const char* guest, enum hds_level level);
void remove_hds_list(const char* id);
char* get_host_path_by_id(const char* id);
char* get_guest_path_by_id(const char* id);
-int get_hds_level_by_id(const char* id);
+enum hds_level get_hds_level_by_id(const char* id);
bool is_hds_attached(const char* id);
void set_hds_attached(const char* id, bool attached);