file-posix.c (3753e255da8f6a654c3e7b650a2d27734bec15f9) file-posix.c (03c320d803fd881736b63015048498cf97d410d3)
1/*
2 * Block driver for RAW files (posix)
3 *
4 * Copyright (c) 2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 367 unchanged lines hidden (view full) ---

376 if ((bdrv_flags & BDRV_O_NOCACHE)) {
377 *open_flags |= O_DIRECT;
378 }
379}
380
381static void raw_parse_filename(const char *filename, QDict *options,
382 Error **errp)
383{
1/*
2 * Block driver for RAW files (posix)
3 *
4 * Copyright (c) 2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 367 unchanged lines hidden (view full) ---

376 if ((bdrv_flags & BDRV_O_NOCACHE)) {
377 *open_flags |= O_DIRECT;
378 }
379}
380
381static void raw_parse_filename(const char *filename, QDict *options,
382 Error **errp)
383{
384 /* The filename does not have to be prefixed by the protocol name, since
385 * "file" is the default protocol; therefore, the return value of this
386 * function call can be ignored. */
387 strstart(filename, "file:", &filename);
388
389 qdict_put_str(options, "filename", filename);
384 bdrv_parse_filename_strip_prefix(filename, "file:", options);
390}
391
392static QemuOptsList raw_runtime_opts = {
393 .name = "raw",
394 .head = QTAILQ_HEAD_INITIALIZER(raw_runtime_opts.head),
395 .desc = {
396 {
397 .name = "filename",

--- 1992 unchanged lines hidden (view full) ---

2390 }
2391#endif /* defined(BLKROGET) */
2392 return 0;
2393}
2394
2395static void hdev_parse_filename(const char *filename, QDict *options,
2396 Error **errp)
2397{
385}
386
387static QemuOptsList raw_runtime_opts = {
388 .name = "raw",
389 .head = QTAILQ_HEAD_INITIALIZER(raw_runtime_opts.head),
390 .desc = {
391 {
392 .name = "filename",

--- 1992 unchanged lines hidden (view full) ---

2385 }
2386#endif /* defined(BLKROGET) */
2387 return 0;
2388}
2389
2390static void hdev_parse_filename(const char *filename, QDict *options,
2391 Error **errp)
2392{
2398 /* The prefix is optional, just as for "file". */
2399 strstart(filename, "host_device:", &filename);
2400
2401 qdict_put_str(options, "filename", filename);
2393 bdrv_parse_filename_strip_prefix(filename, "host_device:", options);
2402}
2403
2404static bool hdev_is_sg(BlockDriverState *bs)
2405{
2406
2407#if defined(__linux__)
2408
2409 BDRVRawState *s = bs->opaque;

--- 282 unchanged lines hidden (view full) ---

2692 .bdrv_aio_ioctl = hdev_aio_ioctl,
2693#endif
2694};
2695
2696#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
2697static void cdrom_parse_filename(const char *filename, QDict *options,
2698 Error **errp)
2699{
2394}
2395
2396static bool hdev_is_sg(BlockDriverState *bs)
2397{
2398
2399#if defined(__linux__)
2400
2401 BDRVRawState *s = bs->opaque;

--- 282 unchanged lines hidden (view full) ---

2684 .bdrv_aio_ioctl = hdev_aio_ioctl,
2685#endif
2686};
2687
2688#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
2689static void cdrom_parse_filename(const char *filename, QDict *options,
2690 Error **errp)
2691{
2700 /* The prefix is optional, just as for "file". */
2701 strstart(filename, "host_cdrom:", &filename);
2702
2703 qdict_put_str(options, "filename", filename);
2692 bdrv_parse_filename_strip_prefix(filename, "host_cdrom:", options);
2704}
2705#endif
2706
2707#ifdef __linux__
2708static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
2709 Error **errp)
2710{
2711 BDRVRawState *s = bs->opaque;

--- 251 unchanged lines hidden ---
2693}
2694#endif
2695
2696#ifdef __linux__
2697static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
2698 Error **errp)
2699{
2700 BDRVRawState *s = bs->opaque;

--- 251 unchanged lines hidden ---