-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cleanVm): add recovery method for duplicated vhd uuid containing… #6314
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
|
||
<!--packages-start--> | ||
|
||
- @xen-orchestra/backups minor | ||
- xo-web minor | ||
- vhd-lib minor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alphabetic order please 🙂 |
||
|
||
<!--packages-end--> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,4 +334,25 @@ exports.VhdAbstract = class VhdAbstract { | |
stream.length = footer.currentSize | ||
return stream | ||
} | ||
|
||
/* | ||
* check if all the data of a child are already contained in this vhd | ||
*/ | ||
|
||
async containsAllDataOf(child) { | ||
julien-f marked this conversation as resolved.
Show resolved
Hide resolved
|
||
await this.readBlockAllocationTable() | ||
await child.readBlockAllocationTable() | ||
Comment on lines
+343
to
+344
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this method (and some others), are pitfalls, and should be implcitely called when necessary (e.g., when calling blocks). If you agree, I'll do the change. |
||
for await (const block of child.blocks()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't read blocks before checking the parent contains them. Maybe we should add another iterator ( |
||
const { id, data: childData } = block | ||
// block is in child not in parent | ||
if (!this.containsBlock(id)) { | ||
return false | ||
} | ||
const { data: parentData } = await this.readBlock(id) | ||
if (!childData.equals(parentData)) { | ||
return false | ||
} | ||
} | ||
return true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to release this in prod?