- 03 5月, 2010 1 次提交
-
-
由 Christoph Hellwig 提交于
We're running into various problems because the "raw" file access, which is used internally by the various image formats is entangled with the "raw" image format, which maps the VM view 1:1 to a file system. This patch renames the raw file backends to the file protocol which is treated like other protocols (e.g. nbd and http) and adds a new "raw" image format which is just a wrapper around calls to the underlying protocol. The patch is surprisingly simple, besides changing the probing logical in block.c to only look for image formats when using bdrv_open and renaming of the old raw protocols to file there's almost nothing in there. For creating images, a new bdrv_create_file is introduced which guesses the protocol to use. This allows using qemu-img create -f raw (or just using the default) for both files and host devices. Converting the other format drivers to use this function to create their images is left for later patches. The only issues still open are in the handling of the host devices. Firstly in current qemu we can specifiy the host* format names on various command line acceping images, but the new code can't do that without adding some translation. Second the layering breaks the no_zero_init flag in the BlockDriver used by qemu-img. I'm not happy how this is done per-driver instead of per-state so I'll prepare a separate patch to clean this up. There's some more cleanup opportunity after this patch, e.g. using separate lists and registration functions for image formats vs protocols and maybe even host drivers, but this can be done at a later stage. Also there's a check for protocol in bdrv_open for the BDRV_O_SNAPSHOT case that I don't quite understand, but which I fear won't work as expected - possibly even before this patch. Note that this patch requires various recent block patches from Kevin and me, which should all be in his block queue. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 23 4月, 2010 7 次提交
-
-
由 Stefan Hajnoczi 提交于
A new iovec array is allocated when creating a merged write request. This patch ensures that the iovec array is deleted in addition to its qiov owner. Reported-by: NLeszek Urbanski <tygrys@moo.pl> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Stefan Hajnoczi 提交于
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Stefan Hajnoczi 提交于
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Stefan Hajnoczi 提交于
The bdrv_first linked list of BlockDriverStates is currently extern so that block migration can iterate the list. However, since there is already a bdrv_iterate() function there is no need to expose bdrv_first. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Christoph Hellwig 提交于
BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open. It affects two things: first bdrv_open only searches for protocols using find_protocol instead of all image formats and host drivers. We can easily move that to the caller and pass the found driver to bdrv_open. Second it is used to not force a read-write open of a snapshot file. But we never use bdrv_file_open to open snapshots and this behaviour doesn't make sense to start with. qemu-io abused the BDRV_O_FILE for it's growable option, switch it to using bdrv_file_open to make sure we only open files as growable were we can actually support that. This patch requires Kevin's "[PATCH] Replace calls of old bdrv_open" to be applied first. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Kevin Wolf 提交于
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Kevin Wolf 提交于
Block drivers can trigger a blkdebug event whenever they reach a place where it could be useful to inject an error for testing/debugging purposes. Rules are read from a blkdebug config file and describe which action is taken when an event is triggered. For now this is only injecting an error (with a few options) or changing the state (which is an integer). Rules can be declared to be active only in a specific state; this way later rules can distiguish on which path we came to trigger their event. Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 10 4月, 2010 3 次提交
-
-
由 Kevin Wolf 提交于
Previously multiwrite_user_cb was never called if a request in the multiwrite batch failed right away because it did set mcb->error immediately. Make it look more like a normal callback to fix this. Reported-by: NJuan Quintela <quintela@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
由 Kevin Wolf 提交于
Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
由 Kevin Wolf 提交于
When two requests of the same multiwrite batch fail, the callback of all requests in that batch were called twice. This could have any kind of nasty effects, in my case it lead to use after free and eventually a segfault. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
- 17 3月, 2010 1 次提交
-
-
由 Shahar Havivi 提交于
Signed-off-by: NShahar Havivi <shaharh@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 20 2月, 2010 1 次提交
-
-
由 Naphtali Sprei 提交于
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. Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 11 2月, 2010 3 次提交
-
-
由 Luiz Capitulino 提交于
It's not needed to check the return of qobject_from_jsonf() anymore, as an assert() has been added there. Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Christoph Hellwig 提交于
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, but wasn't ever used. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Luiz Capitulino 提交于
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: - device name - operation (ie. "read" or "write") - action taken (eg. "stop") Event example: { "event": "BLOCK_IO_ERROR", "data": { "device": "ide0-hd1", "operation": "write", "action": "stop" }, "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 10 2月, 2010 1 次提交
-
-
由 Liran Schour 提交于
This will manage dirty counter for each device and will allow to get the dirty counter from above. Signed-off-by: NLiran Schour <lirans@il.ibm.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 27 1月, 2010 5 次提交
-
-
由 Christoph Hellwig 提交于
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 the same 1024 define that's used on Linux and various other platforms, but until the windows block backend implements some kind of vectored I/O it doesn't matter. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Herve Poussineau 提交于
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. Signed-off-by: NHerve Poussineau <hpoussin@reactos.org> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Christoph Hellwig 提交于
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: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Naphtali Sprei 提交于
Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Kevin Wolf 提交于
Don't assume -EIO but return the real error. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 21 1月, 2010 1 次提交
-
-
由 Anthony Liguori 提交于
This reverts commit 0076bc0c. Kevin Wolf pointed out that this breaks the mingw32 build. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 20 1月, 2010 4 次提交
-
-
由 Christoph Hellwig 提交于
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: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Christoph Hellwig 提交于
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Naphtali Sprei 提交于
Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 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, pass the request in the flags parameter to the function. Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 14 1月, 2010 3 次提交
-
-
由 Christoph Hellwig 提交于
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: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Kevin Wolf 提交于
Introduce the functions needed to change the backing file of an image. The function is implemented for qcow2. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Kevin Wolf 提交于
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 opening the image. qemu-img info is the first user and provides info now even if the backing file is invalid. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 26 12月, 2009 1 次提交
-
-
由 Kirill A. Shutemov 提交于
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: NKirill A. Shutemov <kirill@shutemov.name> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 12 12月, 2009 2 次提交
-
-
由 Luiz Capitulino 提交于
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: NLuiz Capitulino <lcapitulino@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Luiz Capitulino 提交于
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: NLuiz Capitulino <lcapitulino@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 04 12月, 2009 3 次提交
-
-
由 Jan Kiszka 提交于
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 dirty_tracking field from BlockDriverState. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
No functional changes. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 17 11月, 2009 1 次提交
-
-
由 lirans@il.ibm.com 提交于
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. - Minor coding style issues. - Block.c will now manage a dirty bitmap per device once bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper layer (block-migration.c). Signed-off-by: NLiran Schour <lirans@il.ibm.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 09 11月, 2009 2 次提交
-
-
由 Markus Armbruster 提交于
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. This patch provides an optional block format whitelist, default off. If a whitelist is configured with --block-drv-whitelist, QEMU proper can use only whitelisted formats. Other programs, like qemu-img, are not affected. Drivers for formats off the whitelist still participate in format probing, to ensure all programs probe exactly the same. Without that, QEMU proper would be prone to treat images with a format off the whitelist as raw when the image's format is probed. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Naphtali Sprei 提交于
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. This enables sharing same image between guests, with readonly access. Implementaion mark the drive as read_only and changes the flags when actually opening the file. The readonly attribute of a qcow also passed to it's base file. For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag. Also, return error code from bdrv_truncate for readonly drive. Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 28 10月, 2009 1 次提交
-
-
由 Kevin Wolf 提交于
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: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-