Move ivserver code to its home

BUG: 111000656
Test: mma
Change-Id: I7f935303ae9db4f64799446d2212010353776d58
diff --git a/host/commands/ivserver/Android.bp b/host/commands/ivserver/Android.bp
index a537742..4fc47a9 100644
--- a/host/commands/ivserver/Android.bp
+++ b/host/commands/ivserver/Android.bp
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2017 The Android Open Source Project
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -13,6 +13,50 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+cc_library_host_static {
+    name: "libivserver",
+    srcs: [
+        "hald_client.cc",
+        "ivserver.cc",
+        "options.cc",
+        "qemu_client.cc",
+        "vsocsharedmem.cc",
+    ],
+    header_libs: [
+        "cuttlefish_glog",
+    ],
+    shared_libs: [
+        "libbase",
+        "vsoc_lib",
+    ],
+    static_libs: [
+        "libjsoncpp",
+    ],
+    defaults: ["cuttlefish_host_only"],
+}
+
+cc_test_host {
+    name: "hald_client_test",
+    srcs: [
+        "hald_client_test.cc",
+    ],
+    header_libs: [
+        "cuttlefish_glog",
+    ],
+    shared_libs: [
+        "libcuttlefish_fs",
+        "cuttlefish_auto_resources",
+        "libbase",
+        "vsoc_lib",
+    ],
+    static_libs: [
+        "libivserver",
+        "libjsoncpp",
+        "libgmock",
+    ],
+    defaults: ["cuttlefish_host_only"],
+}
+
 cc_binary_host {
     name: "ivserver",
     srcs: [
diff --git a/host/libs/ivserver/hald_client.cc b/host/commands/ivserver/hald_client.cc
similarity index 98%
rename from host/libs/ivserver/hald_client.cc
rename to host/commands/ivserver/hald_client.cc
index 4b71be4..98a83f6 100644
--- a/host/libs/ivserver/hald_client.cc
+++ b/host/commands/ivserver/hald_client.cc
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "host/libs/ivserver/hald_client.h"
+#include "host/commands/ivserver/hald_client.h"
 
 #include <string>
 
diff --git a/host/libs/ivserver/hald_client.h b/host/commands/ivserver/hald_client.h
similarity index 96%
rename from host/libs/ivserver/hald_client.h
rename to host/commands/ivserver/hald_client.h
index 99b5fee..3b0fe2b 100644
--- a/host/libs/ivserver/hald_client.h
+++ b/host/commands/ivserver/hald_client.h
@@ -20,7 +20,7 @@
 #include <memory>
 
 #include "common/libs/fs/shared_fd.h"
-#include "host/libs/ivserver/vsocsharedmem.h"
+#include "host/commands/ivserver/vsocsharedmem.h"
 
 namespace ivserver {
 
diff --git a/host/libs/ivserver/hald_client_test.cc b/host/commands/ivserver/hald_client_test.cc
similarity index 97%
rename from host/libs/ivserver/hald_client_test.cc
rename to host/commands/ivserver/hald_client_test.cc
index 6ddf91b..ee65530 100644
--- a/host/libs/ivserver/hald_client_test.cc
+++ b/host/commands/ivserver/hald_client_test.cc
@@ -23,8 +23,8 @@
 #include <gtest/gtest.h>
 
 #include "common/libs/fs/shared_fd.h"
-#include "host/libs/ivserver/hald_client.h"
-#include "host/libs/ivserver/vsocsharedmem_mock.h"
+#include "host/commands/ivserver/hald_client.h"
+#include "host/commands/ivserver/vsocsharedmem_mock.h"
 
 using ::testing::_;
 using ::testing::DoAll;
diff --git a/host/libs/ivserver/ivserver.cc b/host/commands/ivserver/ivserver.cc
similarity index 95%
rename from host/libs/ivserver/ivserver.cc
rename to host/commands/ivserver/ivserver.cc
index e645501..ca274cc 100644
--- a/host/libs/ivserver/ivserver.cc
+++ b/host/commands/ivserver/ivserver.cc
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "host/libs/ivserver/ivserver.h"
+#include "host/commands/ivserver/ivserver.h"
 
 #include <sys/select.h>
 #include <algorithm>
@@ -21,8 +21,8 @@
 #include <glog/logging.h>
 
 #include "common/libs/fs/shared_select.h"
-#include "host/libs/ivserver/hald_client.h"
-#include "host/libs/ivserver/qemu_client.h"
+#include "host/commands/ivserver/hald_client.h"
+#include "host/commands/ivserver/qemu_client.h"
 
 namespace ivserver {
 
diff --git a/host/libs/ivserver/ivserver.h b/host/commands/ivserver/ivserver.h
similarity index 93%
rename from host/libs/ivserver/ivserver.h
rename to host/commands/ivserver/ivserver.h
index b8ee791..d28d14b 100644
--- a/host/libs/ivserver/ivserver.h
+++ b/host/commands/ivserver/ivserver.h
@@ -18,8 +18,8 @@
 #include <memory>
 
 #include "common/libs/fs/shared_fd.h"
-#include "host/libs/ivserver/options.h"
-#include "host/libs/ivserver/vsocsharedmem.h"
+#include "host/commands/ivserver/options.h"
+#include "host/commands/ivserver/vsocsharedmem.h"
 
 namespace ivserver {
 
diff --git a/host/commands/ivserver/main.cpp b/host/commands/ivserver/main.cpp
index 3ad5ed4..dae1c66 100644
--- a/host/commands/ivserver/main.cpp
+++ b/host/commands/ivserver/main.cpp
@@ -22,8 +22,8 @@
 #include <glog/logging.h>
 
 #include "host/libs/config/cuttlefish_config.h"
-#include "host/libs/ivserver/ivserver.h"
-#include "host/libs/ivserver/options.h"
+#include "host/commands/ivserver/ivserver.h"
+#include "host/commands/ivserver/options.h"
 
 DEFINE_int32(
     qemu_socket_fd, -1,
diff --git a/host/libs/ivserver/options.cc b/host/commands/ivserver/options.cc
similarity index 96%
rename from host/libs/ivserver/options.cc
rename to host/commands/ivserver/options.cc
index 56c3dce..0f19397 100644
--- a/host/libs/ivserver/options.cc
+++ b/host/commands/ivserver/options.cc
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "host/libs/ivserver/options.h"
+#include "host/commands/ivserver/options.h"
 
 namespace ivserver {
 
diff --git a/host/libs/ivserver/options.h b/host/commands/ivserver/options.h
similarity index 100%
rename from host/libs/ivserver/options.h
rename to host/commands/ivserver/options.h
diff --git a/host/libs/ivserver/qemu_client.cc b/host/commands/ivserver/qemu_client.cc
similarity index 98%
rename from host/libs/ivserver/qemu_client.cc
rename to host/commands/ivserver/qemu_client.cc
index e3a5cde..5448a9d 100644
--- a/host/libs/ivserver/qemu_client.cc
+++ b/host/commands/ivserver/qemu_client.cc
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "host/libs/ivserver/qemu_client.h"
+#include "host/commands/ivserver/qemu_client.h"
 
 #include <glog/logging.h>
 
diff --git a/host/libs/ivserver/qemu_client.h b/host/commands/ivserver/qemu_client.h
similarity index 97%
rename from host/libs/ivserver/qemu_client.h
rename to host/commands/ivserver/qemu_client.h
index 658b42c..54d2cf0 100644
--- a/host/libs/ivserver/qemu_client.h
+++ b/host/commands/ivserver/qemu_client.h
@@ -18,7 +18,7 @@
 #include <memory>
 
 #include "common/libs/fs/shared_fd.h"
-#include "host/libs/ivserver/vsocsharedmem.h"
+#include "host/commands/ivserver/vsocsharedmem.h"
 
 namespace ivserver {
 
diff --git a/host/libs/ivserver/shm_layout.txt b/host/commands/ivserver/shm_layout.txt
similarity index 100%
rename from host/libs/ivserver/shm_layout.txt
rename to host/commands/ivserver/shm_layout.txt
diff --git a/host/libs/ivserver/vsocsharedmem.cc b/host/commands/ivserver/vsocsharedmem.cc
similarity index 98%
rename from host/libs/ivserver/vsocsharedmem.cc
rename to host/commands/ivserver/vsocsharedmem.cc
index ab90fc2..eb448d8 100644
--- a/host/libs/ivserver/vsocsharedmem.cc
+++ b/host/commands/ivserver/vsocsharedmem.cc
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "host/libs/ivserver/vsocsharedmem.h"
+#include "host/commands/ivserver/vsocsharedmem.h"
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/host/libs/ivserver/vsocsharedmem.h b/host/commands/ivserver/vsocsharedmem.h
similarity index 100%
rename from host/libs/ivserver/vsocsharedmem.h
rename to host/commands/ivserver/vsocsharedmem.h
diff --git a/host/libs/ivserver/vsocsharedmem_mock.h b/host/commands/ivserver/vsocsharedmem_mock.h
similarity index 95%
rename from host/libs/ivserver/vsocsharedmem_mock.h
rename to host/commands/ivserver/vsocsharedmem_mock.h
index 5ce64ae..4ed1f16 100644
--- a/host/libs/ivserver/vsocsharedmem_mock.h
+++ b/host/commands/ivserver/vsocsharedmem_mock.h
@@ -17,7 +17,7 @@
 
 #include <gmock/gmock.h>
 
-#include "host/libs/ivserver/vsocsharedmem.h"
+#include "host/commands/ivserver/vsocsharedmem.h"
 
 namespace ivserver {
 namespace test {
diff --git a/host/libs/Android.bp b/host/libs/Android.bp
index 540b9b4..3363ed3 100644
--- a/host/libs/Android.bp
+++ b/host/libs/Android.bp
@@ -17,7 +17,6 @@
     "adb_connection_maintainer",
     "config",
     "monitor",
-    "ivserver",
     "vadb",
     "usbip",
     "vm_manager",
diff --git a/host/libs/ivserver/Android.bp b/host/libs/ivserver/Android.bp
deleted file mode 100644
index 93fa62e..0000000
--- a/host/libs/ivserver/Android.bp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-cc_library_host_static {
-    name: "libivserver",
-    srcs: [
-        "hald_client.cc",
-        "ivserver.cc",
-        "options.cc",
-        "qemu_client.cc",
-        "vsocsharedmem.cc",
-    ],
-    header_libs: [
-        "cuttlefish_glog",
-    ],
-    shared_libs: [
-        "libbase",
-        "vsoc_lib",
-    ],
-    static_libs: [
-        "libjsoncpp",
-    ],
-    defaults: ["cuttlefish_host_only"],
-}
-
-cc_test_host {
-    name: "hald_client_test",
-    srcs: [
-        "hald_client_test.cc",
-    ],
-    header_libs: [
-        "cuttlefish_glog",
-    ],
-    shared_libs: [
-        "libcuttlefish_fs",
-        "cuttlefish_auto_resources",
-        "libbase",
-        "vsoc_lib",
-    ],
-    static_libs: [
-        "libivserver",
-        "libjsoncpp",
-        "libgmock",
-    ],
-    defaults: ["cuttlefish_host_only"],
-}