mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-28 08:30:21 +00:00
Dry-run shall not change any state (21.10.01 regression) (#998)
This commit is contained in:
parent
0d95890887
commit
ae66bbdc26
@ -136,7 +136,7 @@ bool CTapDriver::Init(const unordered_map<string, string>& const_params)
|
||||
}
|
||||
inet = params["inet"];
|
||||
|
||||
LOGTRACE("Opening Tap device")
|
||||
LOGTRACE("Opening tap device")
|
||||
// TAP device initilization
|
||||
if ((m_hTAP = open("/dev/net/tun", O_RDWR)) < 0) {
|
||||
LOGERROR("Can't open tun: %s", strerror(errno))
|
||||
|
@ -331,6 +331,11 @@ bool RascsiExecutor::Attach(const CommandContext& context, const PbDeviceDefinit
|
||||
device->SetProtected(pb_device.protected_());
|
||||
}
|
||||
|
||||
// Stop the dry run here, before actually attaching
|
||||
if (dryRun) {
|
||||
return true;
|
||||
}
|
||||
|
||||
unordered_map<string, string> params = { pb_device.params().begin(), pb_device.params().end() };
|
||||
if (!device->SupportsFile()) {
|
||||
// Clients like rasctl might have sent both "file" and "interfaces"
|
||||
@ -346,11 +351,6 @@ bool RascsiExecutor::Attach(const CommandContext& context, const PbDeviceDefinit
|
||||
storage_device->ReserveFile(full_path, id, lun);
|
||||
}
|
||||
|
||||
// Stop the dry run here, before actually attaching
|
||||
if (dryRun) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!controller_manager.AttachToScsiController(id, device)) {
|
||||
return context.ReturnLocalizedError(LocalizationKey::ERROR_SCSI_CONTROLLER);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user