xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script
@ 2016-04-13 17:02 Wei Liu
  2016-04-14 18:13 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2016-04-13 17:02 UTC (permalink / raw)
  To: Xen-devel; +Cc: Ian Jackson, Wei Liu

The original same_vm check has two bugs. When stubdom is in use because
it relies on numeric domid to check if two domains are in fact the same
one.  Another one is that the check would fail when two stubdoms are
checked against each other.

The first bug is fixed by using uuid to identify a domain. The second
bug is fixed by comparing the domains two stubdoms serve.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>

This should fix osstest stubdom local migration test. Local migration
without stubdom is also tested and passed.
---
 tools/hotplug/Linux/block-common.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/block-common.sh b/tools/hotplug/Linux/block-common.sh
index 35110b4..f86a88c 100644
--- a/tools/hotplug/Linux/block-common.sh
+++ b/tools/hotplug/Linux/block-common.sh
@@ -112,14 +112,17 @@ same_vm()
                   "$FRONTEND_UUID")
   local target=$(xenstore_read_default  "/local/domain/$FRONTEND_ID/target"   \
                  "-1")
+  local targetvm=$(xenstore_read_default "/local/domain/$target/vm" "-1")
   local otarget=$(xenstore_read_default  "/local/domain/$otherdom/target"   \
                  "-1")
   local otvm=$(xenstore_read_default  "/local/domain/$otarget/vm"   \
                  "-1")
   otvm=${otvm%-1}
   othervm=${othervm%-1}
+  targetvm=${targetvm%-1}
   local frontend_uuid=${FRONTEND_UUID%-1}
   
-  [ "$frontend_uuid" = "$othervm" -o "$target" = "$otherdom" -o "$frontend_uuid" = "$otvm" ]
+  [ "$frontend_uuid" = "$othervm" -o "$targetvm" = "$othervm" -o \
+    "$frontend_uuid" = "$otvm" -o "$targetvm" = "$otvm" ]
 }
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script
  2016-04-13 17:02 [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script Wei Liu
@ 2016-04-14 18:13 ` Ian Jackson
  2016-04-15  9:55   ` Wei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2016-04-14 18:13 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel

Wei Liu writes ("[PATCH for-4.7] hotplug/Linux: fix same_vm check in block script"):
> The original same_vm check has two bugs. When stubdom is in use because
> it relies on numeric domid to check if two domains are in fact the same
> one.  Another one is that the check would fail when two stubdoms are
> checked against each other.
> 
> The first bug is fixed by using uuid to identify a domain. The second
> bug is fixed by comparing the domains two stubdoms serve.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> This should fix osstest stubdom local migration test. Local migration
> without stubdom is also tested and passed.

This looks plausible to me.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script
  2016-04-14 18:13 ` Ian Jackson
@ 2016-04-15  9:55   ` Wei Liu
  2016-04-15 11:02     ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2016-04-15  9:55 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Xen-devel, Wei Liu

On Thu, Apr 14, 2016 at 07:13:29PM +0100, Ian Jackson wrote:
> Wei Liu writes ("[PATCH for-4.7] hotplug/Linux: fix same_vm check in block script"):
> > The original same_vm check has two bugs. When stubdom is in use because
> > it relies on numeric domid to check if two domains are in fact the same
> > one.  Another one is that the check would fail when two stubdoms are
> > checked against each other.
> > 
> > The first bug is fixed by using uuid to identify a domain. The second
> > bug is fixed by comparing the domains two stubdoms serve.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > 
> > This should fix osstest stubdom local migration test. Local migration
> > without stubdom is also tested and passed.
> 
> This looks plausible to me.
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 

FAOD:

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

> Thanks,
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script
  2016-04-15  9:55   ` Wei Liu
@ 2016-04-15 11:02     ` Ian Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2016-04-15 11:02 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel

Wei Liu writes ("Re: [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script"):
> Release-acked-by: Wei Liu <wei.liu2@citrix.com>

Queued, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-04-15 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 17:02 [PATCH for-4.7] hotplug/Linux: fix same_vm check in block script Wei Liu
2016-04-14 18:13 ` Ian Jackson
2016-04-15  9:55   ` Wei Liu
2016-04-15 11:02     ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).