Statistics
| Branch: | Revision:

root / block.c @ 551a2dec

History | View | Annotate | Download (61.6 kB)

# Date Author Comment
4dca4b63 02/19/2010 11:32 pm Naphtali Sprei

block: more read-only changes, related to backing files

Open backing file read-only where possible
Upgrade backing file to read-write during commit, back to read-only after commit
If upgrade fail, back to read-only. If also fail, "disconnect" the drive....

ba144141 02/10/2010 09:46 pm Luiz Capitulino

Monitor: remove unneeded checks

It's not needed to check the return of qobject_from_jsonf()
anymore, as an assert() has been added there.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

2582bfed 02/10/2010 07:57 pm Luiz Capitulino

block: BLOCK_IO_ERROR QMP event

This commit introduces the bdrv_mon_event() function, which
should be called by block subsystems (eg. IDE) when a I/O
error occurs, so that an QMP event is emitted.

The following information is currently provided in the event:...

15dc2697 02/10/2010 07:57 pm Christoph Hellwig

block: saner flags filtering in bdrv_open2

Clean up the current mess about figuring out which flags to pass to the
driver. BDRV_O_FILE, BDRV_O_SNAPSHOT and BDRV_O_NO_BACKING are flags
only used by the block layer internally so filter them out directly.
Previously BDRV_O_NO_BACKING could accidentally be passed to the drivers,...

aaa0eb75 02/10/2010 12:56 am Liran Schour

Count dirty blocks and expose an API to get dirty count

This will manage dirty counter for each device and will allow to get the
dirty counter from above.

Signed-off-by: Liran Schour <>
Signed-off-by: Anthony Liguori <>

e2a305fb 01/27/2010 01:08 am Christoph Hellwig

block: avoid creating too large iovecs in multiwrite_merge

If we go over the maximum number of iovecs support by syscall we get
back EINVAL from the kernel which translate to I/O errors for the guest.

Add a MAX_IOV defintion for platforms that don't have it. For now we use...

f8a83245 01/27/2010 12:41 am Herve Poussineau

win32: pair qemu_memalign() with qemu_vfree()

Win32 suffers from a very big memory leak when dealing with SCSI devices.
Each read/write request allocates memory with qemu_memalign (ie
VirtualAlloc) but frees it with qemu_free (ie free).
Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks....

6987307c 01/26/2010 11:42 pm Christoph Hellwig

block: clean up bdrv_open2 structure a bit

Check the whitelist as early as possible instead of continuing the
setup, and move all the error handling code to the end of the
function.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

37226ad9 01/26/2010 11:42 pm Naphtali Sprei

No need anymoe for bdrv_set_read_only

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

9a8c4cce 01/26/2010 10:59 pm Kevin Wolf

block: Return original error codes in bdrv_pread/write

Don't assume -EIO but return the real error.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

3e39789b 01/20/2010 06:12 pm Anthony Liguori

Revert "block: prevent multiwrite_merge from creating too large iovecs"

This reverts commit 0076bc0c1d93adcbc7f1af184e04902cf37e9ab8.

Kevin Wolf pointed out that this breaks the mingw32 build.

Signed-off-by: Anthony Liguori <>

0076bc0c 01/20/2010 04:51 pm Christoph Hellwig

block: prevent multiwrite_merge from creating too large iovecs

If we go over the maximum number of iovecs support by syscall we get
back EINVAL from the kernel which translate to I/O errors for the guest.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

1d44952f 01/20/2010 04:51 pm Christoph Hellwig

block: fix cache flushing in bdrv_commit

Signed-off-by: Anthony Liguori <>

f5edb014 01/20/2010 04:25 pm Naphtali Sprei

Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...

03cbdac7 01/20/2010 04:25 pm Naphtali Sprei

Disable fall-back to read-only when cannot open drive's file for read-write

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

b783e409 01/14/2010 01:14 am Kevin Wolf

block: Introduce BDRV_O_NO_BACKING

If an image references a backing file that doesn't exist, qemu-img info fails
to open this image. Exactly in this case the info would be valuable, though:
the user might want to find out which file is missing.

This patch introduces a BDRV_O_NO_BACKING flag to ignore the backing file when...

756e6736 01/14/2010 01:14 am Kevin Wolf

block: Add bdrv_change_backing_file

Introduce the functions needed to change the backing file of an image. The
function is implemented for qcow2.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

3f5075ae 01/14/2010 01:14 am Christoph Hellwig

