block.c (62392ebb09fc6e87626aa151a616f24c4e921493) | block.c (4c9dfe5d8a7eb956513593720b8d1a9ca2c5a7f9) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 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 --- 1706 unchanged lines hidden (view full) --- 1715 old_options = qdict_clone_shallow(bs->options); 1716 bdrv_join_options(bs, options, old_options); 1717 QDECREF(old_options); 1718 1719 /* bdrv_open() masks this flag out */ 1720 flags &= ~BDRV_O_PROTOCOL; 1721 1722 QLIST_FOREACH(child, &bs->children, next) { | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 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 --- 1706 unchanged lines hidden (view full) --- 1715 old_options = qdict_clone_shallow(bs->options); 1716 bdrv_join_options(bs, options, old_options); 1717 QDECREF(old_options); 1718 1719 /* bdrv_open() masks this flag out */ 1720 flags &= ~BDRV_O_PROTOCOL; 1721 1722 QLIST_FOREACH(child, &bs->children, next) { |
1723 QDict *new_child_options; 1724 char *child_key_dot; |
|
1723 int child_flags; 1724 | 1725 int child_flags; 1726 |
1727 /* reopen can only change the options of block devices that were 1728 * implicitly created and inherited options. For other (referenced) 1729 * block devices, a syntax like "backing.foo" results in an error. */ |
|
1725 if (child->bs->inherits_from != bs) { 1726 continue; 1727 } 1728 | 1730 if (child->bs->inherits_from != bs) { 1731 continue; 1732 } 1733 |
1734 child_key_dot = g_strdup_printf("%s.", child->name); 1735 qdict_extract_subqdict(options, &new_child_options, child_key_dot); 1736 g_free(child_key_dot); 1737 |
|
1729 child_flags = child->role->inherit_flags(flags); | 1738 child_flags = child->role->inherit_flags(flags); |
1730 /* TODO Pass down child flags (backing.*, extents.*, ...) */ 1731 bdrv_reopen_queue(bs_queue, child->bs, NULL, child_flags); | 1739 bdrv_reopen_queue(bs_queue, child->bs, new_child_options, child_flags); |
1732 } 1733 1734 bs_entry = g_new0(BlockReopenQueueEntry, 1); 1735 QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry); 1736 1737 bs_entry->state.bs = bs; 1738 bs_entry->state.options = options; 1739 bs_entry->state.flags = flags; --- 2388 unchanged lines hidden --- | 1740 } 1741 1742 bs_entry = g_new0(BlockReopenQueueEntry, 1); 1743 QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry); 1744 1745 bs_entry->state.bs = bs; 1746 bs_entry->state.options = options; 1747 bs_entry->state.flags = flags; --- 2388 unchanged lines hidden --- |