Re: [libvirt] [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before creating it

2018-01-05 Thread Andrea Bolognani
On Fri, 2018-01-05 at 14:38 +0100, Michal Privoznik wrote: > > However, later on: > > > > > > +virReportSystemError(errno, > > > > + _("Unable to create symlink %s"), > > > > + data->target); > > > > +goto clea

Re: [libvirt] [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before creating it

2018-01-05 Thread Michal Privoznik
On 01/05/2018 12:29 PM, Andrea Bolognani wrote: > On Fri, 2018-01-05 at 12:14 +0100, Andrea Bolognani wrote: >>> if (isLink) { >>> VIR_DEBUG("Creating symlink %s -> %s", data->file, data->target); >>> + >>> +/* First, unlink the symlink target. Symlinks change and >>> +

Re: [libvirt] [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before creating it

2018-01-05 Thread Andrea Bolognani
On Fri, 2018-01-05 at 12:14 +0100, Andrea Bolognani wrote: > > if (isLink) { > > VIR_DEBUG("Creating symlink %s -> %s", data->file, data->target); > > + > > +/* First, unlink the symlink target. Symlinks change and > > + * therefore we have no guarantees that pre-exist

Re: [libvirt] [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before creating it

2018-01-05 Thread Andrea Bolognani
On Thu, 2018-01-04 at 11:17 +0100, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1528502 > > So imagine you have /dev/blah symlink which points to /dev/sda. > You attach /dev/blah as disk to your domain. Libvirt correctly > creates the /dev/blah -> /dev/sda symlink in the q

[libvirt] [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before creating it

2018-01-04 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1528502 So imagine you have /dev/blah symlink which points to /dev/sda. You attach /dev/blah as disk to your domain. Libvirt correctly creates the /dev/blah -> /dev/sda symlink in the qemu namespace. However, then you detach the disk, change the symlink