]> Git Repo - qemu.git/commitdiff
qemu.py: use os.path.null instead of /dev/null
authorAmador Pahim <[email protected]>
Fri, 1 Sep 2017 11:28:19 +0000 (13:28 +0200)
committerEduardo Habkost <[email protected]>
Fri, 15 Sep 2017 23:12:00 +0000 (20:12 -0300)
For increased portability, let's use os.path.devnull.

Signed-off-by: Amador Pahim <[email protected]>
Message-Id: <20170901112829[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
scripts/qemu.py

index 8d3d24dd2b864a89454ffaf42946ef1d124086b6..c9bcaafe41851a2582e312b6af974b8584800025 100644 (file)
@@ -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()
This page took 0.026618 seconds and 4 git commands to generate.