RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1570549 - AttributeError: 'SYSInfo' object has no attribute 'parse'
Summary: AttributeError: 'SYSInfo' object has no attribute 'parse'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-23 08:17 UTC by Xiaodai Wang
Modified: 2019-08-06 13:08 UTC (History)
6 users (show)

Fixed In Version: virt-manager-1.5.0-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:08:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-manager debug log (3.39 KB, text/plain)
2018-04-23 08:20 UTC, Xiaodai Wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2232 0 None None None 2019-08-06 13:08:13 UTC

Description Xiaodai Wang 2018-04-23 08:17:21 UTC
Description of problem:
AttributeError: 'SYSInfo' object has no attribute 'parse'

Version-Release number of selected component (if applicable):
virt-manager-1.4.3-3.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. set smbios_mode to a value which is neighter 'host' nor 'emulate'.
# virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo --debug --disk none

Actual results:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtinst/cli.py", line 1204, in parse
    objs = self._parse(inst or self.guest)
  File "/usr/share/virt-manager/virtinst/cli.py", line 1631, in _parse
    VirtCLIParser._parse(self, inst)
  File "/usr/share/virt-manager/virtinst/cli.py", line 1172, in _parse
    param.parse_param(self, inst, self.support_cb)
  File "/usr/share/virt-manager/virtinst/cli.py", line 928, in parse_param
    self.val, self)
  File "/usr/share/virt-manager/virtinst/cli.py", line 1602, in set_smbios_mode_cb
    inst.sysinfo.parse(val)
AttributeError: 'SYSInfo' object has no attribute 'parse'

Expected results:
The guest should be installed successfully.

Additional info:

Comment 1 Xiaodai Wang 2018-04-23 08:20:10 UTC
Created attachment 1425574 [details]
virt-manager debug log

Comment 2 Cole Robinson 2018-04-24 16:33:15 UTC
Not sure how this was expected to ever work. I fixed it upstream:

commit a33ac920405c5d315e18c8dda65076bde1da92ae (HEAD -> master, origin/master, origin/HEAD)
Author: Cole Robinson <crobinso>
Date:   Tue Apr 24 12:26:08 2018 -0400

    cli: Fix --boot smbios_mode=sysinfo (bz 1570549)
    
    Not sure how this was expected to work, just make it do the simple
    thing and set the value in the XML. Add a test case for it

Comment 6 zhoujunqin 2019-05-06 07:31:19 UTC
I can reproduce this bug with package:

virt-manager-1.5.0-1.el7.noarch
virt-install-1.5.0-1.el7.noarch
virt-manager-common-1.5.0-1.el7.noarch

Steps to Reproduce:
1. set smbios_mode to a value which is neighter 'host' nor 'emulate'.
# virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo --disk none
ERROR    Error: --boot initargs=none,smbios_mode=sysinfo: 'SYSInfo' object has no attribute 'parse'
Even though, i set a value for "--sysinfo"
# virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo --sysinfo smbios --disk none
ERROR    Error: --boot initargs=none,smbios_mode=sysinfo: 'SYSInfo' object has no attribute 'parse'

Then try to verify this bug with new build:
virt-manager-1.5.0-3.el7.noarch
virt-install-1.5.0-3.el7.noarch
virt-manager-common-1.5.0-3.el7.noarch
libvirt-4.5.0-16.el7.x86_64
qemu-kvm-rhev-2.12.0-27.el7.x86_64

Steps:
Set smbios_mode to a value which is neighter 'host' nor 'emulate'.

Scenario-1 Without sysinfo value setting
# virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo  --disk none
WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

Starting install...
ERROR    XML error: Domain 'testvm' sysinfo are not available
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start testvm
otherwise, please restart your installation.

Result: "ERROR    XML error: Domain 'testvm' sysinfo are not available" is clear to user.

Scenario-2 With sysinfo value setting
# virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo  --sysinfo smbios --disk none --location http://download.eng.pek2.redhat.com/pub/rhel/released/RHEL-7/7.6/Server/x86_64/os/

Result:
2.1 The guest can be installed successfully.
2.2 XML is generated successfully.
  <sysinfo type='smbios'/>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
    <kernel>/var/lib/libvirt/boot/virtinst-vmlinuz._Nbyv7</kernel>
    <initrd>/var/lib/libvirt/boot/virtinst-initrd.img.DTNrid</initrd>
    <cmdline>inst.repo=http://download.eng.pek2.redhat.com/pub/rhel/released/RHEL-7/7.6/Server/x86_64/os/</cmdline>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>

@Pavel, please help me have a look of my verification steps, is it enough to verify this bug, thanks.

And I always have a question want to confirm with you, I can set invalid options for --sysinfo in Scenario-2.

# virt-install --sysinfo=?
--sysinfo options:
  baseBoard_asset
  baseBoard_location
  baseBoard_manufacturer
  baseBoard_product
  baseBoard_serial
  baseBoard_version
  bios_date
  bios_release
  bios_vendor
  bios_version
  clearxml
  system_family
  system_manufacturer
  system_product
  system_serial
  system_sku
  system_uuid
  system_version
  type
Here I use "--sysinfo 123", but the installation process stats successfully. Do you think it's a bug or not, thanks.
#  virt-install --name testvm --memory 1024 --boot initargs="none",smbios_mode=sysinfo  --sysinfo 123  --disk none

Comment 7 Pavel Hrdina 2019-05-06 12:08:40 UTC
Hi Junqin,

yes that is good enough to verify this bug.  In virt-manager/virt-install we don't
check every single value whether it makes sense, we leave it to libvirt as it would
be just duplicated work and it would get outdated if libvirt would change any check.

Comment 8 zhoujunqin 2019-05-07 09:29:48 UTC
(In reply to Pavel Hrdina from comment #7)
> Hi Junqin,
> 
> yes that is good enough to verify this bug.  In virt-manager/virt-install we
> don't
> check every single value whether it makes sense, we leave it to libvirt as
> it would
> be just duplicated work and it would get outdated if libvirt would change
> any check.

Hi Pavel,

Got it, thanks for your quick reply.
As you said, I try to edit a vm with following xml content.
# virsh edit rhel7.6
  <sysinfo type='aaa'/>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>

then failed to save with error information:
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element sysinfo in interleave
Element domain failed to validate content

Failed. Try again? [y,n,i,f,?]: 

Result: Yes, libvirt will check it.

So I move this bug from ON_QA to VERIFIED based on above testing result, thanks.

Comment 10 errata-xmlrpc 2019-08-06 13:08:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2232


Note You need to log in before you can comment on or make changes to this bug.