All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Stefan Hajnoczi" <stefanha@linux.vnet.ibm.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>, Lluís <xscript@gmx.net>,
	qemu-devel@nongnu.org, "Blue Swirl" <blauwirbel@gmail.com>,
	"Stefan Weil" <weil@mail.berlios.de>,
	"Hannes Reinecke" <hare@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Wenchao Xia" <xiawenc@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API
Date: Wed, 18 Jul 2012 17:23:42 +0200	[thread overview]
Message-ID: <5006D4FE.8020204@redhat.com> (raw)
In-Reply-To: <20120718141230.GG2294@redhat.com>

Am 18.07.2012 16:12, schrieb Daniel P. Berrange:
> On Wed, Jul 18, 2012 at 04:02:15PM +0200, Paolo Bonzini wrote:
>> Il 18/07/2012 15:58, Daniel P. Berrange ha scritto:
>>> How is error reporting dealt with
>>
>> These APIs just return errno values.
> 
> Which has led to somewhat unhelpful error reporting in the past. If we're
> designing a library API it'd be nice to improve on this.

But in most cases, errno is what we get from the OS, so we can't do much
more than passing it on. Maybe we can do a bit better with bdrv_open(),
which is relatively likely to fail in qemu rather than in the kernel
because something's wrong with the content of the image.

>>> , and what is the intent around
>>> thread safety of the APIs ?  I'd like to see a fully thread safe
>>> API - multiple threads can use the same 'BlockDriverState *'
>>> concurrently, and thread-local error reporting.
>>
>> This is a bit difficult to provide, since the QEMU block layer itself is
>> not thread-safe.
> 
> Yep, I'd expect that this is something we'd need to fix when turning the
> code into a library.  NB, I don't mean to say QEMU should protect against
> an app doing stupid things like letting 2 threads write to the same area
> of the file at once. That's upto the application. I simply mean that the
> BlockDriverState shouldn't corrupt itself if 2 separate APIs are called
> concurrently on the same instance.

I think it makes sense to make the library thread-safe - and if it only
means taking the global mutex like we do in qemu. I think threading is a
good interface to allow clients to do AIO (even though possibly not the
only one we want to provide), and eventually it will match what qemu is
doing internally.

Kevin

  reply	other threads:[~2012-07-18 15:24 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09  8:54 [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API Wenchao Xia
2012-07-09  9:13 ` Paolo Bonzini
2012-07-10  5:04   ` Wenchao Xia
2012-07-10  7:17     ` Paolo Bonzini
2012-07-13  9:16       ` Stefan Hajnoczi
2012-07-13  9:51         ` Paolo Bonzini
2012-07-13 11:33           ` Paolo Bonzini
2012-07-13 15:03             ` Michael Tokarev
2012-07-13 15:17             ` Blue Swirl
2012-07-13 17:07             ` Stefan Weil
2012-07-13 22:55             ` Lluís Vilanova
2012-07-16 10:39               ` Stefan Hajnoczi
2012-07-23 11:55                 ` Lluís Vilanova
2012-07-23 12:09                   ` Paolo Bonzini
2012-07-24  9:33                     ` Lluís Vilanova
2012-07-16  8:16             ` Wenchao Xia
2012-07-16  8:19               ` Paolo Bonzini
2012-07-18  8:51                 ` Wenchao Xia
2012-07-18  9:03                   ` Paolo Bonzini
2012-07-18 15:28                     ` Kevin Wolf
2012-07-18  9:41                   ` Stefan Hajnoczi
2012-07-18 10:42                     ` Paolo Bonzini
2012-07-18 12:50                       ` Stefan Hajnoczi
2012-07-18 13:51                   ` Andreas Färber
2012-07-18 13:55                     ` Kevin Wolf
2012-07-18 13:58                   ` Daniel P. Berrange
2012-07-18 14:02                     ` Paolo Bonzini
2012-07-18 14:12                       ` Daniel P. Berrange
2012-07-18 15:23                         ` Kevin Wolf [this message]
2012-07-18 15:35                     ` Daniel P. Berrange
2012-07-19 11:37                       ` Paolo Bonzini
2012-07-20 11:38                         ` Daniel P. Berrange
2012-07-20 11:53                           ` Paolo Bonzini
2012-07-23 18:15                   ` Blue Swirl
2012-07-25  8:08                     ` Wenchao Xia
2012-07-09  9:27 ` Daniel P. Berrange
2012-07-10  5:37   ` Wenchao Xia
2012-07-10  7:18     ` Paolo Bonzini
2012-07-13  9:12       ` Stefan Hajnoczi
2012-07-13  9:16         ` Daniel P. Berrange
2012-07-13  9:47           ` Stefan Hajnoczi
2012-07-16  7:48           ` Wenchao Xia
2012-07-09 14:36 ` Christoph Hellwig
2012-07-10  5:42   ` Wenchao Xia
2012-07-13  9:13   ` Stefan Hajnoczi
2012-07-13  9:27     ` Christoph Hellwig
2012-07-13  9:43       ` Stefan Hajnoczi
2012-07-13 10:42         ` Kevin Wolf
2012-07-13 10:55           ` Christoph Hellwig
2012-07-13 11:19             ` Kevin Wolf
2012-07-16  7:55       ` Wenchao Xia

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=5006D4FE.8020204@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=berrange@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=hare@suse.de \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=weil@mail.berlios.de \
    --cc=xiawenc@linux.vnet.ibm.com \
    --cc=xscript@gmx.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.