block: flush backing_hd in the right place

The backing device is only modified from bdrv_commit. So instead of
flushing it every time bdrv_flush is called for the front-end device
only flush it after we're written data to it in bdrv_commit.

Signed-off-by: Christoph Hellwig <>...

114cdfa9 12/25/2009 08:19 pm Kirill A. Shutemov

block.c: fix warning with _FORTIFY_SOURCE

CC    block.o
cc1: warnings being treated as errors
block.c: In function 'bdrv_open2':
block.c:400: error: ignoring return value of 'realpath', declared with attribute warn_unused_result

Signed-off-by: Kirill A. Shutemov <>...

d15e5465 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info() to QObject

Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

218a536a 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info_stats() to QObject

Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

a55eb92c 12/03/2009 06:48 pm Jan Kiszka

block migration: Fix coding style and whitespaces

No functional changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

6ea44308 12/03/2009 06:48 pm Jan Kiszka

block migration: Rework constants API

Instead of duplicating the definition of constants or introducing
trivial retrieval functions move the SECTOR constants into the public
block API. This also obsoletes sector_per_block in BlkMigState.

Signed-off-by: Jan Kiszka <>...

c6d22830 12/03/2009 06:48 pm Jan Kiszka

block migration: Cleanup dirty tracking code

This switches the dirty bitmap to a true bitmap, reducing its footprint
(specifically in caches). It moreover fixes off-by-one bugs in
set_dirty_bitmap (nb_sectors+1 were marked) and bdrv_get_dirty (limit
check allowed one sector behind end of drive). And is drops redundant...

7cd1e32a 11/17/2009 04:03 pm lirans@il.ibm.com

Expose a mechanism to trace block writes

To support live migration without shared storage we need to be able to trace
writes to disk while migrating. This Patch expose dirty block tracking per
device to be polled from upper layer.

Changes from v4:
- Register dirty tracking for each block device....

eb852011 11/09/2009 04:43 pm Markus Armbruster

Configurable block format whitelist

We have code for a quite a few block formats. While I trust that all
of these formats are useful at least for some people in some
circumstances, some of them are of a kind that friends don't let
friends use in production....

59f2689d 11/09/2009 04:43 pm Naphtali Sprei

Added readonly flag to -drive command

This is a slightly revised patch for adding readonly flag to the -drive command.
Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
the readonly attribute of the drive to the guest OS, applied first....

65d6b3d8 10/27/2009 07:28 pm Kevin Wolf

block: Use new AsyncContext for bdrv_read/write emulation

bdrv_read/write emulation is used as the perfect example why we need something
like AsyncContexts. So maybe they better start using it.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

e900a7b7 09/11/2009 06:19 pm Christoph Hellwig

block: add enable_write_cache flag

Add a enable_write_cache flag in the block driver state, and use it to
decide if we claim to have a volatile write cache that needs controlled
flushing from the guest. The flag is off if cache=writethrough is
defined because O_DSYNC guarantees that every write goes to stable...

b2e12bc6 09/11/2009 06:19 pm Christoph Hellwig

block: add aio_flush operation

Instead stalling the VCPU while serving a cache flush try to do it
asynchronously. Use our good old helper thread pool to issue an
asynchronous fdatasync for raw-posix. Note that while Linux AIO
implements a fdatasync operation it is not useful for us because...

40b4f539 09/11/2009 06:18 pm Kevin Wolf

Add bdrv_aio_multiwrite

One performance problem of qcow2 during the initial image growth are
sequential writes that are not cluster aligned. In this case, when a first
requests requires to allocate a new cluster but writes only to the first
couple of sectors in that cluster, the rest of the cluster is zeroed - just...

5c6c3a6c 08/28/2009 04:30 am Christoph Hellwig

raw-posix: add Linux native AIO support

Now that do have a nicer interface to work against we can add Linux native
AIO support. It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an...

71e72a19 07/27/2009 10:09 pm Juan Quintela

rename HOST_BSD to CONFIG_BSD

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

45566e9c 07/16/2009 04:28 pm Christoph Hellwig

replace bdrv_{get, put}_buffer with bdrv_{load, save}_vmstate

The VM state offset is a concept internal to the image format. Replace
the old bdrv_{get,put}_buffer method that require an index into the
image file that is constructed from the VM state offset and an offset...

36afc451 07/10/2009 09:44 pm Avi Kivity

block: Clean up after deleting BHs

