Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: delta_diff_generator.cc

Issue 3633003: AU: fix report generation to handle invalid nodes and final rootfs op (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index 23c2dd0335afbff549bf5cc8f569849717b13f72..2e04e2a7fea11e81e081e1eb3c5c516c7964f2a1 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -260,6 +260,8 @@ bool ReadUnwrittenBlocks(const vector<Block>& blocks,
off_t* blobs_length,
const string& image_path,
Vertex* vertex) {
+ vertex->file_name = "<rootfs-non-file-data>";
+
DeltaArchiveManifest_InstallOperation* out_op = &vertex->op;
int image_fd = open(image_path.c_str(), O_RDONLY, 000);
TEST_AND_RETURN_FALSE_ERRNO(image_fd >= 0);
@@ -468,20 +470,16 @@ void ReportPayloadUsage(const Graph& graph,
// Graph nodes with information about file names.
for (Vertex::Index node = 0; node < graph.size(); node++) {
- objects.push_back(DeltaObject(graph[node].file_name,
- graph[node].op.type(),
- graph[node].op.data_length()));
- total_size += graph[node].op.data_length();
+ const Vertex& vertex = graph[node];
+ if (!vertex.valid) {
+ continue;
+ }
+ objects.push_back(DeltaObject(vertex.file_name,
+ vertex.op.type(),
+ vertex.op.data_length()));
+ total_size += vertex.op.data_length();
}
- // Final rootfs operation writing non-file-data.
- const DeltaArchiveManifest_InstallOperation& final_op =
- manifest.install_operations(manifest.install_operations_size() - 1);
- objects.push_back(DeltaObject("<rootfs-final-operation>",
- final_op.type(),
- final_op.data_length()));
- total_size += final_op.data_length();
-
// Kernel install operations.
for (int i = 0; i < manifest.kernel_install_operations_size(); ++i) {
const DeltaArchiveManifest_InstallOperation& op =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698