All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH OSSTEST v2] libvirt: Pass correct arguments to virsh migrate
@ 2015-08-05 12:48 Ian Campbell
  2015-08-05 12:49 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2015-08-05 12:48 UTC (permalink / raw)
  To: ian.jackson, xen-devel, wei.liu2; +Cc: Ian Campbell

$dst is a host hash/object, resulting in:

2015-08-04 22:35:25 Z executing ssh ... root@172.16.144.34 virsh
migrate debian.guest.osstest HASH(0x28f4310)
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `virsh migrate debian.guest.osstest HASH(0x28f4310)'

Switch to using the same pattern as xl.pm, which is to call the
argument (containing the host hash) $dho and for $dst to be a local
variable containing $dho->{Name}.

Also s/$ho/$sho/ to match xl.pm, since I think that is clearer about
what role everything has.

Fix the prototype too while editing this function.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Fix the prototype as well.
---
 Osstest/Toolstack/libvirt.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm
index 32dca84..bfb5ccb 100644
--- a/Osstest/Toolstack/libvirt.pm
+++ b/Osstest/Toolstack/libvirt.pm
@@ -103,11 +103,12 @@ sub saverestore_check ($) {
     return check_for_command($self, "save");
 }
 
-sub migrate ($) {
-    my ($self,$gho,$dst,$timeout) = @_;
-    my $ho = $self->{Host};
+sub migrate ($$$$) {
+    my ($self,$gho,$dho,$timeout) = @_;
+    my $sho = $self->{Host};
+    my $dst = $dho->{Name};
     my $gn = $gho->{Name};
-    target_cmd_root($ho, "virsh migrate $gn $dst", $timeout);
+    target_cmd_root($sho, "virsh migrate $gn $dst", $timeout);
 }
 
 sub save ($$$$) {
-- 
2.1.4

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

* Re: [PATCH OSSTEST v2] libvirt: Pass correct arguments to virsh migrate
  2015-08-05 12:48 [PATCH OSSTEST v2] libvirt: Pass correct arguments to virsh migrate Ian Campbell
@ 2015-08-05 12:49 ` Wei Liu
  2015-08-05 12:55   ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-08-05 12:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: wei.liu2, ian.jackson, xen-devel

On Wed, Aug 05, 2015 at 01:48:27PM +0100, Ian Campbell wrote:
> $dst is a host hash/object, resulting in:
> 
> 2015-08-04 22:35:25 Z executing ssh ... root@172.16.144.34 virsh
> migrate debian.guest.osstest HASH(0x28f4310)
> bash: -c: line 0: syntax error near unexpected token `('
> bash: -c: line 0: `virsh migrate debian.guest.osstest HASH(0x28f4310)'
> 
> Switch to using the same pattern as xl.pm, which is to call the
> argument (containing the host hash) $dho and for $dst to be a local
> variable containing $dho->{Name}.
> 
> Also s/$ho/$sho/ to match xl.pm, since I think that is clearer about
> what role everything has.
> 
> Fix the prototype too while editing this function.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

Thanks for the fix!

> ---
> v2: Fix the prototype as well.
> ---
>  Osstest/Toolstack/libvirt.pm | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm
> index 32dca84..bfb5ccb 100644
> --- a/Osstest/Toolstack/libvirt.pm
> +++ b/Osstest/Toolstack/libvirt.pm
> @@ -103,11 +103,12 @@ sub saverestore_check ($) {
>      return check_for_command($self, "save");
>  }
>  
> -sub migrate ($) {
> -    my ($self,$gho,$dst,$timeout) = @_;
> -    my $ho = $self->{Host};
> +sub migrate ($$$$) {
> +    my ($self,$gho,$dho,$timeout) = @_;
> +    my $sho = $self->{Host};
> +    my $dst = $dho->{Name};
>      my $gn = $gho->{Name};
> -    target_cmd_root($ho, "virsh migrate $gn $dst", $timeout);
> +    target_cmd_root($sho, "virsh migrate $gn $dst", $timeout);
>  }
>  
>  sub save ($$$$) {
> -- 
> 2.1.4

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

* Re: [PATCH OSSTEST v2] libvirt: Pass correct arguments to virsh migrate
  2015-08-05 12:49 ` Wei Liu
@ 2015-08-05 12:55   ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-08-05 12:55 UTC (permalink / raw)
  To: Wei Liu; +Cc: ian.jackson, xen-devel

On Wed, 2015-08-05 at 13:49 +0100, Wei Liu wrote:
> On Wed, Aug 05, 2015 at 01:48:27PM +0100, Ian Campbell wrote:
> > $dst is a host hash/object, resulting in:
> > 
> > 2015-08-04 22:35:25 Z executing ssh ... root@172.16.144.34 virsh
> > migrate debian.guest.osstest HASH(0x28f4310)
> > bash: -c: line 0: syntax error near unexpected token `('
> > bash: -c: line 0: `virsh migrate debian.guest.osstest HASH(0x28f4310)'
> > 
> > Switch to using the same pattern as xl.pm, which is to call the
> > argument (containing the host hash) $dho and for $dst to be a local
> > variable containing $dho->{Name}.
> > 
> > Also s/$ho/$sho/ to match xl.pm, since I think that is clearer about
> > what role everything has.
> > 
> > Fix the prototype too while editing this function.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> Thanks for the fix!

NP. I've pushed this to pretest and killed flight 60606 which hadn't alloca
ted any hosts yet.

Ian.

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

end of thread, other threads:[~2015-08-05 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 12:48 [PATCH OSSTEST v2] libvirt: Pass correct arguments to virsh migrate Ian Campbell
2015-08-05 12:49 ` Wei Liu
2015-08-05 12:55   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.