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

nodedev_xml: extend MdevXML with attr elements #3723

Merged

Conversation

smitterl
Copy link
Contributor

Add support for attribute elements of the mediated device capability xml, e.g.:

 <attr name='assign_adapter' value='3'/>
 <attr name='assign_domain' value='43'/>

@smitterl
Copy link
Contributor Author

Tested via autotest/tp-libvirt#5040

Copy link
Contributor

@cliping cliping left a comment

Choose a reason for hiding this comment

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

LGTM

@dzhengfy dzhengfy requested a review from chloerh July 25, 2023 08:15
@dzhengfy
Copy link
Contributor

@chloerh Could you help review it as you also have many experience on this?

return newone


class AttrXML(base.LibvirtXMLBase):
Copy link
Contributor

@chloerh chloerh Jul 25, 2023

Choose a reason for hiding this comment

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

According to the xml of <attr>, seems no need to define this class, we could simply define the accessor with 'has_subclass = False' and with shorter marshal functions, if <attr> doesn't have sub-element. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Like this:

accessors.XMLElementList('vcpupins', self, parent_xpath='/',
                                 marshal_from=self.marshal_from_vcpupins,
                                 marshal_to=self.marshal_to_vcpupins)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. It works well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for taking my suggestion, btw there's inspekt issue needs to be resovle.

Add support for attribute elements of the mediated device
capability xml, e.g.:

```
 <attr name='assign_adapter' value='3'/>
 <attr name='assign_domain' value='43'/>
```

Signed-off-by: Sebastian Mitterle <[email protected]>
@chloerh chloerh closed this Aug 7, 2023
@chloerh chloerh reopened this Aug 7, 2023
@chloerh chloerh merged commit 8181dfc into avocado-framework:master Aug 7, 2023
57 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants