Don't serialize the absolute path so we can move checkpoints around.
authorNathan Binkert <binkertn@umich.edu>
Mon, 28 Jun 2004 19:54:05 +0000 (15:54 -0400)
committerNathan Binkert <binkertn@umich.edu>
Mon, 28 Jun 2004 19:54:05 +0000 (15:54 -0400)
sim/serialize.cc:
sim/serialize.hh:
    export the checkpoint directory

--HG--
extra : convert_revision : ba5b796fd930ab0487a502beefcf76bd6bb7c366

dev/disk_image.cc
sim/serialize.cc
sim/serialize.hh

index d990d70783259d75b3917a028f5889dd1f0cac0f..f9e1c2fe3772c0829a8e8eda8551cf99251da08c 100644 (file)
@@ -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 &section)
 {
     string cowFilename;
     UNSERIALIZE_SCALAR(cowFilename);
+    cowFilename = cp->cptDir + "/" + cowFilename;
     open(cowFilename);
 }
 
index 945f97c068e9d77a4b50214030ce30ca0b51e552..91548f65352337ac488fd3284e0f0355cbe881f6 100644 (file)
@@ -431,7 +431,7 @@ Serializable::create(Checkpoint *cp, const std::string &section)
 
 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)) {
index ad490d616334f92e77397804d1fc7a8a3fa96105..5df1686658cbdc1a4046deafb11588e60baa9728 100644 (file)
@@ -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 &section, const std::string &entry,
               std::string &value);