Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1588447

Summary: Forbid relative paths for network disk unix socket
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, libvirt-maint, pkrempa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1588451 (view as bug list) Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 910269, 1588451    

Description Richard W.M. Jones 2018-06-07 11:19:45 UTC
Description of problem:

https://www.redhat.com/archives/libvir-list/2018-June/msg00490.html

If you have a reference to a relative path for a socket,
these no longer work.  They used to in older versions of libvirt,
and they still work on certain architectures (for example, x86_64
still works, but i686 fails).

libvirt should either reject them if they are wrong, or be fixed
so that it works like it used to.

If you decide to reject them, please clone this bug for
libguestfs because we will need to fix the paths that we
pass to libvirt.

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

libvirt 4.4.0-1.fc29

How reproducible:

Unknown, only on certain architectures at certain times.
I was only able to reliably reproduce on i686 in a Koji
build using qemu:///session.

Steps to Reproduce:

1. Start nbdkit serving over a local Unix domain socket in the
current directory:

rm -f my.sock
nbdkit -f -v -U my.sock example1

2. Create a guest which has a disk like:

  <disk device="disk" type="network">
    <source protocol="nbd">
      <host transport="unix" socket="my.sock"/>
    </source>
    <target dev="sda" bus="scsi"/>
    <driver name="qemu" type="raw" cache="writeback"/>
  </disk>

3. Start the guest under qemu:///session

4. Fails with:

  internal error: process exited while connecting to monitor: 2018-06-06T17:02:5
4.450507Z qemu-system-i386: -drive
file=nbd+unix://?socket=my.sock,format=raw,if=none,id=drive-scsi0-0-0-0,cache=w
riteback: Failed to connect socket my.sock: No such file or directory [code=1
int1=-1]

Comment 1 Peter Krempa 2018-06-07 11:29:12 UTC
The XML schema for the network disk unix socket backing always called for an 'absFilePath' so the given XML is not valid.

I think we want to enforce absolute path even in the code for APPS which don't pass correct XML to libvirt.

Comment 2 Daniel Berrangé 2018-06-07 12:44:32 UTC
Even if we don't intend to support relative paths, I'm still left wondering what we changed in libvirt that breaks the way they used to work, especially because its said to be architecture specific breakage. I'm concerned that whatever the root cause was, may have an impact on something else that we do care about supporting