Commit 6a7ad299 ("Call qemu_bh_delete at bdrv_aio_bh_cb") deletes emulated
aio bottom halves to prevent endless accumulation. However, it leaves a
stale ->bh pointer, which is then waited on when the aio is reused.

Zeroing the pointer fixes the issue, allowing vmdk format images to be used....

1cec71e3 07/10/2009 12:06 am Anthony Liguori

Revert "support colon in filenames"

This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8.

Signed-off-by: Anthony Liguori <>

d43277c5 07/01/2009 09:24 pm Blue Swirl

Fix missing strnlen problems

Fix missing strnlen (a GNU extension) problems by using qemu_strnlen
used for user emulators also for system emulators.

Signed-off-by: Blue Swirl <>

707c0dbc 06/29/2009 09:50 pm Ram Pai

support colon in filenames

Problem: It is impossible to feed filenames with the character colon because
qemu interprets such names as a protocol. For example filename scsi:0, is
interpreted as a protocol by name "scsi".

This patch allows user to espace colon characters. For example the above...

aea2a33c 06/16/2009 11:52 pm Mark McLoughlin

Prevent CD-ROM media eject while device is locked

Section 10.8.25 ("START/STOP UNIT Command") of SFF-8020i states that
if the device is locked we should refuse to eject if the device is
locked.

ASC_MEDIA_REMOVAL_PREVENTED is the appropriate return in this case....

6a7ad299 06/16/2009 11:36 pm Dor Laor

Call qemu_bh_delete at bdrv_aio_bh_cb.

Also replave qemu_bh_cancel with qemu_bh_delete in bdrv_aio_cancel_em.
Otherwise the bh will live forever in the bh list.

Signed-off-by: Dor Laor <>
Signed-off-by: Anthony Liguori <>

508c7cb3 06/15/2009 03:04 pm Christoph Hellwig

block: add bdrv_probe_device method

Add a bdrv_probe_device method to all BlockDriver instances implementing
host devices to move matching of host device types into the actual drivers.
For now we keep exacly the old matching behaviour based on the devices names,...

f3a5d3f8 06/15/2009 02:55 pm Christoph Hellwig

raw-posix: split hdev drivers

Instead of declaring one BlockDriver for all host devices declared one
for each type: a generic one for normal disk devices, a Linux floppy
driver and a CDROM driver for Linux and FreeBSD. This gets rid of a lot
of messy ifdefs and switching based on the type in the various removal...

c16b5a2c 05/27/2009 05:46 pm Christoph Hellwig

fully split aio_pool from BlockDriver

Now that we have a separate aio pool structure we can remove those
aio pool details from BlockDriver.

Every driver supporting AIO now needs to declare a static AIOPool
with the aiocb size and the cancellation method. This cleans up the...

91a073a9 05/27/2009 05:45 pm Kevin Wolf

Drop bdrv_create2

This patch converts the remaining users of bdrv_create2 to bdrv_create and
removes the now unused function.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

0e7e1989 05/22/2009 06:50 pm Kevin Wolf

Convert all block drivers to new bdrv_create

Now we can make use of the newly introduced option structures. Instead of
having bdrv_create carry more and more parameters (which are format specific in
most cases), just pass a option structure as defined by the driver itself....

c833ab73 05/22/2009 06:50 pm Anthony Liguori

Fix segv when passing an unknown protocol

Signed-off-by: Anthony Liguori <>

5efa9d5a 05/15/2009 12:13 am Anthony Liguori

Convert block infrastructure to use new module init functionality

Signed-off-by: Anthony Liguori <>

fbb7b4e0 05/09/2009 12:02 am Kevin Wolf

Improve block range checks

This patch makes the range checks for block requests more strict: It fixes a
potential integer overflow and checks for negative offsets. Also, it adds the
check for compressed writes.

Signed-off-by: Kevin Wolf <>...

e268ca52 04/22/2009 11:20 pm aliguori

implement qemu_blockalign (Stefano Stabellini)

this patch adds a buffer_alignment field to BlockDriverState and
implements a qemu_blockalign function that uses that field to allocate a
memory aligned buffer to be used by the block driver.
buffer_alignment is initialized to 512 but each block driver can set...

e97fc193 04/22/2009 02:11 am aliguori

Introduce bdrv_check (Kevin Wolf)

From: Kevin Wolf <>

Introduce a new bdrv_check function pointer for block drivers. Modify qcow2 to
return an error status in check_refcounts(), so it can implement bdrv_check.

