RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1918312 - virtiofs.exe logging doesn't work when started as a Windows service
Summary: virtiofs.exe logging doesn't work when started as a Windows service
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virtio-win
Version: 9.0
Hardware: x86_64
OS: Windows
high
medium
Target Milestone: rc
: 9.0
Assignee: Yvugenfi@redhat.com
QA Contact: xiagao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-20 12:28 UTC by menli@redhat.com
Modified: 2022-06-20 07:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-20 07:42:34 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virtiofs service (51.30 KB, image/png)
2021-01-20 12:34 UTC, menli@redhat.com
no flags Details

Description menli@redhat.com 2021-01-20 12:28:10 UTC
Description of problem:
virtiofs.exe logging doesn't work when started as a Windows service
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/528

Version-Release number of selected component (if applicable):
qemu-kvm-5.2.0-3.module+el8.4.0+9499+42e58f08.x86_64
kernel-4.18.0-272.el8.x86_64
seabios-1.14.0-1.module+el8.4.0+8855+a9e237a9.x86_64
virtio-win-1.9.15-0.el8.iso

How reproducible:
100%

Steps to Reproduce:
1. start virtiofsd daemon on host
#/usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu2 -o source=/home/virtiofs_test3 -o cache=none -d
2. boot a guest with virtiofs device.
-object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \
-numa node,memdev=mem \
-chardev socket,id=char0,path=/tmp/vhostqemu \
-device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \
3. install winfsp tool
4. install virtiofs driver via virtio-win-guest-tools.exe.
5. config Virtio-FS Service to add log with command:
   sc config "Virtio-FS Service" binpath=""%ProgramFiles%\Virtio-Win\VioFS\virtiofs.exe" -d -1 -D C:\my-viofs.log"
5. start Virtio-FS Service
   on starting the service, the file C:\my-viofs.log is not created.
6.stop the service and copy the Path to executable from the services Properties and run it manually in an Administrator Command Prompt


Actual results:
after step5, C:\my-viofs.log is not created.
after step6, C:\my-viofs.log is successfully created

Expected results:
C:\my-viofs.log should created successfully both step5 and step6

Comment 1 menli@redhat.com 2021-01-20 12:34:18 UTC
Created attachment 1749059 [details]
virtiofs service

Comment 2 Viktor Prutyanov 2021-12-16 22:32:25 UTC
Now VirtIO-FS service can get parameters from registry if there are no command-line arguments.
Values DebugFlags (REG_DWORD), DebugLogFile (REG_SZ), MountPoint (REG_SZ) are parsed from HKLM\Software\VirtIO-FS key.

So, service entry should be specified as usual:
sc create VirtioFsSvc binpath="%ProgramFiles%\Virtio-Win\VioFS\virtiofs.exe" start=auto DisplayName="Virtio FS Service"

If needed debug log parameters should be passed through registry (e.g. analogue of "virtiofs.exe -d -1 -D C:\my-viofs.log"):
reg add HKLM\Software\VirtIO-FS /v DebugFlags /d 0xFFFFFFFF /t REG_DWORD
reg add HKLM\Software\VirtIO-FS /v DebugLogFile /d C:\my-viofs.log /t REG_SZ

Debug log is being written to C:\my-viofs.log file.

Comment 3 Yvugenfi@redhat.com 2022-01-17 12:40:04 UTC
Upstream PR: https://github.com/virtio-win/kvm-guest-drivers-windows/pull/690

Comment 5 xiagao 2022-02-17 04:04:35 UTC
Still can't create logging file with virtio-win-prewhql-0.1-216, so assign back.

C:\> sc create VirtioFsSvc binpath="(your binary location)\virtiofs.exe -d -1 -D c:\viofs.log" start=auto 
depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio FS Service"

c:\> sc start VirtioFsSv

pkg:
qemu-kvm-6.2.0-7.el9.x86_64
kernel-5.14.0-56.el9.x86_64
RHEL-9.0.0-20220210.0

Comment 6 Yvugenfi@redhat.com 2022-02-17 15:34:20 UTC
(In reply to xiagao from comment #5)
> Still can't create logging file with virtio-win-prewhql-0.1-216, so assign
> back.
> 
> C:\> sc create VirtioFsSvc binpath="(your binary location)\virtiofs.exe -d
> -1 -D c:\viofs.log" start=auto 
> depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio FS Service"
> 
> c:\> sc start VirtioFsSv
> 
> pkg:
> qemu-kvm-6.2.0-7.el9.x86_64
> kernel-5.14.0-56.el9.x86_64
> RHEL-9.0.0-20220210.0

Please read comment #2. The behaviour changed, the service should get logging parameters through registry.

Comment 7 xiagao 2022-02-21 02:58:00 UTC
Test version: virtio-win-prewhql-0.1-216.

After start virtiofs service, add parameters from registry, and restart vm at the end, then virtiofs logging is enabled.

reg add HKLM\Software\VirtIO-FS /v DebugFlags /d 0xFFFFFFFF /t REG_DWORD
reg add HKLM\Software\VirtIO-FS /v DebugLogFile /d C:\my-viofs.log /t REG_SZ

So verify this bz.


Note You need to log in before you can comment on or make changes to this bug.