* [Qemu-devel] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options
@ 2015-11-21 0:17 Programmingkid
2015-11-24 14:39 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Programmingkid @ 2015-11-21 0:17 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel qemu-devel; +Cc: Qemu-block
Add support for caching options that can be specified from
the command line.
Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
Only location of code has been changed.
block/raw-posix.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index aec9ec6..ccfec1c 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1976,8 +1976,8 @@ BlockDriver bdrv_file = {
#if defined(__APPLE__) && defined(__MACH__)
static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
-static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
-
+static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath,
+ CFIndex maxPathSize, int flags);
kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator )
{
kern_return_t kernResult;
@@ -2004,7 +2004,8 @@ kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator )
return kernResult;
}
-kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize )
+kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath,
+ CFIndex maxPathSize, int flags)
{
io_object_t nextMedia;
kern_return_t kernResult = KERN_FAILURE;
@@ -2017,7 +2018,9 @@ kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex ma
if ( bsdPathAsCFString ) {
size_t devPathLength;
strcpy( bsdPath, _PATH_DEV );
- strcat( bsdPath, "r" );
+ if (flags & BDRV_O_NOCACHE) {
+ strcat(bsdPath, "r");
+ }
devPathLength = strlen( bsdPath );
if ( CFStringGetCString( bsdPathAsCFString, bsdPath + devPathLength, maxPathSize - devPathLength, kCFStringEncodingASCII ) ) {
kernResult = KERN_SUCCESS;
@@ -2129,8 +2132,8 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
int fd;
kernResult = FindEjectableCDMedia( &mediaIterator );
- kernResult = GetBSDPath( mediaIterator, bsdPath, sizeof( bsdPath ) );
-
+ kernResult = GetBSDPath(mediaIterator, bsdPath, sizeof(bsdPath),
+ flags);
if ( bsdPath[ 0 ] != '\0' ) {
strcat(bsdPath,"s0");
/* some CDs don't have a partition 0 */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options
2015-11-21 0:17 [Qemu-devel] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options Programmingkid
@ 2015-11-24 14:39 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2015-11-24 14:39 UTC (permalink / raw)
To: Programmingkid; +Cc: qemu-devel qemu-devel, Qemu-block
Am 21.11.2015 um 01:17 hat Programmingkid geschrieben:
> Add support for caching options that can be specified from
> the command line.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-24 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-21 0:17 [Qemu-devel] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options Programmingkid
2015-11-24 14:39 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).