Signed-off-by: Kevin Wolf <>...

3f4cb3d3 04/13/2009 07:31 pm blueswir1

Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162

ceb42de8 04/07/2009 09:43 pm aliguori

native preadv/pwritev support (Christoph Hellwig)

This ties up the preadv/pwritev syscalls to qemu if they are declared in
unistd.h. This is the case currently on at least NetBSD and OpenBSD and
will hopefully soon be the case on Linux.

Thanks to Blue Swirl and Gerd Hoffmann for the configure autodetection...

f141eafe 04/07/2009 09:43 pm aliguori

push down vector linearization to posix-aio-compat.c (Christoph Hellwig)

Make all AIO requests vectored and defer linearization until the actual
I/O thread. This prepares for using native preadv/pwritev.

Also enables asynchronous direct I/O by handling that case in the I/O thread....

c87c0672 04/07/2009 09:43 pm aliguori

remove bdrv_aio_read/bdrv_aio_write (Christoph Hellwig)

Always use the vectored APIs to reduce code churn once we switch the BlockDriver
API to be vectored.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>...

178e08a5 04/05/2009 10:10 pm aliguori

Fix savevm after BDRV_FILE size enforcement

We now enforce that you cannot write beyond the end of a non-growable file.
qcow2 files are not growable but we rely on them being growable to do
savevm/loadvm. Temporarily allow them to be growable by introducing a new...

081501da 03/29/2009 04:31 am aliguori

check for bs->drv in bdrv_flush (Christoph Hellwig)

All the bdrv_ helpers should check for bs->drv being zero as that means
there is no backend image open. bdrv_flush fails to perform that check
and can thus cause NULL pointer dereferences.

Found using qemu-io....

999dec57 03/29/2009 04:31 am aliguori

remove dead code in bdrv_check_request (Christoph Hellwig)

Remove code dealing with negative sector numbers for byte access in
bdrv_check_request as sector numbers can't ever be negative.

Previously we supported negative sector counts for byte access, but...

5eb45639 03/28/2009 07:55 pm aliguori

block: support known backing format for image create and open (Uri Lublin)

Added a backing_format field to BlockDriverState.
Added bdrv_create2 and drv->bdrv_create2 to create an image with
a known backing file format.
Upon bdrv_open2 if backing format is known use it, instead of...

221f715d 03/28/2009 07:28 pm aliguori

new scsi-generic abstraction, use SG_IO (Christoph Hellwig)

Okay, I started looking into how to handle scsi-generic I/O in the
new world order.

I think the best is to use the SG_IO ioctl instead of the read/write
interface as that allows us to support scsi passthrough on disk/cdrom...

c240b9af 03/28/2009 06:11 pm aliguori

Fix vectored aio bounce handling immediate errors (Avi Kivity)

If a bounced vectored aio fails immediately (the inner aio submission
returning NULL) then the bounce handler erronously returns an aio
request which will never be completed (and which crashes when cancelled)....

3fb94d56 03/20/2009 08:26 pm aliguori

Use vectored aiocb storage to store vector translation state (Avi Kivity)

Now that we have a dedicated acb pool for vector translation acbs, we can
store the vector translation state in the acbs instead of in an external
structure.

Signed-off-by: Avi Kivity <>...

c07a9008 03/20/2009 08:26 pm aliguori

Convert vectored aio emulation to use a dedicated pool (Avi Kivity)

This allows us to remove a hack in the vectored aio cancellation code.

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6871 c046a42c-6fe2-441c-8c8c-71466251a162

6bbff9a0 03/20/2009 08:25 pm aliguori

Refactor aio callback allocation to use an aiocb pool (Avi Kivity)

Move the AIOCB allocation code to use a dedicate structure, AIOPool. AIOCB
specific information, such as the AIOCB size and cancellation routine, is
moved into the pool.

At present, there is exactly one pool per block format driver, maintaining...

eda578e5 03/12/2009 09:57 pm aliguori

Drop internal bdrv_pread()/bdrv_pwrite() APIs (Avi Kivity)

Now that scsi generic no longer uses bdrv_pread() and bdrv_pwrite(), we can
drop the corresponding internal APIs, which overlap bdrv_read()/bdrv_write()
and, being byte oriented, are unnatural for a block device....

04eeb8b6 03/12/2009 09:57 pm aliguori

Add internal scsi generic block API (Avi Kivity)

Add an internal API for the generic block layer to send scsi generic commands
to block format driver. This means block format drivers no longer need
to consider overloaded nb_sectors parameters.

Signed-off-by: Avi Kivity <>...

7d780669 03/12/2009 09:57 pm aliguori

Add specialized block driver scsi generic API (Avi Kivity)

When a scsi device is backed by a scsi generic device instead of an
ordinary host block device, the block API is abused in a couple of annoying
ways:

- nb_sectors is negative, and specifies a byte count instead of a sector count...
ebf53fcd 03/11/2009 10:05 pm aliguori

Revert r6406

This series is broken by design as it requires expensive IO operations at
open time causing very long delays when starting a virtual machine for the
first time.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6814 c046a42c-6fe2-441c-8c8c-71466251a162

70240ca6 03/11/2009 10:05 pm aliguori

Revert r6407

This series is broken by design as it requires expensive IO operations at
open time causing very long delays when starting a virtual machine for the
first time.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6813 c046a42c-6fe2-441c-8c8c-71466251a162

49dc768d 03/08/2009 06:26 pm aliguori

Fix windows build and clean up use of <windows.h>

We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values so
let's do it in OS_CFLAGS.

Then, we can pepper in windows.h includes where using #includes that require it.

Signed-off-by: Anthony Liguori <>...

179a2c19 03/08/2009 10:23 am blueswir1

Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configure

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162

c5e97233 03/07/2009 10:06 pm blueswir1

Support for DragonFly BSD (Hasso Tepper)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162

376253ec 03/06/2009 01:01 am aliguori

monitor: Rework API (Jan Kiszka)

Refactor the monitor API and prepare it for decoupled terminals:
term_print functions are renamed to monitor_* and all monitor services
gain a new parameter (mon) that will once refer to the monitor instance
the output is supposed to appear on. However, the argument remains...

bb5fc20f 03/06/2009 01:01 am aliguori

monitor: Rework modal password input (Jan Kiszka)

Currently, waiting for the user to type in some password blocks the
whole VM because monitor_readline starts its own I/O loop. And this loop
also screws up reading passwords from virtual console.

Patch below fixes the shortcomings by using normal I/O processing also...

c0f4ce77 03/06/2009 01:01 am aliguori

monitor: Rework early disk password inquiry (Jan Kiszka)

Reading the passwords for encrypted hard disks during early startup is
broken (I guess for quiet a while now):
- No monitor terminal is ready for input at this point
- Forcing all mux'ed terminals into monitor mode can confuse other...

430eb509 03/06/2009 01:00 am aliguori

monitor: Report encrypted disks in snapshot mode (Jan Kiszka)

If the backing file is encrypted, 'info block' currently does not report
the disk as encrypted. Fix this by using the standard API to check disk
encryption mode. Moreover, switch to a canonical output format....

045df330 03/06/2009 01:00 am aliguori

block: Introduce bdrv_get_encrypted_filename (Jan Kiszka)

Introduce bdrv_get_encrypted_filename service to allow more informative
password prompting.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>...

51de9760 03/06/2009 01:00 am aliguori

block: Improve bdrv_iterate (Jan Kiszka)

Make bdrv_iterate more useful by passing the BlockDriverState to the
iterator instead of the device name.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6703 c046a42c-6fe2-441c-8c8c-71466251a162

51d7c00c 03/06/2009 01:00 am aliguori

block: Polish error handling of brdv_open2 (Jan Kiszka)

Make sure that we always delete temporary disk images on error, remove
obsolete malloc error checks and return proper error codes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>...

71d0770c 03/03/2009 07:37 pm aliguori

Fix CVE-2008-0928 - insufficient block device address range checking (Anthony Liguori)

Introduce a growable flag that's set by bdrv_file_open(). Block devices should
never be growable, only files that are being used by block devices.

I went through Fabrice's early comments about the patch that was first applied....

d905dba4 03/03/2009 08:28 am aurel32

fix SIGSEGV when USE_KQEMU is defined

Signed-off-by: Alex Ivanov <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6674 c046a42c-6fe2-441c-8c8c-71466251a162

3ec88e80 02/06/2009 12:05 am aliguori

block: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162

249aa745 01/26/2009 07:17 pm aliguori

qemu iovec: keep track of total size, allow partial copies (Gerd Hoffman)

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6448 c046a42c-6fe2-441c-8c8c-71466251a162

