Revision 41e794f6
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2008, 2009, 2010 Google Inc. |
|
4 |
# Copyright (C) 2008, 2009, 2010, 2011 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
534 | 534 |
if_val = ',if=%s' % disk_type |
535 | 535 |
# Cache mode |
536 | 536 |
disk_cache = hvp[constants.HV_DISK_CACHE] |
537 |
if disk_cache != constants.HT_CACHE_DEFAULT: |
|
537 |
if instance.disk_template in constants.DTS_EXT_MIRROR: |
|
538 |
if disk_cache != "none": |
|
539 |
# TODO: make this a hard error, instead of a silent overwrite |
|
540 |
logging.warning("KVM: overriding disk_cache setting '%s' with 'none'" |
|
541 |
" to prevent shared storage corruption on migration", |
|
542 |
disk_cache) |
|
543 |
cache_val = ",cache=none" |
|
544 |
elif disk_cache != constants.HT_CACHE_DEFAULT: |
|
538 | 545 |
cache_val = ",cache=%s" % disk_cache |
539 | 546 |
else: |
540 | 547 |
cache_val = "" |
Also available in: Unified diff