Re: [Qemu-discuss] qemu-kvm hangs at boot when the disk interface is virtio.

2017-11-15 Thread Shiyao MA
My environment is macOS -> debian (vmware fusion) -> qemu-kvm.

I guess this might be the complication of vmware fusion, such that
nested virt acts abnormally.

I tested on a bare server running with debian and run qemu-kvm with
the same settings, the problem does not appear.

Best



[Qemu-discuss] Can't attach to SCSI controller

2017-11-15 Thread Ian Chapman

Hi,

Using qemu-system-i386, it seems completely impossible to attach a media 
image to a SCSI controller, other than the default which is an 
lsi53c895a. I specifically want to use the lsi53c810. As soon as I 
specify if=scsi as part of the -drive line, it insists on creating a
lsi53c895a and attaching it to that, regardless of what bus number or 
index number I specify. What am I missing?


Example command line: (Linux, qemu 2.9.1)

qemu-system-i386 -L . -M pc -hda disk.qcow2 \
-device lsi53c810,multifunction=on \
-m size=128M \
-drive if=scsi,index=0,media=cdrom,file=cd.iso


--
Ian Chapman.



[Qemu-discuss] Building issues with qemu-2.10.1

2017-11-15 Thread John Edward Serink
Hi All;

I am getting this error when building from source n Gentoo:
In file included from /usr/include/epoxy/egl.h:46:0,
 from /var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-
2.10.1/include/ui/egl-helpers.h:5,
 from /var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-
2.10.1/include/ui/spice-display.h:30,
 from 
/var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-2.10.1/ui/spice-
display.c:27:
/var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-2.10.1/ui/spice-display.c: 
In function
‘qemu_spice_gl_create_context’:
/var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-2.10.1/ui/spice-display.c:927:38:
error: expected expression before ‘EGLSurface’
 eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
  ^
/var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-2.10.1/ui/spice-display.c:927:54:
error: expected expression before ‘EGLSurface’
 eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
  ^
make: *** 
[/var/tmp/portage/app-emulation/qemu-2.10.1/work/qemu-2.10.1/rules.mak:66:
ui/spice-display.o] Error 1
make: *** Waiting for unfinished jobs
 * ERROR: app-emulation/qemu-2.10.1::gentoo failed (compile phase):
 *   emake failed
Here are my build options per the gentoo ebuild:
[ebuild U  ] app-emulation/qemu-2.10.1::gentoo [2.10.0::gentoo] USE="aio 
alsa bluetooth
bzip2 caps curl fdt filecaps gtk jpeg ncurses nls opengl pin-upstream-blobs png 
seccomp
spice usb vde vhost-net virgl vnc vte xattr -accessibility -debug (-glusterfs) 
-gnutls
-gtk2 -infiniband -iscsi -lzo -nfs -numa -pulseaudio -python -rbd -sasl -sdl* 
-sdl2* (-
selinux) -smartcard -snappy -ssh -static -static-user -systemtap -tci {-test} 
-usbredir
-virtfs -xen -xfs" LINGUAS="-bg -de_DE -fr_FR -hu -it -tr -zh_CN"
PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="x86_64 



I get almost exactly the same error when attempting to build spice-gtk-33-r2:
ch=native -mtune=native -c -o spicy-spicy.o `test -f 'spicy.c' || echo 
'./'`spicy.c
cc1: warning: /usr/local/include: No such file or directory 
[-Wmissing-include-dirs]
cc1: warning: /usr/local/include: No such file or directory 
[-Wmissing-include-dirs]
In file included from /usr/include/epoxy/egl.h:46:0,
 from spice-widget-priv.h:28,
 from spice-widget-egl.c:26:
