Commit df2c3ac
committed
fix: stop
Currently, when backing guest memory by memfd or when mmaping a snapshot
file, we duplicate the file descriptor once per memslot. This is not
necessary: KVM will happily accept the same fd into multiple memslots,
and even rust-vmm supports APIs for this (by storing `Arc<File>` instead
of just `File` in `FileOffset`, we can actually share the same `File`
reference between multiple memory regions). So let's make use of this
capability.
Signed-off-by: Patrick Roy <[email protected]>dup(2)-ing fds when setting up guest memory1 parent c862760 commit df2c3ac
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
| 186 | + | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
0 commit comments