qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: Juan Quintela <quintela@trasno.org>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RFC v2] queue_work proposal
Date: Thu, 3 Sep 2009 16:28:03 -0300	[thread overview]
Message-ID: <20090903192803.GT30340@mothafucka.localdomain> (raw)
In-Reply-To: <m3fxb350fe.fsf@neno.mitica>

On Thu, Sep 03, 2009 at 08:48:53PM +0200, Juan Quintela wrote:
> Glauber Costa <glommer@redhat.com> wrote:
> 
> Hi Glauber
> 
> > +int kvm_vcpu_ioctl(CPUState *env, int type, ...)
> > +{
> >      void *arg;
> >      va_list ap;
> > +    KVMIoctl data;
> >  
> >      va_start(ap, type);
> >      arg = va_arg(ap, void *);
> >      va_end(ap);
> >  
> > -    ret = ioctl(env->kvm_fd, type, arg);
> > -    if (ret == -1)
> > -        ret = -errno;
> > +    data.type = type;
> > +    data.data = arg;
> > +    data.fd = env->kvm_fd;
> >  
> > -    return ret;
> > +    qemu_queue_work(env, kvm_remote_ioctl, (void *)&data);
> > +
> > +    return data.ret;
> 
> Does this work?  giving the address of a local variable is a no-no.
Yes, because it synchronous. The stack will keep existing until queue_work returns.

Actually, this was one of the reasons Avi pushed so hardly against the async mechanism

  parent reply	other threads:[~2009-09-03 19:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 18:01 [Qemu-devel] [RFC v2] queue_work proposal Glauber Costa
     [not found] ` <m3fxb350fe.fsf@neno.mitica>
2009-09-03 19:28   ` Glauber Costa [this message]
2009-10-22 17:37 ` Marcelo Tosatti
2009-10-22 18:57   ` Glauber Costa

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=20090903192803.GT30340@mothafucka.localdomain \
    --to=glommer@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@trasno.org \
    /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).