diff options
author | Felix Geyer <debfx-pkg@fobos.de> | 2011-10-17 14:18:31 +0200 |
---|---|---|
committer | Felix Geyer <debfx-pkg@fobos.de> | 2011-10-17 14:18:31 +0200 |
commit | 1cf00a61132b69bc7e27254fdd74bf105d2da28c (patch) | |
tree | a7d314cc5ec77b4ce3e1f037af600b53ae1d43f8 /src/VBox/Main/src-server/SnapshotImpl.cpp | |
parent | f8fd93b0b6b13ba94584bb61c1efd1a761f438c9 (diff) | |
download | virtualbox-1cf00a61132b69bc7e27254fdd74bf105d2da28c.tar.gz |
Imported Upstream version 4.1.4-dfsgupstream/4.1.4-dfsg
Diffstat (limited to 'src/VBox/Main/src-server/SnapshotImpl.cpp')
-rw-r--r-- | src/VBox/Main/src-server/SnapshotImpl.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/VBox/Main/src-server/SnapshotImpl.cpp b/src/VBox/Main/src-server/SnapshotImpl.cpp index aa3520f51..afc9322a7 100644 --- a/src/VBox/Main/src-server/SnapshotImpl.cpp +++ b/src/VBox/Main/src-server/SnapshotImpl.cpp @@ -1,4 +1,4 @@ -/* $Id: SnapshotImpl.cpp 37985 2011-07-15 15:04:39Z vboxsync $ */ +/* $Id: SnapshotImpl.cpp $ */ /** @file * @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2006-2010 Oracle Corporation + * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -1430,7 +1430,7 @@ STDMETHODIMP SessionMachine::BeginTakingSnapshot(IConsole *aInitiator, if (strStateFilePath.isNotEmpty()) { // ensure the directory for the saved state file exists - HRESULT rc = VirtualBox::ensureFilePathExists(strStateFilePath); + HRESULT rc = VirtualBox::ensureFilePathExists(strStateFilePath, true /* fCreate */); if (FAILED(rc)) return rc; } @@ -1819,7 +1819,16 @@ void SessionMachine::restoreSnapshotHandler(RestoreSnapshotTask &aTask) // restore the attachments from the snapshot setModified(IsModified_Storage); mMediaData.backup(); - mMediaData->mAttachments = pSnapshotMachine->mMediaData->mAttachments; + mMediaData->mAttachments.clear(); + for (MediaData::AttachmentList::const_iterator it = pSnapshotMachine->mMediaData->mAttachments.begin(); + it != pSnapshotMachine->mMediaData->mAttachments.end(); + ++it) + { + ComObjPtr<MediumAttachment> pAttach; + pAttach.createObject(); + pAttach->initCopy(this, *it); + mMediaData->mAttachments.push_back(pAttach); + } /* leave the locks before the potentially lengthy operation */ snapshotLock.release(); |