From 651a4082d0d2d6cebfd3532ea6617dffdea2aec6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 21 Mar 2018 11:22:18 +0100 Subject: [vmstore] Add fields to specify mount options --- inc/taskmanagercallback.inc.php | 3 ++- inc/trigger.inc.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/taskmanagercallback.inc.php b/inc/taskmanagercallback.inc.php index 114530cf..55e01ba2 100644 --- a/inc/taskmanagercallback.inc.php +++ b/inc/taskmanagercallback.inc.php @@ -172,7 +172,8 @@ class TaskmanagerCallback Property::setVmStoreConfig($args); return; } - if ($task['data']['exitCode'] > 0) { + // If code is 99 then the script failed to even unmount -- don't change anything + if ($task['data']['exitCode'] != 99) { // Manual mount failed with non-taskmanager related error - reset storage type to reflect situation $data = Property::getVmStoreConfig(); if (isset($data['storetype'])) { diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index 2af73872..f055d384 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -127,14 +127,21 @@ class Trigger } if ($storetype === 'nfs') { $addr = $vmstore['nfsaddr']; + $opts = 'nfsopts'; } elseif ($storetype === 'cifs') { $addr = $vmstore['cifsaddr']; + $opts = 'cifsopts'; } else { + $opts = null; $addr = 'null'; } + if (isset($vmstore[$opts])) { + $opts = $vmstore[$opts]; + } return Taskmanager::submit('MountVmStore', array( 'address' => $addr, 'type' => 'images', + 'opts' => $opts, 'username' => $vmstore['cifsuser'], 'password' => $vmstore['cifspasswd'] )); -- cgit v1.2.3-55-g7522