Coder Social home page Coder Social logo

Comments (4)

sboeuf avatar sboeuf commented on July 17, 2024

@jiangliu any idea how you expect this to be handled?

I was thinking we could extend the Master structure with an extra method set_flags, set the flags for MasterInternal (which would have a new field).
Then we need to make new_request_header() a method of MasterInternal, so that we could provide the proper flags when the header is created with VhostUserMsgHeader::new().

WDYT?

from vhost.

jiangliu avatar jiangliu commented on July 17, 2024

There's one issue here, according to the spec:
VHOST_USER_PROTOCOL_F_REPLY_ACK
The original vhost-user specification only demands replies for certain commands. This differs from the vhost protocol implementation where commands are sent over an ioctl() call and block until the client has completed.

With this protocol extension negotiated, the sender (QEMU) can set the need_reply [Bit 3] flag to any command. This indicates that the client MUST respond with a Payload VhostUserMsg indicating success or failure. The payload should be set to zero on success or non-zero on failure, unless the message already has an explicit reply body.

So the NEED_REPLY flag is per message instead of per connection. If we implement it as per connection, the code change will not be trivial. But if we implement as per connection, that doesn't follow the spec too. Not sure how qemu makes use of the flag.

from vhost.

sboeuf avatar sboeuf commented on July 17, 2024

@jiangliu

So the NEED_REPLY flag is per message instead of per connection. If we implement it as per connection, the code change will not be trivial. But if we implement as per connection, that doesn't follow the spec too. Not sure how qemu makes use of the flag.

I agree you should be able to enable it on a per message basis instead of a per connection one. In practice, I think you either want your connection to be synchronized or you don't, but I still agree we should follow the spec.
I think the approach I've described can provide a simple way of achieving this, since you could call into the set_flags() method before you issue a new command. That means each time you invoke a command, it will evaluate what's in MasterInternal.
That's the less intrusive way of implementing this whole thing, otherwise you would have to modify all the existing functions (hence breaking the API), by adding a flags parameter to all of them.

About QEMU, unless I'm mistaken, I don't think it handles this feature.

from vhost.

jiangliu avatar jiangliu commented on July 17, 2024

Sounds like a plan.

from vhost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.