You are not logged in.

#1 2019-10-08 23:16:49

lula
Member
Registered: 2009-07-16
Posts: 71

qemu/kvm xf86-video-qxl spice

I've been struggling for days now to get a vm running with the qxl driver and spice, which worked really good the last time i've tried (and running for some years, same environment arch host, arch guest), but i wasn't able to run stable neither a display manager nor a DE (xfce4) on the guest. I've reread the wiki again and searched the forum and found some people obviously having the same or similar problems:

r0b0t:

https://bbs.archlinux.org/viewtopic.php?id=245954
https://bbs.archlinux.org/viewtopic.php?id=246072


klapauzius:

https://bbs.archlinux.org/viewtopic.php?id=249015

and maybe some others i missed

My solution is to recompile the qxl driver from the aur-git package ( https://aur.archlinux.org/packages/xf86-video-qxl-git ) with some changes:


diff -u PKGBUILD.aur PKGBUILD

--- PKGBUILD.aur        2019-10-08 23:25:05.396488296 +0200
+++ PKGBUILD    2019-10-08 23:36:09.989676468 +0200
@@ -4,7 +4,7 @@
 
 _pkgname=xf86-video-qxl
 pkgname=$_pkgname-git
-pkgver=0.1.5
+pkgver=0.1.5.15.g922ec51
 pkgrel=1
 pkgdesc='X Window System QXL driver including Xspice server'
 arch=('i686' 'x86_64')
@@ -13,9 +13,9 @@
 depends=('xf86dgaproto' 'xproto' 'fontsproto' 'randrproto' 'renderproto'
          'videoproto' 'resourceproto' 'scrnsaverproto' 'spice')
 optdepends=('python2: Xspice server')
-makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=23' 'spice-protocol')
+makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=24.0' 'spice-protocol')
 provides=('xf86-video-qxl')
-conflicts=('xf86-video-qxl' 'X-ABI-VIDEODRV_VERSION<23' 'X-ABI-VIDEODRV_VERSION>=24')
+conflicts=('xf86-video-qxl' 'X-ABI-VIDEODRV_VERSION<24' 'X-ABI-VIDEODRV_VERSION>=25')
 source=('git://anongit.freedesktop.org/xorg/driver/xf86-video-qxl')
 sha256sums=('SKIP')
 
@@ -41,4 +41,3 @@
     install -D -m644 $srcdir/$_pkgname/COPYING \
       $pkgdir/usr/share/licenses/$pkgname/LICENSE
 }
-

where makedpedends and conflicts are the essential lines (pkgver was changed automatically)

I ended up with a package xf86-video-qxl-git-0.1.5.15.g922ec51-1-x86_64.pkg.tar.xz, which works as expected (good performance, copy/paste from/to guest) and running stable, as far as i can tell by now

Offline

#2 2019-10-09 00:20:25

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

Compared to the official there are 15 additional commits since 8d344cf49fdb021ab80354eaaa57a419a6746a56
Could you determine which ones are needed and open a bug report on the arch bugtracker to have them applied?

Last edited by loqs (2019-10-09 00:21:36)

Offline

#3 2019-10-09 18:51:23

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Of course, I can create a bug report, but to determine which of these 15 commits make it work, is beyond my possibillities. I'd also like to wait for some feedback from other users to see if it works for them too. Did you try it with the git-driver?

Offline

#4 2019-10-09 19:03:25

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

git bisection can help reduce the number of tests you need to perform from 15 to in a best case 5 to 6.
This best case assumes every bisection point can be tested.
klapauzius thread is only a month old so you could post in that asking for a test.
I do not use qxl so can not test.

Offline

#5 2019-10-09 21:11:35

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

I' just read the wiki pages Bisecting Bugs with Git ( https://wiki.archlinux.org/index.php/Bi … _with_Git)  and Git ( https://wiki.archlinux.org/index.php/Git), because i'm not familiar with git, only used svn. The example refers to a good old working revision and a bad new one. My problem is that i can't tell which one worked in the past so i've tried it the other way round

git log --oneline

922ec51 (HEAD -> master, origin/master, origin/HEAD, refs/bisect/good-922ec516beaae0c0735bbd46d470908f243e3605) Correct a long standing led state bug in XSpice.
e298116 Update configure.ac bug URL for gitlab migration
d92e9a8 Update README for gitlab migration
cf2254c qxl: Initialize prev field while dup surface list
64cb597 Make output names match modesetting driver
505a8bb Make output name numbering 1-based
ee8f904 qxl: call provider init
78abd52 modesetting: Validate the atom for enum properties
0728e08 Make some variables static
0e86e9d Make some function static
aa4359f Spelling and typo fixes in some comments
eaefd19 Spelling fixes in the READMEs and configuration samples
9a7eb40 Xspice: Fix Python3 str() vs bytes() confusion
b9955a3 Xspice: Remove extra space before assignment
69cf5e4 Xspice: Use print("") instead of print ""
8d344cf (tag: xf86-video-qxl-0.1.5, refs/bisect/bad) NEWS: Xspice now works with X.org 1.19

