[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] a5c5ea: raw-posix: Fix /dev/cdrom magic on OS
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] a5c5ea: raw-posix: Fix /dev/cdrom magic on OS X |
Date: |
Fri, 28 Jun 2013 10:00:15 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: a5c5ea3f60c000bf18c99435439533728a5f34a2
https://github.com/qemu/qemu/commit/a5c5ea3f60c000bf18c99435439533728a5f34a2
Author: Kevin Wolf <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/raw-posix.c
Log Message:
-----------
raw-posix: Fix /dev/cdrom magic on OS X
The raw-posix driver has code to provide a /dev/cdrom on OS X even
though it doesn't really exist. However, since commit c66a6157 the real
filename is dismissed after finding it, so opening /dev/cdrom fails.
Put the filename back into the options QDict to make this work again.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Commit: 5dae8e5fb803f53fadc116cefe353953b938cbe1
https://github.com/qemu/qemu/commit/5dae8e5fb803f53fadc116cefe353953b938cbe1
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M include/qemu/notify.h
M util/notify.c
Log Message:
-----------
notify: add NotiferWithReturn so notifier list can abort
notifier_list_notify() has no return value. This is fine when we just
want to invoke side-effects.
Sometimes it's useful for notifiers to produce a return value. This
allows notifiers to "veto" an operation and will be used by the block
layer before-write notifier.
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: d616b224745b2c522f965cf8de7da17b553b959a
https://github.com/qemu/qemu/commit/d616b224745b2c522f965cf8de7da17b553b959a
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block.c
M include/block/block_int.h
Log Message:
-----------
block: add bdrv_add_before_write_notifier()
The bdrv_add_before_write_notifier() function installs a callback that
is invoked before a write request is processed. This will be used to
implement copy-on-write point-in-time snapshots where we need to copy
out old data before overwriting it.
Note that BdrvTrackedRequest is moved to block_int.h since it is passed
to .notify() functions.
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 98d2c6f2cd80afaa2dc10091f5e35a97c181e4f5
https://github.com/qemu/qemu/commit/98d2c6f2cd80afaa2dc10091f5e35a97c181e4f5
Author: Dietmar Maurer <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/Makefile.objs
A block/backup.c
M include/block/block_int.h
M trace-events
Log Message:
-----------
block: add basic backup support to block driver
backup_start() creates a block job that copies a point-in-time snapshot
of a block device to a target block device.
We call backup_do_cow() for each write during backup. That function
reads the original data from the block device before it gets
overwritten. The data is then written to the target device.
Currently backup cluster size is hardcoded to 65536 bytes.
[I made a number of changes to Dietmar's original patch and folded them
in to make code review easy. Here is the full list:
* Drop BackupDumpFunc interface in favor of a target block device
* Detect zero clusters with buffer_is_zero() and use bdrv_co_write_zeroes()
* Use 0 delay instead of 1us, like other block jobs
* Unify creation/start functions into backup_start()
* Simplify cleanup, free bitmap in backup_run() instead of cb
* function
* Use HBitmap to avoid duplicating bitmap code
* Use bdrv_getlength() instead of accessing ->total_sectors
* directly
* Delete the backup.h header file, it is no longer necessary
* Move ./backup.c to block/backup.c
* Remove #ifdefed out code
* Coding style and whitespace cleanups
* Use bdrv_add_before_write_notifier() instead of blockjob-specific hooks
* Keep our own in-flight CowRequest list instead of using block.c
tracked requests. This means a little code duplication but is much
simpler than trying to share the tracked requests list and use the
backup block size.
* Add on_source_error and on_target_error error handling.
* Use trace events instead of DPRINTF()
-- stefanha]
Signed-off-by: Dietmar Maurer <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: cb78466ef60ccf707a6f38a1294c435b65a828e0
https://github.com/qemu/qemu/commit/cb78466ef60ccf707a6f38a1294c435b65a828e0
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
Log Message:
-----------
blockdev: drop redundant proto_drv check
It is not necessary to check that we can find a protocol block driver
since we create or open the image file. This produces the error that we
need anyway.
Besides, the QERR_INVALID_BLOCK_FORMAT is inappropriate since the
protocol is incorrect rather than the format.
Also drop an empty line between bdrv_open() and checking its return
value. This may be due to copy-pasting from earlier code that performed
other operations before handling errors.
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Wenchao Xia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: ac3c5d831aa0ff796659300e186be1a35862dbd3
https://github.com/qemu/qemu/commit/ac3c5d831aa0ff796659300e186be1a35862dbd3
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
Log Message:
-----------
blockdev: use bdrv_getlength() in qmp_drive_mirror()
Use bdrv_getlength() for its byte units and error return instead of
bdrv_get_geometry().
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 99a9addf567e31244d934376060dd1d34f0f012c
https://github.com/qemu/qemu/commit/99a9addf567e31244d934376060dd1d34f0f012c
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
M qapi-schema.json
M qmp-commands.hx
Log Message:
-----------
block: add drive-backup QMP command
@drive-backup
Start a point-in-time copy of a block device to a new destination. The
status of ongoing drive-backup operations can be checked with
query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
The operation can be stopped before it has completed using the
block-job-cancel command.
@device: the name of the device which should be copied.
@target: the target of the new image. If the file exists, or if it
is a device, the existing file/device will be used as the new
destination. If it does not exist, a new file will be created.
@format: #optional the format of the new destination, default is to
probe if @mode is 'existing', else the format of the source
@mode: #optional whether and how QEMU should create a new image, default is
'absolute-paths'.
@speed: #optional the maximum speed, in bytes per second
@on-source-error: #optional the action to take on an error on the source,
default 'report'. 'stop' and 'enospc' can only be used
if the block device supports io-status (see BlockInfo).
@on-target-error: #optional the action to take on an error on the target,
default 'report' (no limitations, since this applies to
a different block device than @device).
Note that @on-source-error and @on-target-error only affect background I/O.
If an error occurs during a guest write request, the device's rerror/werror
actions will be used.
Returns: nothing on success
If @device is not a valid block device, DeviceNotFound
Since 1.6
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: ba5d6ab68f7bc55520cddd5e00bd48b041c7aecd
https://github.com/qemu/qemu/commit/ba5d6ab68f7bc55520cddd5e00bd48b041c7aecd
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
Log Message:
-----------
blockdev: rename BlkTransactionStates to singular
The QMP 'transaction' command keeps a list of in-flight transactions.
The transaction state structure is called BlkTransactionStates even
though it only deals with a single transaction. The only plural thing
is the linked list of transaction states.
I find it confusing to call the single structure "States". This patch
renames it to "State", just like BlockDriverState is singular.
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: f9ea81e82519f44071b3dd617de98f0d6d6cca0a
https://github.com/qemu/qemu/commit/f9ea81e82519f44071b3dd617de98f0d6d6cca0a
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
Log Message:
-----------
blockdev: allow BdrvActionOps->commit() to be NULL
Some QMP 'transaction' types don't need to do anything on .commit().
Make .commit() optional just like .abort().
The "drive-backup" action will take advantage of this, it only needs to
cancel the block job on .abort(). Other block job actions will probably
follow the same pattern, so allow .commit() to be NULL.
Suggested-by: Eric Blake <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 3037f36446eb3556c14757ac468463c3902f331b
https://github.com/qemu/qemu/commit/3037f36446eb3556c14757ac468463c3902f331b
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
M qapi-schema.json
Log Message:
-----------
blockdev: add DriveBackup transaction
This patch adds a transactional version of the drive-backup QMP command.
It allows atomic snapshots of multiple drives along with automatic
cleanup if there is a failure to start one of the backup jobs.
Note that QMP events are emitted for block job completion/cancellation
and the block job will be listed by query-block-jobs.
@device: the name of the device whose writes should be mirrored.
@target: the target of the new image. If the file exists, or if it
is a device, the existing file/device will be used as the new
destination. If it does not exist, a new file will be created.
@format: #optional the format of the new destination, default is to
probe if @mode is 'existing', else the format of the source
@mode: #optional whether and how QEMU should create a new image, default is
'absolute-paths'.
@speed: #optional the maximum speed, in bytes per second
@on-source-error: #optional the action to take on an error on the source,
default 'report'. 'stop' and 'enospc' can only be used
if the block device supports io-status (see BlockInfo).
@on-target-error: #optional the action to take on an error on the target,
default 'report' (no limitations, since this applies to
a different block device than @device).
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 78b18b78aa89c28aecbd007ae1967c978d39bfd6
https://github.com/qemu/qemu/commit/78b18b78aa89c28aecbd007ae1967c978d39bfd6
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M blockdev.c
M qapi-schema.json
Log Message:
-----------
blockdev: add Abort transaction
The Abort action can be used to test QMP 'transaction' failure. Add it
as the last action to exercise the .abort() and .cleanup() code paths
for all previous actions.
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 0dbe8a1b042b5eb22c6587dcc9884ebe8cedcbb6
https://github.com/qemu/qemu/commit/0dbe8a1b042b5eb22c6587dcc9884ebe8cedcbb6
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M tests/qemu-iotests/041
M tests/qemu-iotests/iotests.py
Log Message:
-----------
qemu-iotests: extract wait_until_completed() into iotests.py
The 'drive-mirror' tests often issue 'block-job-complete' and wait for
the QMP completion event. Other types of block jobs also want to wait
for completion but they may not need to issue 'block-job-complete'.
Extract wait_until_completed() from 041 and put it into iotests.py.
Return the QMP event object so the caller can make additional
assertions, if necessary.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: e5ca8fdd407431e281c6f303dc9f45f63a28048f
https://github.com/qemu/qemu/commit/e5ca8fdd407431e281c6f303dc9f45f63a28048f
Author: Stefan Hajnoczi <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
A tests/qemu-iotests/055
A tests/qemu-iotests/055.out
M tests/qemu-iotests/group
Log Message:
-----------
qemu-iotests: add 055 drive-backup test case
Testing drive-backup is similar to image streaming and drive mirroring.
This test case is based on 041.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: f59fee8d509b446df24843c1145a99b740492725
https://github.com/qemu/qemu/commit/f59fee8d509b446df24843c1145a99b740492725
Author: Kevin Wolf <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/commit.c
M block/mirror.c
M block/stream.c
Log Message:
-----------
block: Make BlockJobTypes const
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 0b3f21e6a99c025c829d342ee417f317fe2e03b2
https://github.com/qemu/qemu/commit/0b3f21e6a99c025c829d342ee417f317fe2e03b2
Author: Richard W.M. Jones <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/ssh.c
Log Message:
-----------
block/ssh: Set bdrv_has_zero_init according to the file type.
If the remote is a regular file, set it to true (ie. reads of
uninitialized areas in a newly created file will return zeroes).
If we can't prove that, return false (a safe default).
Tested by adding a debugging print statement [not part of this commit]
and creating a remote file and a remote block device:
$ ./qemu-img create ssh://localhost/tmp/new 100M
Formatting 'ssh://localhost/tmp/new', fmt=raw size=104857600
filename ssh://localhost/tmp/new: has_zero_init = 1
$ sudo lvcreate -L 1G -n tmp /dev/fedora
Logical volume "tmp" created
$ ./qemu-img create ssh://localhost/dev/fedora/tmp 1G
Formatting 'ssh://localhost/dev/fedora/tmp', fmt=raw size=1073741824
filename ssh://localhost/dev/fedora/tmp: has_zero_init = 0
Cc: Kevin Wolf <address@hidden>
Cc: address@hidden
Signed-off-by: Richard W.M. Jones <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 8ab6feec2c7500faafd9a4571fb40d03dd360a64
https://github.com/qemu/qemu/commit/8ab6feec2c7500faafd9a4571fb40d03dd360a64
Author: Kevin Wolf <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/gluster.c
Log Message:
-----------
gluster: Return bdrv_has_zero_init = 0
GlusterFS volumes can be backed by block devices, in which case
bdrv_create() doesn't make sure that the image is zeroed out. It is
currently not possibly to detect whether a given image is backed by a
file or a block device, and incorrectly assuming that it is zeroed
corrupts images during qemu-img convert, so let's err on the side of
caution and always return 0.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 8ed610a1c983dd2ed1eed8841036af55751d115f
https://github.com/qemu/qemu/commit/8ed610a1c983dd2ed1eed8841036af55751d115f
Author: Fam Zheng <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/vmdk.c
Log Message:
-----------
vmdk: remove wrong calculation of relative path
When creating image with backing file, the driver tries to calculate the
relative path from created image file to backing file, but the path
computation is incorrect. e.g.:
$ qemu-img create -f vmdk -b vmdk-data-disk.vmdk vmdk-data-snapshot1
Formatting 'vmdk-data-snapshot1', fmt=vmdk size=10737418240
backing_file='vmdk-data-disk.vmdk' compat6=off zeroed_grain=off
$ qemu-img info vmdk-data-snapshot1
image: vmdk-data-snapshot1
file format: vmdk
virtual size: 10G (10737418240 bytes)
disk size: 12K
-> backing file: disk.vmdk
The common part in file names, "vmdk-data-", is incorrectly forgotten by
relative_path(). As the VMDK specification has no restriction on
parentNameHint to be relative path, we simply remove this by using the
backing_file option.
Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 72c6cc94daa727f41ecfc2b2ff94aa6f0e459b7f
https://github.com/qemu/qemu/commit/72c6cc94daa727f41ecfc2b2ff94aa6f0e459b7f
Author: Kevin Wolf <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block/vpc.c
Log Message:
-----------
vpc: Implement .bdrv_has_zero_init
Depending on the subformat, has_zero_init on VHD must behave like raw
and query the underlying storage (fixed) or like other sparse formats
that can always return 1 (dynamic, differencing).
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 3ac216270a62418519c08e88c17005a8f1539cf2
https://github.com/qemu/qemu/commit/3ac216270a62418519c08e88c17005a8f1539cf2
Author: Peter Lieven <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block.c
M block/cow.c
M block/qcow.c
M block/qcow2.c
M block/qed.c
M block/raw-posix.c
M block/raw-win32.c
M block/rbd.c
M block/sheepdog.c
M block/vdi.c
M include/block/block.h
Log Message:
-----------
block: change default of .has_zero_init to 0
.has_zero_init defaults to 1 for all formats and protocols.
this is a dangerous default since this means that all
new added drivers need to manually overwrite it to 0 if
they do not ensure that a device is zero initialized
after bdrv_create().
if a driver needs to explicitly set this value to
1 its easier to verify the correctness in the review process.
during review of the existing drivers it turned out
that ssh and gluster had a wrong default of 1.
both protocols support host_devices as backend
which are not by default zero initialized. this
wrong assumption will lead to possible corruption
if qemu-img convert is used to write to such a backend.
vpc and vmdk also defaulted to 1 altough they support
fixed respectively flat extends. this has to be addresses
in separate patches. both formats as well as the mentioned
ssh and gluster are turned to the default of 0 with this
patch for safety.
a similar problem with the wrong default existed for
iscsi most likely because the driver developer did
oversee the default value of 1.
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 721da65c6eba9c053d73744ecaa882b0f7cd634a
https://github.com/qemu/qemu/commit/721da65c6eba9c053d73744ecaa882b0f7cd634a
Author: Mark Cave-Ayland <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M hw/ide/cmd646.c
Log Message:
-----------
cmd646: fix build when DEBUG_IDE is enabled.
Make sure we use the correct TARGET/PRI macros in the debug statements.
Signed-off-by: Mark Cave-Ayland <address@hidden>
CC: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Commit: 36125631e79d53ffb9365740f43f386e2171d116
https://github.com/qemu/qemu/commit/36125631e79d53ffb9365740f43f386e2171d116
Author: Anthony Liguori <address@hidden>
Date: 2013-06-28 (Fri, 28 Jun 2013)
Changed paths:
M block.c
M block/Makefile.objs
A block/backup.c
M block/commit.c
M block/cow.c
M block/gluster.c
M block/mirror.c
M block/qcow.c
M block/qcow2.c
M block/qed.c
M block/raw-posix.c
M block/raw-win32.c
M block/rbd.c
M block/sheepdog.c
M block/ssh.c
M block/stream.c
M block/vdi.c
M block/vmdk.c
M block/vpc.c
M blockdev.c
M hw/ide/cmd646.c
M include/block/block.h
M include/block/block_int.h
M include/qemu/notify.h
M qapi-schema.json
M qmp-commands.hx
M tests/qemu-iotests/041
A tests/qemu-iotests/055
A tests/qemu-iotests/055.out
M tests/qemu-iotests/group
M tests/qemu-iotests/iotests.py
M trace-events
M util/notify.c
Log Message:
-----------
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Stefan Hajnoczi (11) and others
# Via Kevin Wolf
* kwolf/for-anthony:
cmd646: fix build when DEBUG_IDE is enabled.
block: change default of .has_zero_init to 0
vpc: Implement .bdrv_has_zero_init
vmdk: remove wrong calculation of relative path
gluster: Return bdrv_has_zero_init = 0
block/ssh: Set bdrv_has_zero_init according to the file type.
block: Make BlockJobTypes const
qemu-iotests: add 055 drive-backup test case
qemu-iotests: extract wait_until_completed() into iotests.py
blockdev: add Abort transaction
blockdev: add DriveBackup transaction
blockdev: allow BdrvActionOps->commit() to be NULL
blockdev: rename BlkTransactionStates to singular
block: add drive-backup QMP command
blockdev: use bdrv_getlength() in qmp_drive_mirror()
blockdev: drop redundant proto_drv check
block: add basic backup support to block driver
block: add bdrv_add_before_write_notifier()
notify: add NotiferWithReturn so notifier list can abort
raw-posix: Fix /dev/cdrom magic on OS X
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>
Compare: https://github.com/qemu/qemu/compare/ec3f8c9913c1...36125631e79d
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] a5c5ea: raw-posix: Fix /dev/cdrom magic on OS X,
GitHub <=