Skip to content
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

filesystem.py: add boot order attribute for filesystem device #3778

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion virttest/libvirt_xml/devices/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Filesystem(base.TypedDeviceBase):

__slots__ = ('accessmode', 'source', 'target', 'driver', 'binary', 'alias')
__slots__ = ('accessmode', 'source', 'target', 'driver', 'binary', 'alias', 'boot')

def __init__(self, type_name='mount', virsh_instance=base.base.virsh):
accessors.XMLAttribute('accessmode', self, parent_xpath='/',
Expand All @@ -29,6 +29,8 @@ def __init__(self, type_name='mount', virsh_instance=base.base.virsh):
accessors.XMLElementDict('alias', self,
parent_xpath='/',
tag_name='alias')
accessors.XMLAttribute('boot', self, parent_xpath='/',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider XMLElementDict if there are new attributes to 'boot' element in the future.
And we could keep the current implement if the chance of adding new attribute is really small.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it in current status because it is unlikely that there will be a new attribute to 'boot' element. If there are indeed changes later, we can update them together.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course.

tag_name='boot', attribute='order')
super(Filesystem, self).__init__(device_tag='filesystem',
type_name=type_name,
virsh_instance=virsh_instance)
Expand Down
Loading