* [Qemu-devel] Monitor file path length limitation
@ 2017-05-24 15:16 Simon
2017-05-24 15:26 ` Eric Blake
0 siblings, 1 reply; 4+ messages in thread
From: Simon @ 2017-05-24 15:16 UTC (permalink / raw)
To: qemu-devel
Hello,
It seems that the monitor file path length is limited to about 100
characters (107 to be precise).
Currently I'm using the '-monitor' parameter to create the monitor file
in a directory which gather all the files related to a given VM (monitor
file, PID file, disk image, etc.):
-monitor
'unix:/home/user/vmtools/test/out/foobar.iso/foobar.iso_A/foobar.iso_B/foobar.iso_C/foobar.iso_D/foobar.iso_E/monitor.sock,server,nowait'
With this command Qemu does not produce any warning or error message but
create the socket file "mon" instead of the expected "monitor.sock".
Things go even worse if I add a further nesting:
-monitor
'unix:/home/user/vmtools/test/out/foobar.iso/foobar.iso_A/foobar.iso_B/foobar.iso_C/foobar.iso_D/foobar.iso_E/foobar.iso_F/monitor.sock,server,nowait'
Now, still without any warning, Qemu creates a file named "foo" in the
parent directory ('foobar.iso_E/') instead of the expected directory
('foobar.iso_E/').
Is there a clean way to work around this limitation? For instance, is
there an alternative option I can use to generate this monitor file? Or
should I just assume that absolute paths are not supported in the
'-monitor' option and change the working directory before launching Qemu
so I can pass "./monitor.sock" as monitor file path (I really prefer to
use absolute path whenever possible though).
As a side-note, is there any technical reason for such a limitation?
Regards,
Simon.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Monitor file path length limitation
2017-05-24 15:16 [Qemu-devel] Monitor file path length limitation Simon
@ 2017-05-24 15:26 ` Eric Blake
2017-05-24 15:39 ` Simon
2017-05-24 15:42 ` Daniel P. Berrange
0 siblings, 2 replies; 4+ messages in thread
From: Eric Blake @ 2017-05-24 15:26 UTC (permalink / raw)
To: Simon, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]
On 05/24/2017 10:16 AM, Simon wrote:
> Hello,
>
> It seems that the monitor file path length is limited to about 100
> characters (107 to be precise).
Welcome to the joy of Unix socket (AF_UNIX) files. The kernel imposes a
hard length limit on sockaddr_un.sun_path[] (see 'man 7 unix') - and it
is indeed 107 characters plus a NUL terminator.
> -monitor
> 'unix:/home/user/vmtools/test/out/foobar.iso/foobar.iso_A/foobar.iso_B/foobar.iso_C/foobar.iso_D/foobar.iso_E/monitor.sock,server,nowait'
>
>
> With this command Qemu does not produce any warning or error message but
> create the socket file "mon" instead of the expected "monitor.sock".
Ideally, qemu should be telling you your path is too long to be created
as a unix socket, and failing up front, rather than silently truncating
and perhaps doing the wrong thing.
> Is there a clean way to work around this limitation?
Don't use longer path names than the kernel supports.
>
> As a side-note, is there any technical reason for such a limitation?
Yes, but you'll have to ask kernel folks for the reason.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Monitor file path length limitation
2017-05-24 15:26 ` Eric Blake
@ 2017-05-24 15:39 ` Simon
2017-05-24 15:42 ` Daniel P. Berrange
1 sibling, 0 replies; 4+ messages in thread
From: Simon @ 2017-05-24 15:39 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel
Thank you for your answer Eric, I've learned a new thing today :) !
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Monitor file path length limitation
2017-05-24 15:26 ` Eric Blake
2017-05-24 15:39 ` Simon
@ 2017-05-24 15:42 ` Daniel P. Berrange
1 sibling, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-05-24 15:42 UTC (permalink / raw)
To: Eric Blake; +Cc: Simon, qemu-devel
On Wed, May 24, 2017 at 10:26:58AM -0500, Eric Blake wrote:
> On 05/24/2017 10:16 AM, Simon wrote:
> > Hello,
> >
> > It seems that the monitor file path length is limited to about 100
> > characters (107 to be precise).
>
> Welcome to the joy of Unix socket (AF_UNIX) files. The kernel imposes a
> hard length limit on sockaddr_un.sun_path[] (see 'man 7 unix') - and it
> is indeed 107 characters plus a NUL terminator.
>
> > -monitor
> > 'unix:/home/user/vmtools/test/out/foobar.iso/foobar.iso_A/foobar.iso_B/foobar.iso_C/foobar.iso_D/foobar.iso_E/monitor.sock,server,nowait'
> >
> >
> > With this command Qemu does not produce any warning or error message but
> > create the socket file "mon" instead of the expected "monitor.sock".
>
> Ideally, qemu should be telling you your path is too long to be created
> as a unix socket, and failing up front, rather than silently truncating
> and perhaps doing the wrong thing.
I just copied you on a patch todo that :-)
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-24 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 15:16 [Qemu-devel] Monitor file path length limitation Simon
2017-05-24 15:26 ` Eric Blake
2017-05-24 15:39 ` Simon
2017-05-24 15:42 ` Daniel P. Berrange
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.