Skip to content

Commit

Permalink
Merge pull request #182 from abel-von/fix-recover
Browse files Browse the repository at this point in the history
vmm: fix recover failed when first start
  • Loading branch information
Burning1020 authored Mar 10, 2025
2 parents c5f2ce4 + 93028fe commit a1302d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion vmm/sandbox/src/bin/cloud_hypervisor/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use std::path::Path;

use clap::Parser;
use vmm_common::{signal, trace};
use vmm_sandboxer::{
Expand Down Expand Up @@ -52,7 +54,9 @@ async fn main() {
});

// Do recovery job
sandboxer.recover(&args.dir).await;
if Path::new(&args.dir).exists() {
sandboxer.recover(&args.dir).await;
}

// Run the sandboxer
containerd_sandbox::run(
Expand Down
6 changes: 5 additions & 1 deletion vmm/sandbox/src/bin/stratovirt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use std::path::Path;

use clap::Parser;
use vmm_common::{signal, trace};
use vmm_sandboxer::{
Expand Down Expand Up @@ -53,7 +55,9 @@ async fn main() {
});

// Do recovery job
sandboxer.recover(&args.dir).await;
if Path::new(&args.dir).exists() {
sandboxer.recover(&args.dir).await;
}

// Run the sandboxer
containerd_sandbox::run(
Expand Down

0 comments on commit a1302d2

Please sign in to comment.