1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
user-level: 0.980
risc-v: 0.973
permissions: 0.971
register: 0.966
assembly: 0.963
debug: 0.961
peripherals: 0.961
network: 0.959
semantic: 0.958
performance: 0.954
arm: 0.953
architecture: 0.953
PID: 0.951
device: 0.951
graphic: 0.949
socket: 0.948
mistranslation: 0.944
vnc: 0.942
kernel: 0.940
files: 0.938
virtual: 0.936
hypervisor: 0.929
boot: 0.928
ppc: 0.918
TCG: 0.915
x86: 0.906
KVM: 0.898
i386: 0.897
VMM: 0.866
monitor socked path is cut a 105 characters
Starting a VM like so:
/usr/bin/qemu-system-x86_64 -machine accel=kvm -monitor unix:/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/gentoo-summerschool.img.monitor,server,nowait -name gentoo-summerschool -chardev socket,id=monitor,path=/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/monitor.sock,server,nowait -monitor chardev:monitor -chardev socket,id=serial0,path=/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/console.sock,server,nowait -serial chardev:serial0 -enable-kvm -cpu kvm64 -smp 2 -netdev tap,id=net0,script=/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/qemu-ifup.bash -device e1000,netdev=net0,mac=00:00:00:00:00:02 -drive id=disk,file=/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/gentoo-summerschool.img,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -m 2048 -vga qxl -spice port=2002,addr=192.168.4.2,password=NO-thats-not-my-pwd -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent
The path:
unix:/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/gentoo-summerschool.img.monitor
...is cut like so when I try to shutdown:
pink ~ # echo system_powerdown | socat - UNIX-CONNECT:/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschool/gentoo-summerschool.img.monitor
2014/06/08 06:39:01 socat[2344] E connect(3, AF=1 "/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/lv-gentoosummerschool/gentoo-summerschoo", 110): No such file or directory
pink ~ #
It does work with a sorter path like:
pink ~ # echo system_powerdown | socat - UNIX-CONNECT:'/srv/localfs/Samsung_SSD_840_PRO_Series_S1AXNSAF320206J/vg-virt/my.img.monitor'
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) system_powerdown
(qemu) pink ~ #
Triaging old bug tickets... can you still reproduce this issue with the latest version of QEMU? Or could we close this ticket nowadays?
On 10/03/2017 05:47 AM, Thomas Huth wrote:
> Triaging old bug tickets... can you still reproduce this issue with the
> latest version of QEMU? Or could we close this ticket nowadays?
This may be fixed by:
commit ad9579aaa16d5b385922d49edac2c96c79bcfb62
Author: Daniel P. Berrange <email address hidden>
Date: Thu May 25 16:53:00 2017 +0100
sockets: improve error reporting if UNIX socket path is too long
The 'struct sockaddr_un' only allows 108 bytes for the socket
path.
If the user supplies a path, QEMU uses snprintf() to silently
truncate it when too long. This is undesirable because the user
will then be unable to connect to the path they asked for.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
There's actually two bugs here.
First QEMU was truncating the UNIX, but because it used 'snprintf', QEMU truncated it at 107 characters and then added a trailing NUL, instead of truncating at 108 characters and not having a NUL (which is perfectly fine for AF_UNIX)
Second though if you look at the path socat is using, it has truncated it at 104 characters. So even if QEMU had correctly truncated at 108 characters, socat would still have failed.
QEMU git now just returns an immediate if the path is too long rather than truncating, so I think we can just close this.
|