Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | sys_util: make UnixSeqpacket::recv use libc::recv interguest | Alyssa Ross | 2020-07-06 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's very surprising that a method called "recv" would end up calling read(). When UnixSeqpacket was introduced in 1d44223f9, the method was called "read", so this behaviour made more sense. It was renamed to "recv" in b7196e2a1, but the implementation was not changed to call libc::recv. In most cases, according to recv(2), the difference between read() and recv() doesn't matter: > The only difference between recv() and read(2) is the presence of > flags. With a zero flags argument, recv() is generally equivalent > to read(2) (but see NOTES). But the NOTES section explains that > If a zero-length datagram is pending, read(2) and recv() with a > flags argument of zero provide different behavior. In this > circumstance, read(2) has no effect (the datagram remains pending), > while recv() consumes the pending datagram. This means that, while we might expect UnixSeqpacket::recv(&mut []) to mirror the behaviour of recv() and discard a message despite the empty buffer, it would actually leave it there. This became relevant when I implemented the startup message queue in 5bd2e7f60, because I used an empty recv to drop the ready message from the socket, since it was only used for polling and I didn't care about the content. But, it turns out that my UnixSeqpacket::recv call did nothing, and left the message on the socket. This wasn't immediately noticeable, but it meant that when a message came through on the control socket later, it would actually get the ready message from UnixSeqpacket::recv, rather than the expected message on the control socket. For example, trying to use crosvm disk resize would print a message like the following: > [ERROR:vm_control/src/lib.rs:649] unexpected disk socket result: Ready > [ERROR:devices/src/virtio/block.rs:334] Attempted to resize read-only block device We can see that it does try to process the received message, but first it tries to do something with the Ready message, which should have been discarded by now. With this fix applied, we can see that it now receives and tries to process the correct message (but then fails because the VM I tested didn't support disk resizing!): > [ERROR:devices/src/virtio/block.rs:334] Attempted to resize read-only block device Fixes: b7196e2a1c1eb7123e7eace5418b7eb4a3e24dbe Fixes: 5bd2e7f606b726b598fdc26fe26a9b4029fab6d3 Cc: Cole Helbling <cole.e.helbling@outlook.com> | ||
* | crosvm: make wl add take socket as fd | Alyssa Ross | 2020-07-06 |
| | |||
* | devices: include path in SocketConnect error msg | Alyssa Ross | 2020-07-06 |
| | |||
* | devices: log WlState execute failures | Alyssa Ross | 2020-07-06 |
| | | | | These were previously just silently discarded. | ||
* | devices: unique wl socket name generation | Alyssa Ross | 2020-07-06 |
| | |||
* | Remove VirtioPciDevice debug | Alyssa Ross | 2020-07-02 |
| | | | | This broke sandboxing | ||
* | Make wayland socket names byte arrays | Alyssa Ross | 2020-07-02 |
| | |||
* | fix arg checks | Alyssa Ross | 2020-07-02 |
| | |||
* | debug | Alyssa Ross | 2020-07-02 |
| | |||
* | Make lots of things Debug | Alyssa Ross | 2020-07-02 |
| | |||
* | devices: enable adding Wl sockets at runtime | Alyssa Ross | 2020-07-02 |
| | |||
* | impl MsgOnSocket for PathBuf | Alyssa Ross | 2020-06-15 |
| | |||
* | impl MsgOnSocket for String | Alyssa Ross | 2020-06-15 |
| | |||
* | msg_socket: impl MsgOnSocket for Cow<[T]> | Alyssa Ross | 2020-06-15 |
| | | | | | | | This is unlikely to be directly useful, but it will be helpful for Vec-based types like String and PathBuf to delegate to this implementation for write_to_buffer, since they can't delegate to Vec's without copying. | ||
* | msg_socket: make usize fixed size | Alyssa Ross | 2020-06-15 |
| | | | | | Seems like an accidental ommission. All other numeric types are fixed-size, and usize is serialized as a u64 anyway. | ||
* | Don't build crosvm_*_wl | Alyssa Ross | 2020-06-15 |
| | | | | | We're not going to use these any more, but let's keep the code around for now. | ||
* | msg_socket: implement MsgOnSocket for Result | Alyssa Ross | 2020-06-15 |
| | |||
* | msg_socket: fix derive for empty named structs | Alyssa Ross | 2020-06-15 |
| | | | | | | | | | This wouldn't work before: #[derive(MsgOnSocket)] enum Simple { A {} => {}, } | ||
* | more robust memfd server | Alyssa Ross | 2020-06-15 |
| | |||
* | crosvm: add memfd server | Alyssa Ross | 2020-06-15 |
| | |||
* | prepare to intercept VM control | Alyssa Ross | 2020-06-15 |
| | |||
* | three parts | Alyssa Ross | 2020-06-15 |
| | |||
* | msg_socket2: add serialize_newtype_variant | Alyssa Ross | 2020-06-15 |
| | |||
* | make remote wayland device optional | Alyssa Ross | 2020-06-15 |
| | |||
* | don't assume two queues | Alyssa Ross | 2020-06-15 |
| | |||
* | send wl::Params over socket | Alyssa Ross | 2020-06-15 |
| | |||
* | use lifetimes in serialization to prevent closing | Alyssa Ross | 2020-06-15 |
| | |||
* | fix doc | Alyssa Ross | 2020-06-15 |
| | |||
* | devices: VirtioDeviceNew | Alyssa Ross | 2020-06-15 |
| | |||
* | recursive deserialization | Alyssa Ross | 2020-06-15 |
| | |||
* | recursive serialization | Alyssa Ross | 2020-06-15 |
| | |||
* | SerializerWithFds trait | Alyssa Ross | 2020-06-15 |
| | |||
* | switch from poly_msg_socket to msg_socket2 | Alyssa Ross | 2020-06-15 |
| | |||
* | msg_socket2: initial commit | Alyssa Ross | 2020-06-15 |
| | |||
* | debug_label | Alyssa Ross | 2020-06-15 |
| | |||
* | queue_max_sizes | Alyssa Ross | 2020-06-15 |
| | |||
* | devices: return Vec from queue_max_sizes | Alyssa Ross | 2020-06-15 |
| | |||
* | device_type | Alyssa Ross | 2020-06-15 |
| | |||
* | features | Alyssa Ross | 2020-06-15 |
| | |||
* | get_device_caps | Alyssa Ross | 2020-06-15 |
| | |||
* | get_device_bars | Alyssa Ross | 2020-06-15 |
| | |||
* | be more panicky | Alyssa Ross | 2020-06-15 |
| | |||
* | reset | Alyssa Ross | 2020-06-15 |
| | |||
* | read_config | Alyssa Ross | 2020-06-15 |
| | |||
* | ack_features | Alyssa Ross | 2020-06-15 |
| | |||
* | write_config | Alyssa Ross | 2020-06-15 |
| | |||
* | Don't give worker ownership of socket | Alyssa Ross | 2020-06-15 |
| | |||
* | send MemoryParams in create | Alyssa Ross | 2020-06-15 |
| | |||
* | move MemoryParams to devices | Alyssa Ross | 2020-06-15 |
| | |||
* | poly_msg_socket | Alyssa Ross | 2020-06-15 |
| | | | | we're gonna need this to send all of VirtioDevice over a socket |