Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 918736 Details for
Bug 616772
feature request: virtio-serial needs a callback to notify device that to guest queue is not full
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
0001-virtio-serial-expose-a-guest_writable-callback-for-u.patch (text/plain), 2.60 KB, created by
Amit Shah
on 2014-07-17 14:39:51 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Amit Shah
Created:
2014-07-17 14:39:51 UTC
Size:
2.60 KB
patch
obsolete
>From 7ecde509d5c62583651c1dd028925a8654ab3eb8 Mon Sep 17 00:00:00 2001 >Message-Id: <7ecde509d5c62583651c1dd028925a8654ab3eb8.1405607848.git.amit.shah@redhat.com> >From: Amit Shah <amit.shah@redhat.com> >Date: Thu, 17 Jul 2014 20:02:45 +0530 >Subject: [PATCH 1/1] virtio: serial: expose a 'guest_writable' callback for > users > >Users of virtio-serial may want to know when a port becomes writable. A >port can stop accepting writes if the guest port is open but not being >read from. In this case, data gets queued up in the virtqueue, and >after the vq is full, writes to the port do not succeed. > >When the guest reads off a vq element, and adds a new one for the host >to put data in, we can tell users the port is available for more writes, >via the new ->guest_writable() callback. > >Requested-by: Alon Levy <alevy@redhat.com> >Signed-off-by: Amit Shah <amit.shah@redhat.com> >--- > hw/char/virtio-serial-bus.c | 18 ++++++++++++++++++ > include/hw/virtio/virtio-serial.h | 3 +++ > 2 files changed, 21 insertions(+) > >diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c >index 23123b7..4ae00f1 100644 >--- a/hw/char/virtio-serial-bus.c >+++ b/hw/char/virtio-serial-bus.c >@@ -445,6 +445,24 @@ static void handle_output(VirtIODevice *vdev, VirtQueue *vq) > > static void handle_input(VirtIODevice *vdev, VirtQueue *vq) > { >+ /* >+ * Users of virtio-serial would like to know when guest becomes >+ * writable again -- i.e. if a vq had stuff queued up and the >+ * guest wasn't reading at all, the host would not be able to >+ * write to the vq anymore. Once the guest reads off something, >+ * we can start queueing things up again. >+ */ >+ VirtIOSerial *vser; >+ VirtIOSerialPort *port; >+ VirtIOSerialPortClass *vsc; >+ >+ vser = VIRTIO_SERIAL(vdev); >+ port = find_port_by_vq(vser, vq); >+ vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); >+ >+ if (vsc->guest_writable) { >+ vsc->guest_writable(port); >+ } > } > > static uint32_t get_features(VirtIODevice *vdev, uint32_t features) >diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h >index 4746312..3fd696b 100644 >--- a/include/hw/virtio/virtio-serial.h >+++ b/include/hw/virtio/virtio-serial.h >@@ -98,6 +98,9 @@ typedef struct VirtIOSerialPortClass { > /* Guest is now ready to accept data (virtqueues set up). */ > void (*guest_ready)(VirtIOSerialPort *port); > >+ /* Guest vq became writable again */ >+ void (*guest_writable)(VirtIOSerialPort *port); >+ > /* > * Guest wrote some data to the port. This data is handed over to > * the app via this callback. The app can return a size less than >-- >1.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
amit.shah
: review? (
alevy
)
Actions:
View
|
Diff
Attachments on
bug 616772
: 918736