diff options
author | Andreas Sandberg <andreas@sandberg.pp.se> | 2015-11-26 10:11:52 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas@sandberg.pp.se> | 2015-11-26 10:11:52 +0000 |
commit | 6de52699bb10ec445e45400b419bb61122a68162 (patch) | |
tree | 5b9fef2a697556e4b9cca062bcd50fa5c0f440aa /src/dev/storage/disk_image.hh | |
parent | 738d71f6a93e2da9ef5bb1490f2b94f9541735e3 (diff) | |
download | gem5-6de52699bb10ec445e45400b419bb61122a68162.tar.xz |
dev: Add post-fork handling for disk images
This changeset adds support for notifying the disk images that the simulator has
been forked. We need to disable the saving of the CoW disk image from the child
process, and we need to make sure that systems which use a raw disk image are
not allowed to fork to avoid two or more gem5 processes writing to the same disk
image.
Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev/storage/disk_image.hh')
-rw-r--r-- | src/dev/storage/disk_image.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dev/storage/disk_image.hh b/src/dev/storage/disk_image.hh index 43e6adf5e..2a59dc0c3 100644 --- a/src/dev/storage/disk_image.hh +++ b/src/dev/storage/disk_image.hh @@ -82,6 +82,8 @@ class RawDiskImage : public DiskImage RawDiskImage(const Params *p); ~RawDiskImage(); + void notifyFork() override; + void close(); void open(const std::string &filename, bool rd_only = false); @@ -123,6 +125,8 @@ class CowDiskImage : public DiskImage CowDiskImage(const Params *p); ~CowDiskImage(); + void notifyFork() override; + void initSectorTable(int hash_size); bool open(const std::string &file); void save() const; |