提交 63e0ba55 编写于 作者: A Amador Pahim 提交者: Eduardo Habkost

qemu.py: use os.path.null instead of /dev/null

For increased portability, let's use os.path.devnull.
Signed-off-by: NAmador Pahim <apahim@redhat.com>
Message-Id: <20170901112829.2571-4-apahim@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 4738b0a8
......@@ -124,7 +124,7 @@ class QEMUMachine(object):
fd_param = ["%s" % self._socket_scm_helper,
"%d" % self._qmp.get_sock_fd(),
"%s" % fd_file_path]
devnull = open('/dev/null', 'rb')
devnull = open(os.path.devnull, 'rb')
proc = subprocess.Popen(fd_param, stdin=devnull, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
output = proc.communicate()[0]
......@@ -186,7 +186,7 @@ class QEMUMachine(object):
def launch(self):
'''Launch the VM and establish a QMP connection'''
devnull = open('/dev/null', 'rb')
devnull = open(os.path.devnull, 'rb')
qemulog = open(self._qemu_log_path, 'wb')
try:
self._pre_launch()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册