From eb21a1bfb308dbb9ff5a8cfb6164dffca2417b88 Mon Sep 17 00:00:00 2001 From: Olivier Lambert Date: Thu, 3 Mar 2016 18:25:43 +0100 Subject: [PATCH] support SMB ISO SR --- src/api/sr.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/api/sr.js b/src/api/sr.js index dedaa5832..eb0dd908f 100644 --- a/src/api/sr.js +++ b/src/api/sr.js @@ -88,11 +88,18 @@ export async function createIso ({ // FIXME: won't work for IPv6 // Detect if NFS or local path for ISO files - const deviceConfig = {location: path} + const deviceConfig = {} if (path.indexOf(':') === -1) { // not NFS share - // TODO: legacy will be removed in XAPI soon by FileSR - deviceConfig.legacy_mode = 'true' + if (path.indexOf('\\') === -1) { // not SMB + deviceConfig.legacy_mode = 'true' + } else { + path = path.replace(/\\/g, '/') + } } + deviceConfig.location = path + deviceConfig.username = user + deviceConfig.cifspassword = password + const srRef = await xapi.call( 'SR.create', host._xapiRef,