XML error: No PCI buses available when defining MIPS VM

Bug #1561497 reported by Magnus
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
libvirt
Confirmed
Undecided
libvirt (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

When trying to define a VM using mips64el architecture, I get the following error message from virsh:

XML error: No PCI buses available

Using virt-manager results in a similar error message.

XML file used:

<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>qemu-malta</name>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='mips64el' machine='malta'>hvm</type>
    <kernel>/tmp/qemu.elf</kernel>
    <boot dev='hd'/>
  </os>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>R4000</model>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-mips64el</emulator>
    <interface type='bridge' trustGuestRxFilters='yes'>
      <source bridge='br0'/>
      <virtualport type='openvswitch'>
      </virtualport>
      <model type='virtio'/>
      <address type='virtio-mmio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-s'/>
  </qemu:commandline>
</domain>

Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04

libvirt-bin:
  Installed: 1.3.1-1ubuntu6
  Candidate: 1.3.1-1ubuntu6

Revision history for this message
In , Ian (ian-redhat-bugs) wrote :

Trying to create a MIPS guest via virt-manager and getting this error:

Unable to complete install: 'XML error: No PCI buses available'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2288, in _do_async_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 461, in start_install
    doboot, transient)
  File "/usr/share/virt-manager/virtinst/guest.py", line 396, in _create_guest
    self.domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3782, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: XML error: No PCI buses available

Some discussion of this issue took place a while ago.

  https://www.redhat.com/archives/libvir-list/2016-May/msg00197.html

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Magnus,
I didn't see this bug before as it was "before my time", so I beg your pardon for the late reply.

IMHO mips in qemu is mostly socially accepted bit-rot.
This is the same issue as [1] an open bug unhandled issue at [2].

[1]: https://www.redhat.com/archives/libvirt-users/2017-March/msg00032.html
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1432101

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I don't know if needed after all that time, but the TL;DR is that by default libvirt does not add a pci-root.

You can get around just doing so on your own, add:
  <controller type='pci' index='0' model='pci-root'/>

Mips also supports no custom cpu and I'm not sure on your openvswitch, so I was replacing this.

You can define e.g. [1] just fine, and if I'd have a kernel to boot it might even work.
Yet OTOH don't expect too much from MIPS support in general.

[1]: http://paste.ubuntu.com/25924130/

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Workaround provided, and known upstream issue - for now incomplete on more input.
Might be considered if upstream changes something, but even then likely not as SRU.

Fortunately a workaround was provided, so no blocker.

Changed in libvirt (Ubuntu):
status: Confirmed → Incomplete
status: Incomplete → Won't Fix
Changed in libvirt:
importance: Unknown → Undecided
status: Unknown → Confirmed
Revision history for this message
Aurelien Jarno (aurel32) wrote : Re: [Bug 1561497] [NEW] XML error: No PCI buses available when defining MIPS VM

On 2017-11-09 14:50, Launchpad Bug Tracker wrote:
> You have been subscribed to a public bug by philmd (philmd):
>
> When trying to define a VM using mips64el architecture, I get the
> following error message from virsh:
>
> XML error: No PCI buses available
>
> Using virt-manager results in a similar error message.

Please see https://www.redhat.com/archives/libvir-list/2016-May/msg00197.html

If someone has time to write the corresponding tests as requested and
get this patch integrated, that would be great.

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
<email address hidden> http://www.aurel32.net

Revision history for this message
In , hhan (hhan-redhat-bugs) wrote :

Hello Iran, could you reproduce it again?

Revision history for this message
Jonathan Race (chateaulav) wrote :

Issue still present when attempting to create MIPS guest via virt-manager, and adding additional environments with same issue (virt-install and openstack nova leveraging libvirt). Attempts were made across multiple paths still receiving same error message 'XML error: No PCI buses available' when trying to define a VM using mips64el architecture.

System Information:

Description: Ubuntu Focal Fossa
Release: 20.04.3 LTS
Linux version 5.4.0-88-generic (buildd@lgw01-amd64-008) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 (Ubuntu 5.4.0-88.99-generic 5.4.140)

Binary Information:

/usr/sbin/libvirtd
libvirtd (libvirt) 6.0.0

XML and Trace Errors:

- virt-install attempt
### https://pastebin.com/nuPPieaw
Error Message: ERROR XML error: No PCI buses available

- virt-manager attempt
### https://pastebin.com/camUditW
Error Message: libvirt.libvirtError: XML error: No PCI buses available

- openstack attempt
### https://pastebin.com/3Tsj7Cxz
### https://pastebin.com/6VunTvpy
Error Message: libvirt.libvirtError: XML error: No PCI buses available

reference for original patch details: https://listman.redhat.com/archives/libvir-list/2016-May/msg00197.html

Revision history for this message
In , jrace (jrace-redhat-bugs) wrote :

Issue still present when attempting to create MIPS guest via virt-manager, and adding additional environments with same issue (virt-install and openstack nova leveraging libvirt). Attempts were made across multiple paths still receiving same error message 'XML error: No PCI buses available' when trying to define a VM using mips64el architecture.

