QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] tests/migration: fix unix socket migration
@ 2021-03-09 16:00 huangy81
  2021-03-09 16:55 ` Philippe Mathieu-Daudé
  2021-03-09 18:56 ` Wainer dos Santos Moschetta
  0 siblings, 2 replies; 5+ messages in thread
From: huangy81 @ 2021-03-09 16:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hyman, Daniel P. Berrange

From: Hyman <huangy81@chinatelecom.cn>

The test aborts and error message as the following be throwed:
"No such file or directory: '/var/tmp/qemu-migrate-{pid}.migrate",
when the unix socket migration test nearly done. The reason is
qemu removes the unix socket file after migration before
guestperf.py script do it. So pre-check if the socket file exists
when removing it to prevent the guestperf program from aborting.

Signed-off-by: Hyman <huangy81@chinatelecom.cn>
---
 tests/migration/guestperf/engine.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
index 83bfc3b..86d4f21 100644
--- a/tests/migration/guestperf/engine.py
+++ b/tests/migration/guestperf/engine.py
@@ -405,7 +405,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
             progress_history = ret[0]
             qemu_timings = ret[1]
             vcpu_timings = ret[2]
-            if uri[0:5] == "unix:":
+            if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
                 os.remove(uri[5:])
             if self._verbose:
                 print("Finished migration")
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/migration: fix unix socket migration
  2021-03-09 16:00 [PATCH] tests/migration: fix unix socket migration huangy81
@ 2021-03-09 16:55 ` Philippe Mathieu-Daudé
  2021-04-21  1:16   ` Hyman Huang
  2021-03-09 18:56 ` Wainer dos Santos Moschetta
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-09 16:55 UTC (permalink / raw)
  To: huangy81, qemu-devel, Daniel P. Berrange
  Cc: Markus Armbruster, Eduardo Habkost, Wainer dos Santos Moschetta,
	Cleber Rosa

On 3/9/21 5:00 PM, huangy81@chinatelecom.cn wrote:
> From: Hyman <huangy81@chinatelecom.cn>
> 
> The test aborts and error message as the following be throwed:
> "No such file or directory: '/var/tmp/qemu-migrate-{pid}.migrate",
> when the unix socket migration test nearly done. The reason is
> qemu removes the unix socket file after migration before
> guestperf.py script do it. So pre-check if the socket file exists
> when removing it to prevent the guestperf program from aborting.
> 
> Signed-off-by: Hyman <huangy81@chinatelecom.cn>
> ---
>  tests/migration/guestperf/engine.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Interesting, we have in MAINTAINERS:

Python scripts
M: Eduardo Habkost <ehabkost@redhat.com>
M: Cleber Rosa <crosa@redhat.com>
S: Odd Fixes
F: scripts/*.py
F: tests/*.py

However:

./scripts/get_maintainer.pl -f tests/migration/guestperf/engine.py
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.

> diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
> index 83bfc3b..86d4f21 100644
> --- a/tests/migration/guestperf/engine.py
> +++ b/tests/migration/guestperf/engine.py
> @@ -405,7 +405,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
>              progress_history = ret[0]
>              qemu_timings = ret[1]
>              vcpu_timings = ret[2]
> -            if uri[0:5] == "unix:":
> +            if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
>                  os.remove(uri[5:])
>              if self._verbose:
>                  print("Finished migration")
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/migration: fix unix socket migration
  2021-03-09 16:00 [PATCH] tests/migration: fix unix socket migration huangy81
  2021-03-09 16:55 ` Philippe Mathieu-Daudé
@ 2021-03-09 18:56 ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 5+ messages in thread
From: Wainer dos Santos Moschetta @ 2021-03-09 18:56 UTC (permalink / raw)
  To: huangy81, qemu-devel; +Cc: Daniel P. Berrange


On 3/9/21 1:00 PM, huangy81@chinatelecom.cn wrote:
> From: Hyman <huangy81@chinatelecom.cn>
>
> The test aborts and error message as the following be throwed:
> "No such file or directory: '/var/tmp/qemu-migrate-{pid}.migrate",
> when the unix socket migration test nearly done. The reason is
> qemu removes the unix socket file after migration before
> guestperf.py script do it. So pre-check if the socket file exists
> when removing it to prevent the guestperf program from aborting.
>
> Signed-off-by: Hyman <huangy81@chinatelecom.cn>
> ---
>   tests/migration/guestperf/engine.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