git bisect start
LC_ALL=C git bisect good 922ec51
LC_ALL=C git bisect bad 8d344cf
Some good revs are not ancestors of the bad rev.
git bisect cannot work properly in this case.
Maybe you mistook good and bad revs?

"Some good revs are not ancestors of the bad rev. git bisect cannot work properly in this case." does not sound good, where's my mistake or is that just not possible?

Offline

#6 2019-10-09 21:16:58

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

Ah I should have documented this.  https://stackoverflow.com/questions/154 … ood-commit

Offline

#7 2019-10-09 21:38:38

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

The second solution from the stackoverflow page also came to my mind, but to swap good and bad probably makes a "knot in your brain" :-) (german saying/slang)

Last edited by lula (2019-10-09 21:49:04)

Offline

#8 2019-10-09 21:54:41

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Another thing i noticed:

git bisect reset
M       scripts/Xspice
...


git diff scripts/Xspice
diff --git a/scripts/Xspice b/scripts/Xspice
index 927dcb1..d0a4ec9 100755
--- a/scripts/Xspice
+++ b/scripts/Xspice
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 
 """
 Xspice


On the host:
ls -l $(which python)
lrwxrwxrwx 1 root root 7  4. Okt 08:57 /usr/bin/python -> python3
ls -l $(which python2)
lrwxrwxrwx 1 root root 9 11. Mär 2019  /usr/bin/python2 -> python2.7

On the guest:
ls -l $(which python)
lrwxrwxrwx 1 root root 7  4. Okt 08:57 /usr/bin/python -> python3
ls -l $(which python2)
which: no python2 in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

but maybe that's not important...

Offline

#9 2019-10-09 23:14:57

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

So i've finished bisecting the sources and ended up with:

LC_ALL=C git status 
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   scripts/Xspice

no changes added to commit (use "git add" and/or "git commit -a")

LC_ALL=C git  bisect start --term-new=fixed --term-old=unfixed 

LC_ALL=C git  bisect fixed master

LC_ALL=C git bisect unfixed 8d344cf
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[0728e0851f776a273e5c559a23dca7ef40be405f] Make some variables static

LC_ALL=C git bisect fixed 0728e08
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[9a7eb40fa23b908d9f62a8f04933fdafd04d6b88] Xspice: Fix Python3 str() vs bytes() confusion

LC_ALL=C git bisect fixed 9a7eb40 
Bisecting: 0 revisions left to test after this (roughly 1 step)
error: Your local changes to the following files would be overwritten by checkout:
        scripts/Xspice
Please commit your changes or stash them before you switch branches.
Aborting

So, where to go from here? All commits seems to be OK, the only difference is the #! python/phyton2 on the build host? No, the PKGBUILD in the official package https://git.archlinux.org/svntogit/comm … -video-qxl also has in the prepare section

# this is python 2.x
sed -i '1c #!/usr/bin/python2' scripts/Xspice

Offline

#10 2019-10-09 23:41:56

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

Change the PKGBUILD to use sed in package instead of prepare e.g.

-prepare() {
-    cd $_pkgname
-    sed -i '1c #!/usr/bin/python2' scripts/Xspice
-}
-
 build() {
     cd $_pkgname
     ./autogen.sh --prefix=/usr --enable-xspice=yes
@@ -37,7 +32,8 @@ build() {
 
 package() {
     cd $_pkgname
-    make DESTDIR=$pkgdir install
+    make DESTDIR="$pkgdir" install
+    sed -i '1c #!/usr/bin/python2' "$pkgdir"/usr/bin/Xspice
     install -D -m644 $srcdir/$_pkgname/COPYING \
-      $pkgdir/usr/share/licenses/$pkgname/LICENSE
+      "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }

Then `git reset --hard` then try `LC_ALL=C git bisect fixed 9a7eb40` again

Offline

#11 2019-10-10 00:48:01

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

LC_ALL=C git bisect fixed 9a7eb40
Bisecting: 0 revisions left to test after this (roughly 1 step)
[b9955a35b42c156c343bd6f673c3e973397ce654] Xspice: Remove extra space before assignment

LC_ALL=C  git bisect fixed 
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[69cf5e40b2b6a0188b9aa88b66b683bd461afbd1] Xspice: Use print("") instead of print ""

LC_ALL=C  git bisect fixed 
69cf5e40b2b6a0188b9aa88b66b683bd461afbd1 is the first fixed commit
commit 69cf5e40b2b6a0188b9aa88b66b683bd461afbd1
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Wed Feb 8 15:23:56 2017 +0100

    Xspice: Use print("") instead of print ""
    
    This allows Xspice to run when using python3 instead of python2

 scripts/Xspice | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

ended up with a working driver. So what's this gonna tell us? The PKGFILE in the official repository is wrong somehow?

Offline

#12 2019-10-10 13:15:24

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

Looking very much look a difference in the PKGBUILD or the build environment used.  If you build the PKGBUILD arch uses does that work?

git clone git://git.archlinux.org/svntogit/community.git --single-branch --branch "packages/xf86-video-qxl"
cd community/tunk
makepkr -rsi

Offline

#13 2019-10-10 15:48:35

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

I just grabbed the PKGBUILD from the website and rebuild the official driver and it does not work. In the official PKGBUILD are some notices about compiler flags and in one of the links ( https://bugs.archlinux.org/task/54845 )  there's a comment:

Comment by Jan de Groot (JGC) - Thursday, 20 July 2017, 11:59 GMT
X.org and drivers cannot use "-z now" in LDFLAGS. Fedora disables hardened build for Xorg and all drivers, so we should consider removing -z now from LDFLAGS when building X and drivers.


I just added a comment to the official build

diff -u  PKGBUILD.org PKGBUILD 
--- PKGBUILD.org        2019-10-10 17:31:14.199982352 +0200
+++ PKGBUILD    2019-10-10 17:32:19.963851827 +0200
@@ -39,7 +39,7 @@
         # See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
         export CFLAGS=${CFLAGS/-fno-plt}
         export CXXFLAGS=${CXXFLAGS/-fno-plt}
-        export LDFLAGS=${LDFLAGS/,-z,now}
+        #~ export LDFLAGS=${LDFLAGS/,-z,now}
 
        autoreconf -fi
        ./configure \

and recompiled the source and got a working package

Last edited by lula (2019-10-10 23:04:14)

Offline

#14 2019-10-10 20:59:21

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

If you rebuild using extra-x86_64-build from the devtools package instead of makepkg so the package is built in a clean chroot does it still fail without removing -z now from LDFLAGS?

Offline

#15 2019-10-10 21:48:19

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Yes, same problem, hanging machine after starting xfce4 through lightdm, no access to the machine not even per ssh, from where i start the lightdm.service manually at the moment

Offline

#16 2019-10-10 21:59:23

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

I suggest reporting it as a packaging bug on the arch bug tracker.

Offline

#17 2019-10-10 22:48:51

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Yes, I'll do that after waiting for some feedback of others using qxl for some time. I can live with the git-driver working, anyway thanks for your help loqs

Last edited by lula (2019-10-10 22:49:38)

Offline

#18 2019-10-11 16:38:18

klapauzius
Member
Registered: 2019-07-22
Posts: 44

Re: qemu/kvm xf86-video-qxl spice

Hi lula, I did a

git clone https://aur.archlinux.org/xf86-video-qxl-git.git
cd xf86-video-qxl-git
cp PKGBUILD PKGBUILD.aur
nano PKGBUILD
diff -u PKGBUILD.aur PKGBUILD

to put the changes you suggested into place, a

makepkg

gives my a

configure: error: Package requirements (spice-server >= 0.6.3) were not met:

Package 'libcacard', required by 'spice-server', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables SPICE_CFLAGS
and SPICE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Found and installed package 'libcacard'. Compile goes through now.

Last edited by klapauzius (2019-10-11 16:42:53)

Offline

#19 2019-10-11 16:42:26

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: qemu/kvm xf86-video-qxl spice

Add libcacard to the PKGBUILD depends.

Offline

#20 2019-10-11 17:26:45

klapauzius
Member
Registered: 2019-07-22
Posts: 44

Re: qemu/kvm xf86-video-qxl spice

Hey, good work, lula! The xf86-video-qxl driver works (in my setting) now.

As far as I can tell, this is more or less just a version mismatch?!? Someone in charge of the arch repository forgot to pull the current xf86-video-qxl-driver from upstream into the current arch repositories?

Last edited by klapauzius (2019-10-11 17:30:58)

Offline

#21 2019-10-12 07:36:48

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Good to hear, that it's working for you too.

klapauzius wrote:

As far as I can tell, this is more or less just a version mismatch?!? Someone in charge of the arch repository forgot to pull the current xf86-video-qxl-driver from upstream into the current arch repositories?

It seems to be a little bit more complicated. Arch uses the actual stable version (see  https://xorg.freedesktop.org/releases/i … al/driver/ ) of the driver, but there seems to be a problem how it's built on arch in the official repository. The version arch uses works, if you compile it with other options, see my post at https://bbs.archlinux.org/viewtopic.php … 5#p1867735

Offline

#22 2019-10-14 10:30:11

klapauzius
Member
Registered: 2019-07-22
Posts: 44

Re: qemu/kvm xf86-video-qxl spice

Interesting, although I don't know what these compiler-flags do, I'm glad you have found a way to build a working driver for the current arch enviroment, thx again.

Offline

#23 2019-10-21 22:07:00

lula
Member
Registered: 2009-07-16
Posts: 71

Re: qemu/kvm xf86-video-qxl spice

Offline

#24 2019-11-26 13:50:49

chriswyatt
Member
Registered: 2019-11-26
Posts: 4

Re: qemu/kvm xf86-video-qxl spice

Did you ever have any more luck after creating a 'kind of working package'?

Offline

Board footer

Powered by FluxBB