History | View | Annotate | Download (23.8 kB)
bdrv: Use "Error" for creating images
Add an Error ** parameter to BlockDriver.bdrv_create to allow morespecific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open andBlockDriver.bdrv_file_open to allow more specific error messages.
vpc: Implement .bdrv_has_zero_init
Depending on the subformat, has_zero_init on VHD must behave like rawand query the underlying storage (fixed) or like other sparse formatsthat can always return 1 (dynamic, differencing).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Add options QDict to .bdrv_open()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Revert "block/vpc: Fix size calculation"
This reverts commit f880defbb06708d30a38ce9f2667067626acdd38.
Jeff Cody's testing revealed that the interpretation of size differseven between VirtualPC and HyperV. Revert this so there is time toconsider the impact of any backwards incompatible behavior this change...
block/vpc: Fix size calculation
The size calculated from the CHS values is not the real image (disk) size,but usually a smaller value. This is caused by rounding effects.
Only older operating systems use CHS. Such guests won't be able to usethe whole disk. All modern operating systems use the real size....
vpc: Fix bdrv_open() error handling
Return -errno instead of -1 on errors. While touching thecode, fix a memory leak.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: move include files to include/migration/
block: move include files to include/block/
block: vpc support for ~2 TB disks
The VHD specification allows for up to a 2 TB disk size. The currentimplementation in qemu emulates EIDE and ATA-2 hardware which only allowsfor up to 127 GB. This disk size limitation can be overridden by allowingup to 255 heads instead of the normal 4 bit limitation of 16. Doing so...
block: vpc initialize the uuid footer field
Initialize the uuid field in the footer with a generated uuid.
Signed-off-by: Charles Arnold <carnold@suse.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: vpc image file reopen
There is currently nothing that needs to be done for VPC imagefile reopen.
Signed-off-by: Jeff Cody <jcody@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Convert open calls to qemu_open
This patch converts all block layer open calls to qemu_open.
Note that this adds the O_CLOEXEC flag to the changed open pathswhen the O_CLOEXEC macro is defined.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>...
block: Convert close calls to qemu_close
This patch converts all block layer close calls, that correspondto qemu_open calls, to qemu_close.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vpc: write checksum back to footer after check
After validation check, the 'checksum' is not written backto footer, which leave it with zero.
This results in errors while loadding it under Microsoft'sHyper-V environment, and also errors from utilities like...
block: push recursive flushing up from drivers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vpc: Add support for Fixed Disk type
The Virtual Hard Disk Image Format Specification allows for threetypes of hard disk formats, Fixed, Dynamic, and Differencing. Qemucurrently only supports Dynamic disks. This patch adds support forthe Fixed Disk format....
vpc: Round up image size during fixed image creation
The geometry calculation algorithm from the VHD spec rounds the imagesize down if it doesn't exactly match a geometry. During imageconversion, this causes the image to be truncated. For dynamic images,...
vpc: Add missing error handling in alloc_block
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
vpc: Add migration blocker
vpc caches the BAT. For migration to work, it would have to beinvalidated. Block migration for now.
block: Rename bdrv_co_flush to bdrv_co_flush_to_disk
There are two different types of flush that you can do: Flushing one level upto the OS (i.e. writing data to the host page cache) or flushing it all the waydown to the disk. The existing functions flush to the disk, reflect this in the...
block: Fix vpc initialization of the Dynamic Disk Header
The Data Offset field in the Dynamic Disk Header is an 8 byte field.Although the specification (2006-10-11) gives an example of initializingonly the first 4 bytes, images generated by Microsoft on Windows initialize...
block: take lock around bdrv_read implementations
This does the first part of the conversion to coroutines, bywrapping bdrv_read implementations to take the mutex.
Drivers that implement bdrv_read rather than bdrv_co_readv canthen benefit from asynchronous operation (at least if the underlying...
block: take lock around bdrv_write implementations
This does the first part of the conversion to coroutines, bywrapping bdrv_write implementations to take the mutex.
Drivers that implement bdrv_write rather than bdrv_co_writev canthen benefit from asynchronous operation (at least if the underlying...
block: change flush to co_flush
Since coroutine operation is now mandatory, convert all bdrv_flushimplementations to coroutines. For qcow2, this means taking the lock.Other implementations are simpler and just forward bdrv_flush to theunderlying protocol, so they can avoid the lock....
block: add a CoMutex to synchronous read drivers
The big conversion of bdrv_read/write to coroutines caused the twohomonymous callbacks in BlockDriver to become reentrant. It goeslike this:
1) bdrv_read is now called in a coroutine, and calls bdrv_read or...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/vpc.c: Detect too-large vpc file
VHD files technically can be up to 2Tb, but virtual pc is limitedto 127G. Currently qemu-img refused to create vpc files > 127G,but it is failing to return error when converting from a non-vpcVHD file which is >127G. It returns success, but creates a truncated...
vpc.c: Use get_option_parameter() does the search
Use get_option_parameter() to instead of duplicating the loop, anduse BDRV_SECTOR_SIZE to instead of 512
Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vpc: fix a file descriptor leak
Fix a file descriptor leak, reported by cppcheck:[/src/qemu/block/vpc.c:524]: (error) Resource leak: fd
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block: Remove unused s->hd in various drivers
All drivers use bs->file instead of s->hd for quite a while now, so it's timeto remove s->hd.
vpc: Implement bdrv_flush
vpc: Use bdrv_(p)write_sync for metadata writes
Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash.
vpc: Read/write multiple sectors at once
This changes the vpc block driver (for VHD) to read/write multiple sectors atonce instead of doing a request for each single sector.
Before this, running qemu-iotests for VPC took ages, now it's actually quitereasonable to run it always (down from ~1 hour to 40 seconds for me)....
block/vpc: Fix conversion from size to disk geometry
The VHD algorithm calculates a disk geometrywhich is usually smaller than the requested size.
QEMU tried to round up but failed for certain sizes:
qemu-img create -f vpc disk.vpc 9437184would create an image with 9435136 bytes...
block: Open the underlying image file in generic code
Format drivers shouldn't need to bother with things like file names, but ratherjust get an open BlockDriverState for the underlying protocol. This patchintroduces this behaviour for bdrv_open implementation. For protocols which...
Fix spelling in comment.
The company which made Virtual PC was Connectix.They use the magic string "conectix" in their disk images.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eliminate errors about unused results in block/vpc.c
These errors come up when compiling with gcc-4.3.3 and some older headers:
/scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create':/scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used...
qemu-img: Print available options with -o ?
This patch adds a small help text to each of the options in the block driverswhich can be displayed by using qemu-img create -f fmt -o ?
Convert all block drivers to new bdrv_create
Now we can make use of the newly introduced option structures. Instead ofhaving bdrv_create carry more and more parameters (which are format specific inmost cases), just pass a option structure as defined by the driver itself....
Move block drivers into their own directory