>
> diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
> index 83bfc3b..86d4f21 100644
> --- a/tests/migration/guestperf/engine.py
> +++ b/tests/migration/guestperf/engine.py
> @@ -405,7 +405,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
>               progress_history = ret[0]
>               qemu_timings = ret[1]
>               vcpu_timings = ret[2]
> -            if uri[0:5] == "unix:":
> +            if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
>                   os.remove(uri[5:])
>               if self._verbose:
>                   print("Finished migration")



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/migration: fix unix socket migration
  2021-03-09 16:55 ` Philippe Mathieu-Daudé
@ 2021-04-21  1:16   ` Hyman Huang
  2021-04-28 17:26     ` Wainer dos Santos Moschetta
  0 siblings, 1 reply; 5+ messages in thread
From: Hyman Huang @ 2021-04-21  1:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Wainer dos Santos Moschetta


在 2021/3/10 0:55, Philippe Mathieu-Daudé 写道:
> On 3/9/21 5:00 PM, huangy81@chinatelecom.cn wrote:
>> From: Hyman <huangy81@chinatelecom.cn>
>>
>> The test aborts and error message as the following be throwed:
>> "No such file or directory: '/var/tmp/qemu-migrate-{pid}.migrate",
>> when the unix socket migration test nearly done. The reason is
>> qemu removes the unix socket file after migration before
>> guestperf.py script do it. So pre-check if the socket file exists
>> when removing it to prevent the guestperf program from aborting.
>>
>> Signed-off-by: Hyman <huangy81@chinatelecom.cn>
>> ---
>>   tests/migration/guestperf/engine.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Interesting, we have in MAINTAINERS:
> 
> Python scripts
> M: Eduardo Habkost <ehabkost@redhat.com>
> M: Cleber Rosa <crosa@redhat.com>
> S: Odd Fixes
> F: scripts/*.py
> F: tests/*.py
> 
> However:
> 
> ./scripts/get_maintainer.pl -f tests/migration/guestperf/engine.py
> get_maintainer.pl: No maintainers found, printing recent contributors.
> get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.

Ping

The following patch has fixed it
https://patchew.org/QEMU/91d5978357fb8709ef61d2030984f7142847037d.1616141556.git.huangy81@chinatelecom.cn/

> 
>> diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py
>> index 83bfc3b..86d4f21 100644
>> --- a/tests/migration/guestperf/engine.py
>> +++ b/tests/migration/guestperf/engine.py
>> @@ -405,7 +405,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
>>               progress_history = ret[0]
>>               qemu_timings = ret[1]
>>               vcpu_timings = ret[2]
>> -            if uri[0:5] == "unix:":
>> +            if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
>>                   os.remove(uri[5:])
>>               if self._verbose:
>>                   print("Finished migration")
>>
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
-- 
Best regard

Hyman Huang(黄勇)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/migration: fix unix socket migration
  2021-04-21  1:16   ` Hyman Huang
@ 2021-04-28 17:26     ` Wainer dos Santos Moschetta
  0 siblings, 0 replies; 5+ messages in thread
From: Wainer dos Santos Moschetta @ 2021-04-28 17:26 UTC (permalink / raw)
  To: qemu-devel, Cleber Rosa; +Cc: Hyman Huang, Philippe Mathieu-Daudé

Cleber,

Maybe you could review then queue this one?

- Wainer

On 4/20/21 10:16 PM, Hyman Huang wrote:
>
> 在 2021/3/10 0:55, Philippe Mathieu-Daudé 写道:
>> On 3/9/21 5:00 PM, huangy81@chinatelecom.cn wrote:
>>> From: Hyman <huangy81@chinatelecom.cn>
>>>
>>> The test aborts and error message as the following be throwed:
>>> "No such file or directory: '/var/tmp/qemu-migrate-{pid}.migrate",
>>> when the unix socket migration test nearly done. The reason is
>>> qemu removes the unix socket file after migration before
>>> guestperf.py script do it. So pre-check if the socket file exists
>>> when removing it to prevent the guestperf program from aborting.
>>>
>>> Signed-off-by: Hyman <huangy81@chinatelecom.cn>
>>> ---
>>>   tests/migration/guestperf/engine.py | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Interesting, we have in MAINTAINERS:
>>
>> Python scripts
>> M: Eduardo Habkost <ehabkost@redhat.com>
>> M: Cleber Rosa <crosa@redhat.com>
>> S: Odd Fixes
>> F: scripts/*.py
>> F: tests/*.py
>>
>> However:
>>
>> ./scripts/get_maintainer.pl -f tests/migration/guestperf/engine.py
>> get_maintainer.pl: No maintainers found, printing recent contributors.
>> get_maintainer.pl: Do not blindly cc: them on patches!  Use common 
>> sense.
>
> Ping
>
> The following patch has fixed it
> https://patchew.org/QEMU/91d5978357fb8709ef61d2030984f7142847037d.1616141556.git.huangy81@chinatelecom.cn/ 
>
>
>>
>>> diff --git a/tests/migration/guestperf/engine.py 
>>> b/tests/migration/guestperf/engine.py
>>> index 83bfc3b..86d4f21 100644
>>> --- a/tests/migration/guestperf/engine.py
>>> +++ b/tests/migration/guestperf/engine.py
>>> @@ -405,7 +405,7 @@ def run(self, hardware, scenario, 
>>> result_dir=os.getcwd()):
>>>               progress_history = ret[0]
>>>               qemu_timings = ret[1]
>>>               vcpu_timings = ret[2]
>>> -            if uri[0:5] == "unix:":
>>> +            if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
>>>                   os.remove(uri[5:])
>>>               if self._verbose:
>>>                   print("Finished migration")
>>>
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 16:00 [PATCH] tests/migration: fix unix socket migration huangy81
2021-03-09 16:55 ` Philippe Mathieu-Daudé
2021-04-21  1:16   ` Hyman Huang
2021-04-28 17:26     ` Wainer dos Santos Moschetta
2021-03-09 18:56 ` Wainer dos Santos Moschetta

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git
	git clone --mirror https://lore.kernel.org/qemu-devel/2 qemu-devel/git/2.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git