System Information:

Description: Ubuntu Focal Fossa
Release: 20.04.3 LTS
Linux version 5.4.0-88-generic (buildd@lgw01-amd64-008) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 (Ubuntu 5.4.0-88.99-generic 5.4.140)

Binary Information:

/usr/sbin/libvirtd
libvirtd (libvirt) 6.0.0

XML and Trace Errors:

- virt-install attempt
### https://pastebin.com/nuPPieaw
Error Message: ERROR XML error: No PCI buses available

- virt-manager attempt
### https://pastebin.com/camUditW
Error Message: libvirt.libvirtError: XML error: No PCI buses available

- openstack attempt
### https://pastebin.com/3Tsj7Cxz
### https://pastebin.com/6VunTvpy
Error Message: libvirt.libvirtError: XML error: No PCI buses available

reference for original patch details: https://listman.redhat.com/archives/libvir-list/2016-May/msg00197.html
reference for original ubuntu bug details: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1561497

Revision history for this message
In , smooney (smooney-redhat-bugs) wrote :

i am not familar with the mips emulation but just in case its useful I suspect this is related to the machine type
https://www.qemu.org/docs/master/system/target-mips.html
the default one i don't think support PCI devices so malta? might be required.

the Loongson-3 virtual platform might also be work trying
https://www.phoronix.com/scan.php?page=news_item&px=Loongson3-Linux-5.8-KVM-Virt
it sound like it a realitive recent platform.

https://listman.redhat.com/archives/libvir-list/2016-May/msg00197.html
which you reference before was related to the malta machine type.
so it seam to confirm it has a root PCIe controller so that is probably the best place to start.

Revision history for this message
In , jrace (jrace-redhat-bugs) wrote :
Download full text (4.3 KiB)

All associated mailing lists relating to this bug:

https://listman.redhat.com/archives/libvir-list/2016-May/msg00197.html
- associated code:

Signed-off-by: Aurelien Jarno <aurelien aurel32 net>
---
 src/qemu/qemu_domain.c | 15 ++++++++++++++-
 src/qemu/qemu_domain.h | 1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 173f82c..75b0545 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 173f82c..75b0545 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1763,6 +1763,14 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
             addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
         break;

+ case VIR_ARCH_MIPS:
+ case VIR_ARCH_MIPSEL:
+ case VIR_ARCH_MIPS64:
+ case VIR_ARCH_MIPS64EL:
+ if (qemuDomainMachineIsMalta(def))
+ addPCIRoot = true;
+ break;
+
     case VIR_ARCH_PPC64:
     case VIR_ARCH_PPC64LE:
         addPCIRoot = true;
@@ -4654,6 +4662,11 @@ qemuDomainMachineIsVirt(const virDomainDef *def)
            STRPREFIX(def->os.machine, "virt-");
 }

+bool
+qemuDomainMachineIsMalta(const virDomainDef *def)
+{
+ return STRPREFIX(def->os.machine, "malta");
+}

 static bool
 qemuCheckMemoryDimmConflict(const virDomainDef *def,
@@ -4830,7 +4843,7 @@ bool
 qemuDomainMachineHasBuiltinIDE(const virDomainDef *def)
 {
     return qemuDomainMachineIsI440FX(def) ||
- STREQ(def->os.machine, "malta") ||
+ qemuDomainMachineIsMalta(def) ||
         STREQ(def->os.machine, "sun4u") ||
         STREQ(def->os.machine, "g3beige");
 }
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 95f821c..adba5fa 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -585,6 +585,7 @@ bool qemuDomainMachineIsI440FX(const virDomainDef *def);
 bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
 bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
 bool qemuDomainMachineIsVirt(const virDomainDef *def);
+bool qemuDomainMachineIsMalta(const virDomainDef *def);
 bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);

 int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
--

https://www.spinics.net/linux/fedora/libvir/msg227695.html
- references general libvirt pci bus error

https://www.spinics.net/linux/fedora/libvir/msg227696.html
- associated code:

Signed-off-by: Lubomir Rintel <lkundrak@xxxxx>
---
 src/util/virarch.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/util/virarch.h b/src/util/virarch.h
index 528f84f8a5..81b1b27a57 100644
--- a/src/util/virarch.h
+++ b/src/util/virarch.h
@@ -95,6 +95,11 @@ typedef enum {
 #define ARCH_IS_S390(arch) ((arch) == VIR_ARCH_S390 ||\
                             (arch) == VIR_ARCH_S390X)

+#define ARCH_IS_MIPS(arch) ((arch) == VIR_ARCH_MIPS ||\
+ (arch) == VIR_ARCH_MIPSEL ||\
+ (arch) == VIR_ARCH_MIPS64 ||\
+ (arch) == VIR_ARCH_MIPS64EL)
+
 #define ARCH_IS_MIPS64(arch) ((arch) == VIR_ARCH_MIPS64 ||\
                               (a...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.