[PATCH v6 3/4] python: add binary

Maksim Davydov posted 4 patches 1 year ago
Maintainers: Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Beraldo Leal <bleal@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Thomas Huth <thuth@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH v6 3/4] python: add binary
Posted by Maksim Davydov 1 year ago
Add a supportive property to access the path to the qemu binary

Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
---
 python/qemu/machine/machine.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 31cb9d617d..78436403b2 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -328,6 +328,11 @@ def args(self) -> List[str]:
         """Returns the list of arguments given to the QEMU binary."""
         return self._args
 
+    @property
+    def binary(self) -> str:
+        """Returns path to the qemu binary"""
+        return self._binary
+
     def _pre_launch(self) -> None:
         if self._qmp_set:
             if self._monitor_address is None:
-- 
2.34.1
Re: [PATCH v6 3/4] python: add binary
Posted by Philippe Mathieu-Daudé 1 year ago
On 8/11/23 16:38, Maksim Davydov wrote:
> Add a supportive property to access the path to the qemu binary
> 
> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
> ---
>   python/qemu/machine/machine.py | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
> index 31cb9d617d..78436403b2 100644
> --- a/python/qemu/machine/machine.py
> +++ b/python/qemu/machine/machine.py
> @@ -328,6 +328,11 @@ def args(self) -> List[str]:
>           """Returns the list of arguments given to the QEMU binary."""
>           return self._args
>   
> +    @property
> +    def binary(self) -> str:
> +        """Returns path to the qemu binary"""
> +        return self._binary
> +
>       def _pre_launch(self) -> None:
>           if self._qmp_set:
>               if self._monitor_address is None:

Better patch subject could be:
"python/qemu/machine: Add method to retrieve QEMUMachine::binary field"
Re: [PATCH v6 3/4] python: add binary
Posted by Maksim Davydov 1 year ago
Thanks for reviewing!
I'll change patch subject to more appropriate one and fix the docstring

On 11/10/23 10:03, Philippe Mathieu-Daudé wrote:
> On 8/11/23 16:38, Maksim Davydov wrote:
>> Add a supportive property to access the path to the qemu binary
>>
>> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
>> ---
>>   python/qemu/machine/machine.py | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/python/qemu/machine/machine.py 
>> b/python/qemu/machine/machine.py
>> index 31cb9d617d..78436403b2 100644
>> --- a/python/qemu/machine/machine.py
>> +++ b/python/qemu/machine/machine.py
>> @@ -328,6 +328,11 @@ def args(self) -> List[str]:
>>           """Returns the list of arguments given to the QEMU binary."""
>>           return self._args
>>   +    @property
>> +    def binary(self) -> str:
>> +        """Returns path to the qemu binary"""
>> +        return self._binary
>> +
>>       def _pre_launch(self) -> None:
>>           if self._qmp_set:
>>               if self._monitor_address is None:
>
> Better patch subject could be:
> "python/qemu/machine: Add method to retrieve QEMUMachine::binary field"

-- 
Best regards,
Maksim Davydov


Re: [PATCH v6 3/4] python: add binary
Posted by John Snow 1 year ago
On Wed, Nov 8, 2023 at 10:39 AM Maksim Davydov
<davydov-max@yandex-team.ru> wrote:
>
> Add a supportive property to access the path to the qemu binary
>
> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
> ---
>  python/qemu/machine/machine.py | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
> index 31cb9d617d..78436403b2 100644
> --- a/python/qemu/machine/machine.py
> +++ b/python/qemu/machine/machine.py
> @@ -328,6 +328,11 @@ def args(self) -> List[str]:
>          """Returns the list of arguments given to the QEMU binary."""
>          return self._args
>
> +    @property
> +    def binary(self) -> str:
> +        """Returns path to the qemu binary"""
> +        return self._binary
> +
>      def _pre_launch(self) -> None:
>          if self._qmp_set:
>              if self._monitor_address is None:
> --
> 2.34.1
>
>

'kay.

Reviewed-by: John Snow <jsnow@redhat.com>
Re: [PATCH v6 3/4] python: add binary
Posted by Philippe Mathieu-Daudé 1 year ago
Hi Maksim,

On 8/11/23 16:38, Maksim Davydov wrote:
> Add a supportive property to access the path to the qemu binary
> 
> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
> ---
>   python/qemu/machine/machine.py | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
> index 31cb9d617d..78436403b2 100644
> --- a/python/qemu/machine/machine.py
> +++ b/python/qemu/machine/machine.py
> @@ -328,6 +328,11 @@ def args(self) -> List[str]:
>           """Returns the list of arguments given to the QEMU binary."""
>           return self._args
>   
> +    @property
> +    def binary(self) -> str:
> +        """Returns path to the qemu binary"""

s/qemu/QEMU/ (like 2 lines earlier).

Otherwise,

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> +        return self._binary
> +
>       def _pre_launch(self) -> None:
>           if self._qmp_set:
>               if self._monitor_address is None: