Bug 1262127

Summary: Better diagnostic message when virbr0 doesn't exist
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-11 11:01:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2015-09-10 21:18:53 UTC
Description of problem:

If virbr0 (or whatever LIBGUESTFS_BACKEND_SETTINGS=network_bridge=...
points to) doesn't exist, then when we start libvirt we get a
pretty useless error:

  virt-builder: error: libguestfs error: could not create appliance through 
  libvirt.

  Try running qemu directly without libvirt using this environment variable:
  export LIBGUESTFS_BACKEND=direct

  Original error from libvirt: Cannot get interface MTU on 'virbr0': No such 
  device [code=38 domain=0]

We could avoid this error entirely by checking if the network
exists before starting libvirt.

Version-Release number of selected component (if applicable):

libguestfs from git

How reproducible:

100%

Steps to Reproduce:

$ LIBGUESTFS_BACKEND=libvirt \
  LIBGUESTFS_BACKEND_SETTINGS=network_bridge=nosuchnetwork \
  guestfish --network run
libguestfs: error: could not create appliance through libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: failed to retrieve file descriptor for interface: Transport endpoint is not connected [code=38 domain=10]

Comment 2 Richard W.M. Jones 2015-09-10 22:07:28 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2015-September/msg00042.html

Comment 3 Richard W.M. Jones 2015-09-11 11:01:26 UTC
Fixed upstream in libguestfs >= 1.31.6.