sound: use descriptor_utils.rs to manipulate requests
Summary of the PR
This commit makes device.rs to use descriptor_utils.rs API to read/write requests independent of the descriptor distribution. This is a draft PR in which I am still working on.
Thanks for the comments.
Requirements
Before submitting your PR, please make sure you addressed the following requirements:
- [x] All commits in this PR are signed (with
git commit -s), and the commit message has max 60 characters for the summary and max 75 characters for each description line. - [x] All added/changed functionality has a corresponding unit/integration test.
- [x] All added/changed public-facing functionality has entries in the "Upcoming Release" section of CHANGELOG.md (if no such section exists, please create one).
- [x] Any newly added
unsafecode is properly documented.
@Ablu @epilys feel free to comment/review. I'll keep it as a draft until virtio-queue is released. Thanks!
did a quick pass, mostly the
let ... else {return Err(...)}pattern confuses me a bit. I think so far we mostly just usedlet foo = (...).map_err(Error::WrappingErrror)?
Thanks @Ablu, I will correct that.
@Ablu since you have reviewed this earlier, can you do it again please ?
I still do not like that in https://github.com/MatiasVara/vhost-device/blob/b1fcfcacb0ad0c1594951b0bba022958c90b25ae/vhost-device-sound/src/lib.rs#L312, this PR uses a descriptor. Shall I address that in this PR or in a new one? I shall not use response_descriptor.
I still do not like that in https://github.com/MatiasVara/vhost-device/blob/b1fcfcacb0ad0c1594951b0bba022958c90b25ae/vhost-device-sound/src/lib.rs#L312, this PR uses a descriptor. Shall I address that in this PR or in a new one? I shall not use
response_descriptor.
How difficult do you think it is? The best thing would be to do it now, but if too difficult, we can merge the code as it is now and then do it later.
I still do not like that in https://github.com/MatiasVara/vhost-device/blob/b1fcfcacb0ad0c1594951b0bba022958c90b25ae/vhost-device-sound/src/lib.rs#L312, this PR uses a descriptor. Shall I address that in this PR or in a new one? I shall not use
response_descriptor.How difficult do you think it is? The best thing would be to do it now, but if too difficult, we can merge the code as it is now and then do it later.
I agree the best would be to address that in this PR. I will update the PR soon.
I just updated the PR based on last comments. Feel free to review @stefano-garzarella @Ablu
@MatiasVara great work! LGTM!
@stsquad @vireshk @epilys please, can you take a look?