From: Nathan Binkert Date: Mon, 28 Jun 2004 19:54:05 +0000 (-0400) Subject: Don't serialize the absolute path so we can move checkpoints around. X-Git-Tag: m5_1.0_tutorial~287 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19d5789db1a58747daca88e5cd6580bb95db008e;p=gem5.git Don't serialize the absolute path so we can move checkpoints around. sim/serialize.cc: sim/serialize.hh: export the checkpoint directory --HG-- extra : convert_revision : ba5b796fd930ab0487a502beefcf76bd6bb7c366 --- diff --git a/dev/disk_image.cc b/dev/disk_image.cc index d990d7078..f9e1c2fe3 100644 --- a/dev/disk_image.cc +++ b/dev/disk_image.cc @@ -425,7 +425,7 @@ CowDiskImage::write(const uint8_t *data, off_t offset) void CowDiskImage::serialize(ostream &os) { - string cowFilename = Checkpoint::dir() + name() + ".cow"; + string cowFilename = name() + ".cow"; SERIALIZE_SCALAR(cowFilename); save(cowFilename); } @@ -435,6 +435,7 @@ CowDiskImage::unserialize(Checkpoint *cp, const string §ion) { string cowFilename; UNSERIALIZE_SCALAR(cowFilename); + cowFilename = cp->cptDir + "/" + cowFilename; open(cowFilename); } diff --git a/sim/serialize.cc b/sim/serialize.cc index 945f97c06..91548f653 100644 --- a/sim/serialize.cc +++ b/sim/serialize.cc @@ -431,7 +431,7 @@ Serializable::create(Checkpoint *cp, const std::string §ion) Checkpoint::Checkpoint(const std::string &cpt_dir, const std::string &path, const ConfigNode *_configNode) - : db(new IniFile), basePath(path), configNode(_configNode) + : db(new IniFile), basePath(path), configNode(_configNode), cptDir(cpt_dir) { string filename = cpt_dir + "/" + Checkpoint::baseFilename; if (!db->load(filename)) { diff --git a/sim/serialize.hh b/sim/serialize.hh index ad490d616..5df168665 100644 --- a/sim/serialize.hh +++ b/sim/serialize.hh @@ -210,6 +210,8 @@ class Checkpoint Checkpoint(const std::string &cpt_dir, const std::string &path, const ConfigNode *_configNode); + const std::string cptDir; + bool find(const std::string §ion, const std::string &entry, std::string &value);