spice-widget-egl.c: In function ‘spice_egl_init’:
spice-widget-egl.c:220:27: error: expected expression before ‘EGLDisplay’
 if (d->egl.display == EGL_NO_DISPLAY) {
   ^
spice-widget-egl.c:258:35: error: expected expression before ‘EGLContext’
   EGL_NO_CONTEXT,
   ^
spice-widget-egl.c:266:36: error: expected expression before ‘EGLSurface’
 eglMakeCurrent(d->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
^
spice-widget-egl.c:266:52: error: expected expression before ‘EGLSurface’
 eglMakeCurrent(d->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
^
spice-widget-egl.c: In function ‘spice_egl_unrealize_display’:
spice-widget-egl.c:404:31: error: expected expression before ‘EGLSurface’
 if (d->egl.surface != EGL_NO_SURFACE) {
   ^
spice-widget-egl.c:406:30: error: expected expression before ‘EGLSurface’
 d->egl.surface = EGL_NO_SURFACE;
  ^
spice-widget-egl.c:414:40: error: expected expression before ‘EGLSurface’
 eglMakeCurrent(d->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
^
spice-widget-egl.c:414:56: error: expected expression before ‘EGLSurface’
 eglMakeCurrent(d->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
^
spice-widget-egl.c:415:24: error: expected expression before ‘EGLContext’
EGL_NO_CONTEXT);
^
spice-widget-egl.c: In function ‘spice_egl_update_scanout’:
spice-widget-egl.c:665:40: error: expected expression before ‘EGLContext’
EGL_NO_CONTEXT,
^
make[4]: *** [Makefile:1327: spice-widget-egl.lo] Error 1
make[4]: *** Waiting for unfinished jobs
make[4]: Leaving directory 
'/var/tmp/portage/net-misc/spice-gtk-0.33-r2/work/spice-gtk-
0.33/src'
make[3]: *** [Makefile:1545: all-recursive] Error 1
make[3]: Leaving directory 
'/var/tmp/portage/net-misc/spice-gtk-0.33-r2/work/spice-gtk-
0.33/src'
make[2]: *** [Makefile:1048: all] Error 2
make[2]: Leaving directory 
'/var/tmp/portage/net-misc/spice-gtk-0.33-r2/work/spice-gtk-
0.33/src'
make[1]: *** [Makefile:658: all-recursive] Error 1
make[1]: Leaving directory 
'/var/tmp/portage/net-misc/spice-gtk-0.33-r2/work/spice-gtk-
0.33'
make: *** [Makefile:563: all] Error 2
 * ERROR: net-misc/spi

[Qemu-discuss] qemu VM cannot be killed

2017-11-15 Thread Lukáš Kubín
Hi, we've experienced an issue with kvm instance which got stuck at reboot.
It's an OpenStack environment, with OpenContrail networking (vrouter agent
running on host), Ubuntu 16.04.

Machine was first called to reboot from guest OS by user, had issues with
NFS unmount during that, user sent a hard-reboot call from OpenStack again
then. Then we (platform operator) got involved, tried to "virsh destroy" it
with this output:

error: Failed to destroy domain instance-4243
error: Failed to terminate process 140529 with SIGKILL: Device or resource
busy


Neither "kill -9" sent to the qemu process helped.

Good guys at OFTC:#virt have guided me to collect the following traces and
ask for help here:

# cat /proc/140529/wchan
vhost_net_ubuf_put_and_wait

# cat /proc/140529/stack
[] vhost_net_ubuf_put_and_wait+0x54/0xa0 [vhost_net]
[] vhost_net_ioctl+0x354/0x8a0 [vhost_net]
[] do_vfs_ioctl+0xa1/0x5f0
[] SyS_ioctl+0x79/0x90
[] entry_SYSCALL_64_fastpath+0x1e/0xa8
[] 0x

The versions we use are:

   - kernel 4.8.0-41-generic
   - qemu-kvm 1:2.5+dfsg-5ubuntu10.2~xenial0+contrail1
   - libvirt-bin 1.3.1-1ubuntu10.1~xenial1+contrail1

What can be the cause for this error? What can we do in such a situation to
destroy the VM - is physical server reboot the only option?

Thanks and greetings,

Lukáš


Re: [Qemu-discuss] Can't attach to SCSI controller

2017-11-15 Thread Aleksei
Your -hda parameter is not associated with -device paramater in any way. 
Here's an example of attaching drive to ahci bus, try modifying it to 
suit your needs:


-device ahci,id=ahci0 \
-device ide-hd,bus=ahci0.0,drive=drive0 \
-drive if=none,id=drive0,media=disk,file=/path/to/image.qcow2

/--Regards, Aleksei

/
On 15/11/17 12:21, Ian Chapman wrote:
Hi,

Using qemu-system-i386, it seems completely impossible to attach a media 
image to a SCSI controller, other than the default which is an 
lsi53c895a. I specifically want to use the lsi53c810. As soon as I 
specify if=scsi as part of the -drive line, it insists on creating a
lsi53c895a and attaching it to that, regardless of what bus number or 
index number I specify. What am I missing?


Example command line: (Linux, qemu 2.9.1)

qemu-system-i386 -L . -M pc -hda disk.qcow2 \
-device lsi53c810,multifunction=on \
-m size=128M \
-drive if=scsi,index=0,media=cdrom,file=cd.iso





[Qemu-discuss] Fwd: qemu VM cannot be killed

2017-11-15 Thread Lukáš Kubín
CC-ing Michael and Jason as I was suggested in OFTC:#virt forum. Thanks!

-- Forwarded message --
From: Lukáš Kubín 
Date: Wed, Nov 15, 2017 at 1:39 PM
Subject: qemu VM cannot be killed
To: qemu-discuss@nongnu.org


Hi, we've experienced an issue with kvm instance which got stuck at reboot.
It's an OpenStack environment, with OpenContrail networking (vrouter agent
running on host), Ubuntu 16.04.

Machine was first called to reboot from guest OS by user, had issues with
NFS unmount during that, user sent a hard-reboot call from OpenStack again
then. Then we (platform operator) got involved, tried to "virsh destroy" it
with this output:

error: Failed to destroy domain instance-4243
error: Failed to terminate process 140529 with SIGKILL: Device or resource
busy


Neither "kill -9" sent to the qemu process helped.

Good guys at OFTC:#virt have guided me to collect the following traces and
ask for help here:

# cat /proc/140529/wchan
vhost_net_ubuf_put_and_wait

# cat /proc/140529/stack
[] vhost_net_ubuf_put_and_wait+0x54/0xa0 [vhost_net]
[] vhost_net_ioctl+0x354/0x8a0 [vhost_net]
[] do_vfs_ioctl+0xa1/0x5f0
[] SyS_ioctl+0x79/0x90
[] entry_SYSCALL_64_fastpath+0x1e/0xa8
[] 0x

The versions we use are:

   - kernel 4.8.0-41-generic
   - qemu-kvm 1:2.5+dfsg-5ubuntu10.2~xenial0+contrail1
   - libvirt-bin 1.3.1-1ubuntu10.1~xenial1+contrail1

What can be the cause for this error? What can we do in such a situation to
destroy the VM - is physical server reboot the only option?

Thanks and greetings,

Lukáš


Re: [Qemu-discuss] Fwd: qemu VM cannot be killed

2017-11-15 Thread Michael S. Tsirkin
Yes - I suspect a packet is stuck somewhere in networking stack.
This is what vhost is waiting for.

Yes, host reboot is the only way out.

RHEL disables zero copy tx in vhost to avoid these issues.

On Wed, Nov 15, 2017 at 02:55:32PM +0100, Lukáš Kubín wrote:
> CC-ing Michael and Jason as I was suggested in OFTC:#virt forum. Thanks!
> 
> -- Forwarded message --
> From: Lukáš Kubín 
> Date: Wed, Nov 15, 2017 at 1:39 PM
> Subject: qemu VM cannot be killed
> To: qemu-discuss@nongnu.org
> 
> 
> Hi, we've experienced an issue with kvm instance which got stuck at reboot.
> It's an OpenStack environment, with OpenContrail networking (vrouter agent
> running on host), Ubuntu 16.04.
> 
> Machine was first called to reboot from guest OS by user, had issues with NFS
> unmount during that, user sent a hard-reboot call from OpenStack again then.
> Then we (platform operator) got involved, tried to "virsh destroy" it with 
> this
> output:
> 
> 
> error: Failed to destroy domain instance-4243
> error: Failed to terminate process 140529 with SIGKILL: Device or resource
> busy
> 
> 
> Neither "kill -9" sent to the qemu process helped.
> 
> Good guys at OFTC:#virt have guided me to collect the following traces and ask
> for help here:
> 
> 
> # cat /proc/140529/wchan
> vhost_net_ubuf_put_and_wait
> 
> # cat /proc/140529/stack
> [] vhost_net_ubuf_put_and_wait+0x54/0xa0 [vhost_net]
> [] vhost_net_ioctl+0x354/0x8a0 [vhost_net]
> [] do_vfs_ioctl+0xa1/0x5f0
> [] SyS_ioctl+0x79/0x90
> [] entry_SYSCALL_64_fastpath+0x1e/0xa8
> [] 0x
> 
> 
> The versions we use are:
> 
>   • kernel 4.8.0-41-generic
>   • qemu-kvm 1:2.5+dfsg-5ubuntu10.2~xenial0+contrail1
>   • libvirt-bin 1.3.1-1ubuntu10.1~xenial1+contrail1
> 
> What can be the cause for this error? What can we do in such a situation to
> destroy the VM - is physical server reboot the only option?
> 
> Thanks and greetings,
> 
> Lukáš
> 



Re: [Qemu-discuss] qemu-kvm hangs at boot when the disk interface is virtio.

2017-11-15 Thread Programmingkid

> On Nov 15, 2017, at 8:56 AM, qemu-discuss-requ...@nongnu.org wrote:
> 
> My environment is macOS -> debian (vmware fusion) -> qemu-kvm.
> 
> I guess this might be the complication of vmware fusion, such that
> nested virt acts abnormally.
> 
> I tested on a bare server running with debian and run qemu-kvm with
> the same settings, the problem does not appear.
> 
> Best

Is this a problem you noticed after upgrading QEMU? If this is a new problem, 
you might want to try 'git bisect' to find the commit that causes this problem.


Re: [Qemu-discuss] qemu-kvm hangs at boot when the disk interface is virtio.

2017-11-15 Thread Shiyao MA
On Wed, Nov 15, 2017 at 11:15 PM, Programmingkid
 wrote:
> Is this a problem you noticed after upgrading QEMU? If this is a new problem, 
> you might want to try 'git bisect' to find the commit that causes this 
> problem.


Thanks!  Problem solved; you point me to the right direction!

Adding a "-machine type=pc-i440fx-2.6", everything becomes normal.
However, for all version 2.x (x > 6), the guest OS will hang!

This problem exists if the first level hypervisor is VMWARE FUSION.


BTW, I wonder exact difference does "-machine type=pc-i440fx-2.x" bring about?


-- 
Best,
Shiyao