diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-04-04 00:42:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-04-04 00:42:23 +0000 |
| commit | 01b9cece5ca4232648ca305eb7e08e8b45176426 (patch) | |
| tree | 37c3176c42fc23911afdc920f151690415b8db6c /nova/virt | |
| parent | 06407be0da134db23cfd02fe320caa5c444315c2 (diff) | |
| parent | cf7c0a7c10723495953be9bf99aedbe3838e0787 (diff) | |
Merge "Get unit tests functional in OS X"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/connection.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index 5d27c6f5a..3c4bbb016 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -988,7 +988,13 @@ class LibvirtConnection(driver.ComputeDriver): @staticmethod def _supports_direct_io(dirpath): + + if not hasattr(os, 'O_DIRECT'): + LOG.debug("This python runtime does not support direct I/O") + return False + testfile = os.path.join(dirpath, ".directio.test") + hasDirectIO = True try: f = os.open(testfile, os.O_CREAT | os.O_WRONLY | os.O_DIRECT) |