1987530f 01/22/2009 08:57 pm aliguori

qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' (Uri Lublin)

'num_free_bytes' is the number of non-allocated bytes below highest-allocation.
It's useful, together with the highest-allocation, to figure out how
fragmented the image is, and how likely it will run out-of-space soon....

a7cbfae0 01/22/2009 08:57 pm aliguori

info blockstats: show highest_allocated if exists (Uri Lublin)

Signed-off-by: Uri Lublin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6406 c046a42c-6fe2-441c-8c8c-71466251a162

3b69e4b9 01/22/2009 06:59 pm aliguori

Vectored block device API (Avi Kivity)

Most devices that are capable of DMA are also capable of scatter-gather.
With the memory mapping API, this means that the device code needs to be
able to access discontiguous host memory regions.

For block devices, this translates to vectored I/O. This patch implements...

42fb2807 01/15/2009 10:43 pm aliguori

bdrv_write should not stop on partial write (Gleb Natapov)

Should return real error instead.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6323 c046a42c-6fe2-441c-8c8c-71466251a162

a38131b6 12/05/2008 07:56 pm blueswir1

Attached patch contains warning fixes.

Signed-off-by: Christoph Egger <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5888 c046a42c-6fe2-441c-8c8c-71466251a162

3990d09a 12/05/2008 07:53 pm blueswir1

sys-queue.h defines SYS_QUEUE_H which is also defined by
the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
on NetBSD, which doesn't exist in sys-queue.h. Therefore,
include <sys/queue.h> before including sys-queue.h.

Signed-off-by: Christoph Egger <>...

f3d54fc4 11/25/2008 11:50 pm aliguori

Abstract out geometry detection code from IDE for reuse

Virtio will want to use the geometry detection code. It doesn't belong
in ide.c anyway.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5797 c046a42c-6fe2-441c-8c8c-71466251a162

4fc9af53 11/08/2008 06:27 pm aliguori

Use an option rom instead of boot sector for -kernel

Generate an option rom instead of using a hijacked boot sector for kernel
booting. This just requires adding a small option ROM header and a few more
instructions to the boot sector to take over the int19 vector and run our...

9f7965c7 10/14/2008 05:42 pm aliguori

Expand cache= option and use write-through caching by default

This patch changes the cache= option to accept none, writeback, or writethough
to control the host page cache behavior. By default, writethrough caching is
now used which internally is implemented by using O_DSYNC to open the disk...

a0a83536 10/14/2008 12:08 am aurel32

open() can also return EPERM for O_RDWR on a readonly device

Signed-off-by: Juergen Lock <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5482 c046a42c-6fe2-441c-8c8c-71466251a162

c6ca28d6 10/06/2008 04:55 pm aliguori

Add bdrv_flush_all()

This patch adds a bdrv_flush_all() function. It's necessary to ensure that all
IO operations have been flushed to disk before completely a live migration.

N.B. we don't actually use this now. We really should flush the block drivers...

a76bab49 09/22/2008 10:17 pm aliguori

Refactor AIO to allow multiple AIO implementations

This patch refactors the AIO layer to allow multiple AIO implementations. It's
only possible because of the recent signalfd() patch.

Right now, the AIO infrastructure is pretty specific to the block raw backend....

7ee930d0 09/17/2008 10:04 pm blueswir1

Fix warnings that would be caused by ld flag --warn-common

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5240 c046a42c-6fe2-441c-8c8c-71466251a162

03ff3ca3 09/15/2008 06:51 pm aliguori

Use common objects for qemu-img and qemu-nbd

Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
code. It's ugly and causes us to have to build multiple object files for
linking against qemu and the tools.

This patch introduces a new file, qemu-tool.c which contains enough for...

7ccfb2eb 09/14/2008 09:45 am blueswir1

Fix warnings that would be caused by gcc flag -Wwrite-strings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162

7c96d46e 09/12/2008 08:54 pm aliguori

Let snapshot work with protocols

realpath will horribly mangle a protocol so avoid calling it if the backing
file is a protocol.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5200 c046a42c-6fe2-441c-8c8c-71466251a162

a3392f9b 09/11/2008 09:00 pm aliguori

Only build compatfd when using AIO and make sure to always init AIO

OpenBSD doesn't use AIO so don't try to build compatfd when not using AIO.

Also make sure to call qemu_aio_init() from bdrv_init. Everything that uses
bdrv calls bdrv_init so it makes sense to init aio from there instead of...