-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add libvirt loader and QEMU child plugin #654
Add libvirt loader and QEMU child plugin #654
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #654 +/- ##
==========================================
+ Coverage 75.45% 75.48% +0.03%
==========================================
Files 296 298 +2
Lines 25643 25684 +41
==========================================
+ Hits 19348 19388 +40
- Misses 6295 6296 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dissect/target/loaders/libvirt.py
Outdated
if path.suffix.lower() != ".xml": | ||
return False | ||
|
||
return "<domain>" in path.read_text().lower() |
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.
Is this the first element? Maybe better to limit how many bytes you read to a sensible limit. You may accidentally read a .xml of several GB large.
dissect/target/loaders/libvirt.py
Outdated
xml_data = ElementTree.XML(self.path.read_text()) | ||
for disk in xml_data.findall("devices/disk/source"): | ||
if file := disk.get("file"): | ||
target.disk.add(container.open(file)) |
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.
Are these absolute paths? You should join on self.path
regardless to ensure that you're reading the file from the same target (local Path
or a bound TargetPath
).
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.
As far as I've seen, these paths are absolute. But it is fair it should be joined with self.path
78ff93c
to
9ae003b
Compare
9ae003b
to
2e7f786
Compare
Co-authored-by: Erik Schamper <[email protected]>
No description provided.