Skip to content

Commit 1e09494

Browse files
ustcweizhouyadvr
authored andcommitted
CLOUDSTACK-2823: pass cmdline info to system vms for 30 times
(cherry picked from commit 4eedfe5) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> Conflicts: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java systemvm/patches/debian/config/etc/init.d/cloud-early-config
1 parent 314e2da commit 1e09494

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3692,24 +3692,21 @@ protected StartAnswer execute(StartCommand cmd) {
36923692

36933693
// pass cmdline info to system vms
36943694
if (vmSpec.getType() != VirtualMachine.Type.User) {
3695-
if ((conn.getVersion() < 1001000)) { // CLOUDSTACK-2823: try passCmdLine some times if kernel < 2.6.34 and qemu < 1.1.0 on hypervisor (for instance, CentOS 6.4)
3696-
//wait for 5 minutes at most
3697-
String controlIp = null;
3698-
for (NicTO nic : nics) {
3699-
if (nic.getType() == TrafficType.Control) {
3700-
controlIp = nic.getIp();
3701-
}
3695+
//wait and try passCmdLine for 5 minutes at most for CLOUDSTACK-2823
3696+
String controlIp = null;
3697+
for (NicTO nic : nics) {
3698+
if (nic.getType() == TrafficType.Control) {
3699+
controlIp = nic.getIp();
3700+
break;
37023701
}
3703-
for (int count = 0; count < 30; count ++) {
3704-
passCmdLine(vmName, vmSpec.getBootArgs());
3705-
//check router is up?
3706-
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
3707-
if (result) {
3708-
break;
3709-
}
3702+
}
3703+
for (int count = 0; count < 30; count++) {
3704+
passCmdLine(vmName, vmSpec.getBootArgs());
3705+
//check router is up?
3706+
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
3707+
if (result) {
3708+
break;
37103709
}
3711-
} else {
3712-
passCmdLine(vmName, vmSpec.getBootArgs() );
37133710
}
37143711
}
37153712

‎systemvm/patches/debian/config/etc/init.d/cloud-early-config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ get_boot_params() {
118118
log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
119119
fi
120120

121-
while [$cmd -eq ""]; do
121+
while [ -z "$cmd" ]; do
122122
while read line; do
123123
if [[ $line == cmdline:* ]]; then
124124
cmd=${line//cmdline:/}

0 commit comments

Comments
 (0)