9pfs: fix bug of reading host directory path
authorChulHo Song <ch81.song@samsung.com>
Tue, 20 Oct 2015 11:22:03 +0000 (20:22 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 13 Nov 2015 04:56:56 +0000 (13:56 +0900)
commitb14e65d1652c5c21b7ec6f6f30312f8d2ab5ec3a
treeb5882130c7077f26d7b80037854cadc2728906be
parent209d9a8db7b1d2194b923ba5810e83921d26a09d
9pfs: fix bug of reading host directory path

On Windows host, if the user selected the root directory as Host
Directory Sharing path, the emulator launching failure could occur.

There was a code that remove the last backslash of entered path on
Windows implementation. By the way, stat() function could not read the
path when root path like 'c:\' had entered and been removed the last
backslash(the result was 'c:').
So we change the code to remove the backslash only if the entered path
is not a root directory.

We should check the stat() working mechanism about reading pathes
including backslash on Windows later.

Change-Id: I7a155520af1f008f927e6dc67408e930c0f73ab1
Signed-off-by: ChulHo Song <ch81.song@samsung.com>
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
(cherry picked from commit 20be828e348259146208ee67f13c1b340a8eaff8)
hw/9pfs/virtio-9p-local-maru.c
hw/9pfs/virtio-9p.h