Commit 27c6e9f4 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Make disk geomentry available in status xml before recording starts

parent 2431adb3
...@@ -1468,6 +1468,9 @@ int parse_cmd(camogm_state *state, FILE* npipe) ...@@ -1468,6 +1468,9 @@ int parse_cmd(camogm_state *state, FILE* npipe)
} else if (strcmp(cmd, "rawdev_path") == 0) { } else if (strcmp(cmd, "rawdev_path") == 0) {
if (args) { if (args) {
camogm_set_prefix(state, args, RAW_PATH); camogm_set_prefix(state, args, RAW_PATH);
// make disk geometry available in status xml before recording starts
get_disk_info(state);
open_state_file(&state->rawdev, &state->writer_params.lba_current);
} else { } else {
state->rawdev_op = 0; state->rawdev_op = 0;
state->rawdev.rawdev_path[0] = '\0'; state->rawdev.rawdev_path[0] = '\0';
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
/* forward declarations */ /* forward declarations */
static void *jpeg_writer(void *thread_args); static void *jpeg_writer(void *thread_args);
static int save_state_file(const rawdev_buffer *rawdev, uint64_t current_pos); static int save_state_file(const rawdev_buffer *rawdev, uint64_t current_pos);
static int open_state_file(const rawdev_buffer *rawdev, uint64_t *current_pos);
/** Get starting and endign LBAs of the partition specified as raw device buffer */ /** Get starting and endign LBAs of the partition specified as raw device buffer */
static int get_disk_range(struct range *range) static int get_disk_range(struct range *range)
...@@ -99,7 +98,7 @@ static int find_state(FILE *f, uint64_t *pos, const rawdev_buffer *rawdev) ...@@ -99,7 +98,7 @@ static int find_state(FILE *f, uint64_t *pos, const rawdev_buffer *rawdev)
} }
/** Read state from file and restore disk write pointer */ /** Read state from file and restore disk write pointer */
static int open_state_file(const rawdev_buffer *rawdev, uint64_t *current_pos) int open_state_file(const rawdev_buffer *rawdev, uint64_t *current_pos)
{ {
int fd, len; int fd, len;
FILE *f; FILE *f;
......
...@@ -25,5 +25,6 @@ int camogm_start_jpeg(camogm_state *state); ...@@ -25,5 +25,6 @@ int camogm_start_jpeg(camogm_state *state);
int camogm_frame_jpeg(camogm_state *state); int camogm_frame_jpeg(camogm_state *state);
int camogm_end_jpeg(camogm_state *state); int camogm_end_jpeg(camogm_state *state);
void camogm_free_jpeg(camogm_state *state); void camogm_free_jpeg(camogm_state *state);
int open_state_file(const rawdev_buffer *rawdev, uint64_t *current_pos);
#endif /* _CAMOGM_JPEG_H */ #endif /* _CAMOGM_JPEG_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment