From: Alon Levy <alevy@redhat.com>
To: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: hdegoede@redhat.com, uril@redhat.com, qemu-devel@nongnu.org,
gleb@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 4/4] hw/qxl-render: drop cursor locks, replace with pipe
Date: Thu, 17 Mar 2011 11:32:06 +0200 [thread overview]
Message-ID: <20110317093206.GL7413@playa.tlv.redhat.com> (raw)
In-Reply-To: <4D80E9E9.7000505@redhat.com>
On Wed, Mar 16, 2011 at 05:48:41PM +0100, Jes Sorensen wrote:
> On 03/16/11 16:52, Alon Levy wrote:
> > +void qxl_server_request_cursor_set(PCIQXLDevice *qxl, QEMUCursor *c, int x, int y)
> > +{
> > + QXLServerCursorSetRequest req;
> > + int r;
> > +
> > + req.req = QXL_SERVER_CURSOR_SET;
> > + req.data.c = c;
> > + req.data.x = x;
> > + req.data.y = y;
> > + r = write(qxl->ssd.pipe[1], &req, sizeof(req));
> > + assert(r == sizeof(req));
> > +}
>
> There's a number of asserts here, which I am not sure is a good thing. I
> don't understand how far down the code this is, and if it is really
> fatal if this write fails?
A failure there means we can't write to a pipe between the server thread
and the iothread (main thread). That is not supposed to happen - and if
it does it means some operation by the spice server will never complete.
Same for the asserts below, writes are from spice server thread, reads
are in iothread.
>
> > +/* called from spice server thread context only */
> > +void qxl_server_request_cursor_move(PCIQXLDevice *qxl, int x, int y)
> > +{
> > + QXLServerCursorMoveRequest req;
> > + int r;
> > +
> > + req.req = QXL_SERVER_CURSOR_MOVE;
> > + req.data.x = x;
> > + req.data.y = y;
> > + r = write(qxl->ssd.pipe[1], &req, sizeof(req));
> > + assert(r == sizeof(req));
>
> ditto
>
> > +static void read_bytes(int fd, void *buf, int len_requested)
> > +{
> > + int len;
> > + int total_len = 0;
> > +
> > + do {
> > + len = read(fd, buf, len_requested - total_len);
> > + if (len < 0) {
> > + if (errno == EINTR || errno == EAGAIN) {
> > + continue;
> > + }
> > + perror("qxl: pipe_read: read failed");
> > + /* will abort once it's out of the while loop */
> > + break;
> > + }
> > + total_len += len;
> > + buf = (uint8_t *)buf + len;
> > + } while (total_len < len_requested);
> > + assert(total_len == len_requested);
>
> and here?
>
> Cheers,
> Jes
>
>
>
next prev parent reply other threads:[~2011-03-17 9:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 15:52 [Qemu-devel] [PATCH v3 0/4] qxl: implement vga mode without locks Alon Levy
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 1/4] qxl/spice-display: move pipe to ssd Alon Levy
2011-03-16 15:58 ` Hans de Goede
2011-03-16 16:39 ` Jes Sorensen
2011-03-16 16:42 ` Alon Levy
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 2/4] qxl: implement get_command in vga mode without locks Alon Levy
2011-03-16 16:00 ` [Qemu-devel] " Hans de Goede
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 3/4] qxl/spice: remove qemu_mutex_{un, }lock_iothread around dispatcher Alon Levy
2011-03-16 16:01 ` [Qemu-devel] " Hans de Goede
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 4/4] hw/qxl-render: drop cursor locks, replace with pipe Alon Levy
2011-03-16 16:02 ` [Qemu-devel] " Hans de Goede
2011-03-16 16:48 ` [Qemu-devel] " Jes Sorensen
2011-03-17 9:32 ` Alon Levy [this message]
2011-03-17 9:48 ` Jes Sorensen
2011-03-17 10:27 ` Alon Levy
2011-03-17 10:29 ` Jes Sorensen
2011-03-17 10:45 ` Alon Levy
2011-03-17 14:19 ` Jes Sorensen
2011-03-17 15:08 ` Alon Levy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110317093206.GL7413@playa.tlv.redhat.com \
--to=alevy@redhat.com \
--cc=Jes.Sorensen@redhat.com \
--cc=gleb@redhat.com \
--cc=hdegoede@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=uril@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).