quickemu icon indicating copy to clipboard operation
quickemu copied to clipboard

Check whether smartcard is supported

Open lj3954 opened this issue 7 months ago • 11 comments

Fixes #888

lj3954 avatar Dec 29 '23 22:12 lj3954

Hi Liam. I have been looking at this and (https://github.com/quickemu-project/quickemu/issues/888) this morning ...

Couple of things:

First is the quickemu variable "$QEMU" should be used otherwise we break the ability to switch system type. ie we should test with if "$QEMU"-chardev spicevmc,id=ccid,name= etc.

I can think of instances where this might happen. Certainly with qqX.

Secondly #888 refers to using QEMU 8.2. I think the real problem lies here. I don't think 8.2 is really release ready. I am not sure why Didier is using it?

New releases of QEMU are well known for being buggy. https://qemu.readthedocs.io for example routes itself to version 8.2 and ends up with a 404 error. And https://readthedocs.org/projects/qemu/builds/ shows that 8.2 is consistently failing to build.

When I test qemu-system-x86_64 -chardev spicevmc,id=ccid,name= against QEMU 8.0.4 and QEMU 8.1.3 they both show smartcard as available. So 8.2 may in fact have the smartcard option, it's just that there's a bug in that release .....

Edit. In fact, looking here, the what appears to be relevant, code doesn't seem to have changed in years

https://github.com/qemu/qemu/blame/v8.2.0/chardev/spice.c

TuxVinyards avatar Dec 30 '23 12:12 TuxVinyards

I've fixed it to use the QEMU variable. I disagree that QEMU 8.2 should be a problem. It was released 10 days ago, and is already in the stable repositories of distros such as Arch. The smartcard option is definitely not unsupported in QEMU 8.2. It's just not enabled in that build. You can clearly find in the build log they posted (https://slackware.uk/slint/x86_64/slint-15.0/source/qemu/LOG_8.2.0) that smartcard support is explicitly disabled. I've been using QEMU 8.2 for several days already since one of my partitions has Fedora Rawhide installed on it, and it hasn't given me any issues.

lj3954 avatar Dec 30 '23 18:12 lj3954

Thanks for the var fix.

Haven't tried 8.2 yet ...

👍

TuxVinyards avatar Dec 30 '23 18:12 TuxVinyards

This isn't affecting all distros. My feeling is that issue is down to differing Qemu builds and/or differing dependency builds in different distros. There was similar problem back in June too, last year #717

Manjaro offered updates to Qemu 8.2 yesterday. It all works fine. Smartcard is present as normal.

8 2 smartcard

Irrespectively, I have added a hot fix for this problem to qqX this morning while we wait for a new quickemu update ...

https://github.com/TuxVinyards/qqX/releases/tag/1.4.05

TuxVinyards avatar Jan 03 '24 15:01 TuxVinyards

That is correct. As I mentioned in my previous comment, the smartcard feature was explicitly disabled in that build of QEMU; the release had nothing to do with it.

lj3954 avatar Jan 03 '24 15:01 lj3954

It's a neat test that you are using. I'm using exactly the same one in qqX.

The qemu request is passed and grepped for the term 'smartcard'. No?

So, looking closely at the screenshot that I posted, Manjaro now has qemu 8.2 and passes your test as okay.

It also works perfectly fine. And with the 'smartcard' args in place ...

Have we got our wires crossed somewhere ??

TuxVinyards avatar Jan 03 '24 17:01 TuxVinyards

QEMU 8.2 works just fine as long as it's built with smartcard support, it should pass the test and thus add the arguments. It doesn't matter what the QEMU version is. This check specifically fixes quickemu when QEMU is built without smartcard support. The major distros package it with smartcard support enabled, but some may not and some people build QEMU themselves.

You labelled it as a fix for upstream changes, but that is not correct. QEMU 8.2 did not change anything. It's just the specific build of QEMU that the person in #888 used, or others using that distro's package or another QEMU build without the feature.

lj3954 avatar Jan 03 '24 23:01 lj3954

I did give your PR a :+1: earlier. It was a good addition, after you put in the variable.

Looks like my original doubts over 8.2 itself were unfounded. But to say "QEMU 8.2 did not change anything" would not be right either. This upstream change has caused things to happen. And this is what I meant ....

Hopefully both our fixes, yours and my interpretation of yours, will improve the situation.

As this isn't the first occasion distro maintainers have built Qemu without smartcard enabled ie #717 let me give your PR two extra +1's :+1: :+1:

TuxVinyards avatar Jan 04 '24 08:01 TuxVinyards

I am sure that we would all like to move on from this discussion, and probably none more so than me. However, I have just realised that a warning is missing.

We do need to let people know what has happened rather than leaving them all bewildered and starting to file issues.

The usual quickemu method is to echo something onto the screen:

Screenshot at 2024-01-06 11-07-05

Otherwise still +1 +1 :rocket:

TuxVinyards avatar Jan 06 '24 10:01 TuxVinyards

I have rebuilt and installed Qemu 8.2.0 with smartcard support, and still I get this error:

qemu-system-x86_64: -chardev spicevmc,id=ccid,name=smartcard: unsupported type name: smartcard
allowed spice char type names: vdagent, usbredir

LOG_8.2.0_2.txt

I attach the full build log.

DidierSpaier avatar Feb 05 '24 19:02 DidierSpaier

I applied the first patch, then typed:

quickget void current xfce-glibc
quickemu --vm void-current-xfce-glibc.conf

Now I get:

Quickemu 4.9.1 using /usr/bin/qemu-system-x86_64 v8.2.0
 - Host:     Slint 15.0 running Linux 6.6 (slint.example.slint)
 - CPU:       Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
 - CPU VM:   1 Socket(s), 2 Core(s), 2 Thread(s), 4G RAM
 - BOOT:     EFI (Linux), OVMF (/usr/share/qemu/edk2-x86_64-code.fd), SecureBoot (off).
 - Disk:     void-current-xfce-glibc/disk.qcow2 (16G)
             Just created, booting from void-current-xfce-glibc/void-live-x86_64-20230628-xfce.iso
 - Boot ISO: void-current-xfce-glibc/void-live-x86_64-20230628-xfce.iso
 - Display:  SDL, virtio-vga-gl, GL (on), VirGL (on)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-didier ~/didier
 - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "void-current-xfce-glibc/void-current-xfce-glibc-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:void-current-xfce-glibc/void-current-xfce-glibc-monitor.socket
 - Serial:   On host:  nc -U "void-current-xfce-glibc/void-current-xfce-glibc-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:void-current-xfce-glibc/void-current-xfce-glibc-serial.socket
qemu-system-x86_64: -device virtio-vga-gl,xres=1152,yres=648: 'virtio-vga-gl' is not a valid device model name
cat: void-current-xfce-glibc/void-current-xfce-glibc.pid: No such file or directory
 - Process:  Starting void-current-xfce-glibc.conf as void-current-xfce-glibc ()

DidierSpaier avatar Feb 05 '24 20:02 DidierSpaier

Closed via #986

flexiondotorg avatar Apr 11 '24 21:04 flexiondotorg