Message ID | 20180419164642.9536-5-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | avocado: Add acceptance tests parsing the Linux boot console | expand |
On 04/19/2018 12:46 PM, Philippe Mathieu-Daudé wrote: > We already have secure temporary directory created with tempfile.mkdtemp(). > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > scripts/qemu.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/scripts/qemu.py b/scripts/qemu.py > index 379767b62f..26c4b1fd3b 100644 > --- a/scripts/qemu.py > +++ b/scripts/qemu.py > @@ -201,7 +201,8 @@ class QEMUMachine(object): > > chardev = 'socket,id=console,{address},server,nowait' > if console_address is None: > - console_address = tempfile.mktemp() > + console_address = os.path.join(self._temp_dir, > + self._name + "-console.sock") > chardev = chardev.format(address='path=%s' % > console_address) > elif isinstance(console_address, tuple): > Acked-by: Cleber Rosa <crosa@redhat.com>
diff --git a/scripts/qemu.py b/scripts/qemu.py index 379767b62f..26c4b1fd3b 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -201,7 +201,8 @@ class QEMUMachine(object): chardev = 'socket,id=console,{address},server,nowait' if console_address is None: - console_address = tempfile.mktemp() + console_address = os.path.join(self._temp_dir, + self._name + "-console.sock") chardev = chardev.format(address='path=%s' % console_address) elif isinstance(console_address, tuple):
We already have secure temporary directory created with tempfile.mkdtemp(). Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- scripts/qemu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)