-
Notifications
You must be signed in to change notification settings - Fork 31
Want virtio-vsock support #1031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1308,6 +1308,19 @@ fn setup_instance( | |
| guard.inventory.register(&pvpanic); | ||
| } | ||
| } | ||
| "pci-virtio-vsock" => { | ||
| // XXX MTZ: add the vsock device | ||
| let config = config::VsockDevice::from_opts(&dev.options)?; | ||
| let bdf = bdf.unwrap(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw in an error message here if no bdf is specified? |
||
| let vsock = hw::virtio::PciVirtioSock::new( | ||
| 512, | ||
| config.guest_cid, | ||
| log.new(slog::o!("dev" => "vsock")), | ||
| config.port_mappings, | ||
| ); | ||
| guard.inventory.register(&vsock); | ||
| chipset_pci_attach(bdf, vsock); | ||
| } | ||
| _ => { | ||
| slog::error!(log, "unrecognized driver {driver}"; "name" => name); | ||
| return Err(Error::new( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,7 +94,7 @@ impl VqAvail { | |
| } | ||
| if let Some(idx) = mem.read::<u16>(self.gpa_idx) { | ||
| let ndesc = Wrapping(*idx) - self.cur_avail_idx; | ||
| if ndesc.0 != 0 && ndesc.0 < rsize { | ||
| if ndesc.0 != 0 && ndesc.0 <= rsize { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a fix for a previous existing bug? |
||
| let avail_idx = self.cur_avail_idx.0 & (rsize - 1); | ||
| self.cur_avail_idx += Wrapping(1); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't that what this PR does?