|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.18] block-common: Fix same_vm for no targets
commit 16475909baa2bcfda3ebc07ced5e5cd0ca8172d6
Author: Jason Andryuk <jandryuk@xxxxxxxxx>
AuthorDate: Tue Feb 27 13:55:03 2024 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Feb 27 13:55:03 2024 +0100
block-common: Fix same_vm for no targets
same_vm is broken when the two main domains do not have targets. otvm
and targetvm are both missing, which means they get set to -1 and then
converted to empty strings:
++10697+ local targetvm=-1
++10697+ local otvm=-1
++10697+ otvm=
++10697+ othervm=/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4
++10697+ targetvm=
++10697+ local frontend_uuid=/vm/844dea4e-44f8-4e3e-8145-325132a31ca5
The final comparison returns true since the two empty strings match:
++10697+ '[' /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =
/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 -o '' =
/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 -o
/vm/844dea4e-44f8-4e3e-8145-325132a31ca5 = '' -o '' = '' ']'
Replace -1 with distinct strings indicating the lack of a value and
remove the collescing to empty stings. The strings themselves will no
longer match, and that is correct.
++12364+ '[' /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =
/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 -o 'No target' =
/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 -o
/vm/844dea4e-44f8-4e3e-8145-325132a31ca5 = 'No other target' -o 'No target' =
'No other target' ']'
Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
master commit: e8f1bb803fdf44db708991593568a9e3e6b3d130
master date: 2024-02-07 13:46:52 +0100
---
tools/hotplug/Linux/block-common.sh | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/hotplug/Linux/block-common.sh
b/tools/hotplug/Linux/block-common.sh
index f86a88c4eb..5c80237d99 100644
--- a/tools/hotplug/Linux/block-common.sh
+++ b/tools/hotplug/Linux/block-common.sh
@@ -112,14 +112,12 @@ 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 targetvm=$(xenstore_read_default "/local/domain/$target/vm" "No
Target")
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}
+ "No Other Target")
+
local frontend_uuid=${FRONTEND_UUID%-1}
[ "$frontend_uuid" = "$othervm" -o "$targetvm" = "$othervm" -o \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |