Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
1ef5ca82
Commit
1ef5ca82
authored
Oct 29, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bfd: Check images got flushed at the end
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
7688fbc1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
bfd.c
bfd.c
+11
-2
cr-dump.c
cr-dump.c
+6
-0
bfd.h
include/bfd.h
+1
-0
No files found.
bfd.c
View file @
1ef5ca82
...
@@ -97,6 +97,12 @@ int bfdopen(struct bfd *f)
...
@@ -97,6 +97,12 @@ int bfdopen(struct bfd *f)
}
}
static
int
bflush
(
struct
bfd
*
bfd
);
static
int
bflush
(
struct
bfd
*
bfd
);
static
bool
flush_failed
=
false
;
int
bfd_flush_images
(
void
)
{
return
flush_failed
?
-
1
:
0
;
}
void
bclose
(
struct
bfd
*
f
)
void
bclose
(
struct
bfd
*
f
)
{
{
...
@@ -107,15 +113,18 @@ void bclose(struct bfd *f)
...
@@ -107,15 +113,18 @@ void bclose(struct bfd *f)
* becase we read _all_ data from them and the
* becase we read _all_ data from them and the
* b->sz would be 0 by the time we close them.
* b->sz would be 0 by the time we close them.
*/
*/
if
(
bflush
(
f
)
<
0
)
if
(
bflush
(
f
)
<
0
)
{
/*
/*
*
FIXME --
propagate error up. It's
*
This is to
propagate error up. It's
* hardly possible by returning and
* hardly possible by returning and
* checking it, but setting a static
* checking it, but setting a static
* flag, failing further bfdopen-s and
* flag, failing further bfdopen-s and
* checking one at the end would work.
* checking one at the end would work.
*/
*/
flush_failed
=
true
;
pr_perror
(
"Error flushing image"
);
pr_perror
(
"Error flushing image"
);
}
buf_put
(
&
f
->
b
);
buf_put
(
&
f
->
b
);
}
}
close
(
f
->
fd
);
close
(
f
->
fd
);
...
...
cr-dump.c
View file @
1ef5ca82
...
@@ -1766,6 +1766,9 @@ err:
...
@@ -1766,6 +1766,9 @@ err:
if
(
disconnect_from_page_server
())
if
(
disconnect_from_page_server
())
ret
=
-
1
;
ret
=
-
1
;
if
(
bfd_flush_images
())
ret
=
-
1
;
if
(
ret
)
if
(
ret
)
pr_err
(
"Pre-dumping FAILED.
\n
"
);
pr_err
(
"Pre-dumping FAILED.
\n
"
);
else
{
else
{
...
@@ -1891,6 +1894,9 @@ err:
...
@@ -1891,6 +1894,9 @@ err:
close_cr_imgset
(
&
glob_imgset
);
close_cr_imgset
(
&
glob_imgset
);
if
(
bfd_flush_images
())
ret
=
-
1
;
cr_plugin_fini
(
CR_PLUGIN_STAGE__DUMP
,
ret
);
cr_plugin_fini
(
CR_PLUGIN_STAGE__DUMP
,
ret
);
if
(
!
ret
)
{
if
(
!
ret
)
{
...
...
include/bfd.h
View file @
1ef5ca82
...
@@ -33,4 +33,5 @@ int bwrite(struct bfd *f, const void *buf, int sz);
...
@@ -33,4 +33,5 @@ int bwrite(struct bfd *f, const void *buf, int sz);
struct
iovec
;
struct
iovec
;
int
bwritev
(
struct
bfd
*
f
,
const
struct
iovec
*
iov
,
int
cnt
);
int
bwritev
(
struct
bfd
*
f
,
const
struct
iovec
*
iov
,
int
cnt
);
int
bread
(
struct
bfd
*
f
,
void
*
buf
,
int
sz
);
int
bread
(
struct
bfd
*
f
,
void
*
buf
,
int
sz
);
int
bfd_flush_images
(
void
);
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment