qemu/block.c
/*
 * Returns the options and flags that bs->file should get if a protocol driver
 * is expected, based on the given options and flags for the parent BDS
 */
Returns the options and flags that bs->file should get if a protocol driver
is expected, based on the given options and flags for the parent BDS
Returns the options and flags that bs - > file should get if a protocol driver is expected based on the given options and flags for the parent BDS
static void bdrv_inherited_options(int *child_flags, QDict *child_options,
                                   int parent_flags, QDict *parent_options)
{
    int flags = parent_flags;
    flags |= BDRV_O_PROTOCOL;
    qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_DIRECT);
    qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_NO_FLUSH);
    qdict_copy_default(child_options, parent_options, BDRV_OPT_FORCE_SHARE);
    qdict_copy_default(child_options, parent_options, BDRV_OPT_READ_ONLY);
    qdict_copy_default(child_options, parent_options, BDRV_OPT_AUTO_READ_ONLY);
    qdict_set_default_str(child_options, BDRV_OPT_DISCARD, "unmap");
    flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ |
               BDRV_O_NO_IO);
    *child_flags = flags;
}
static void bdrv_inherited_options ( int * child_flags , QDict * child_options , int parent_flags , QDict * parent_options ) { int flags = parent_flags ; flags |= BDRV_O_PROTOCOL ; qdict_copy_default ( child_options , parent_options , BDRV_OPT_CACHE_DIRECT ) ; qdict_copy_default ( child_options , parent_options , BDRV_OPT_CACHE_NO_FLUSH ) ; qdict_copy_default ( child_options , parent_options , BDRV_OPT_FORCE_SHARE ) ; qdict_copy_default ( child_options , parent_options , BDRV_OPT_READ_ONLY ) ; qdict_copy_default ( child_options , parent_options , BDRV_OPT_AUTO_READ_ONLY ) ; qdict_set_default_str ( child_options , BDRV_OPT_DISCARD , " " ) ; flags &= ~ ( BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ | BDRV_O_NO_IO ) ; * child_flags = flags ; }
Returns the options and flags that bs->file should get if a protocol driver
 is expected, based on the given options and flags for the parent BDS
Returns the options and flags that bs - > file should get if a protocol driver is expected based on the given options and flags for the parent BDS
/* Enable protocol handling, disable format probing for bs->file */ /* If the cache mode isn't explicitly set, inherit direct and no-flush from
     * the parent. */ /* Inherit the read-only option from the parent if it's not set */ /* Our block drivers take care to send flushes and respect unmap policy,
     * so we can default to enable both on lower layers regardless of the
     * corresponding parent options. */ /* Clear flags that only apply to the top layer */