mirror of https://gitee.com/openkylin/qemu.git
qemu.py: use os.path.null instead of /dev/null
For increased portability, let's use os.path.devnull. Signed-off-by: Amador Pahim <apahim@redhat.com> Message-Id: <20170901112829.2571-4-apahim@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
4738b0a85a
commit
63e0ba5522
|
@ -124,7 +124,7 @@ def send_fd_scm(self, fd_file_path):
|
|||
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 @@ def _post_shutdown(self):
|
|||
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue