summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hartman <ghartman@google.com>2018-07-13 21:06:41 -0700
committerGreg Hartman <ghartman@google.com>2018-07-13 21:38:24 -0700
commit1aa8407cee1f325cbae905f827e95caf8e49598c (patch)
tree9f9de94a2977dd77c29c6f915a4ec33216b29b06
parent6acad7ccba01f94f075767c72f4d8de8335173f1 (diff)
downloadcuttlefish_common-pie-qpr3-s1-release.tar.gz
This ensures that all of the interrupts are initialized before Android begins to boot. ivshmem_common_realize calls ivshmem_recv_setup, which exits only when it gets the shared memory window. BUG: 111000656 Test: Boot completes, as does the e2e test Test: Debian 1:2.12~rc3+dfsg-1 Test: Debian 1:2.11+dfsg-1 Test: vsoc-0.7pre4 image (1:2.8+dfsg-6+deb9u4) Change-Id: I55d75e0b542aa96dcf7abc4a38226bc6305ac7fa (cherry picked from commit 85df3121a694d9f5f9c03010f85ce1803fdaa606)
-rw-r--r--host/libs/ivserver/qemu_client.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/host/libs/ivserver/qemu_client.cc b/host/libs/ivserver/qemu_client.cc
index c893f0f8..d584ccc2 100644
--- a/host/libs/ivserver/qemu_client.cc
+++ b/host/libs/ivserver/qemu_client.cc
@@ -63,15 +63,7 @@ bool QemuClient::PerformHandshake(const VSoCSharedMemory& shmem) {
return false;
}
- // 3. The number -1, accompanied by the file descriptor for the shared
- // memory.
- if (!SendSocketInfo(kSharedMem, shmem.SharedMemFD())) {
- LOG(ERROR) << "Failed to send Shared Memory socket: "
- << client_socket_->StrError();
- return false;
- }
-
- // 4. Connect notifications for existing other clients, if any. This is
+ // 3. Connect notifications for existing other clients, if any. This is
// a peer ID (number between 0 and 65535 other than the client's ID),
// repeated N times. Each repetition is accompanied by one file
// descriptor. These are for interrupting the peer with that ID using
@@ -86,7 +78,7 @@ bool QemuClient::PerformHandshake(const VSoCSharedMemory& shmem) {
}
}
- // 5. Interrupt setup. This is the client's own ID, repeated N times.
+ // 4. Interrupt setup. This is the client's own ID, repeated N times.
// Each repetition is accompanied by one file descriptor. These are
// for receiving interrupts from peers using vector 0,..,N-1, in
// order. If the client is configured for fewer vectors, it closes
@@ -100,6 +92,15 @@ bool QemuClient::PerformHandshake(const VSoCSharedMemory& shmem) {
}
}
+ // 5. The number -1, accompanied by the file descriptor for the shared
+ // memory.
+ if (!SendSocketInfo(kSharedMem, shmem.SharedMemFD())) {
+ LOG(ERROR) << "Failed to send Shared Memory socket: "
+ << client_socket_->StrError();
+ return false;
+ }
+
+
LOG(INFO) << "QEmu handshake completed.";
return true;
}