LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2017, 08:42 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 342

Rep: Reputation: 54
How to add flags in libvirt?


Hello

I am following this guide to install Windows 7 guest OS with virtio drivers.

https://access.redhat.com/articles/2470791

Even though I installed Windows Guest Machine successfully, I don't know how to add flags as mentioned in this tutorial.

The tutorial says:

Quote:
The following flags should be set with libvirt to make sure the Windows guest virtual machine works efficiently:

hv_relaxed
hv_spinlocks=0x1fff
hv_vapic
hv_time
But how and where to add them? I really appreciate any help.

Thank you.
 
Old 11-16-2017, 03:28 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Try editing:
Code:
nova/virt/libvirt/config.py
 
Old 11-17-2017, 07:43 AM   #3
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by AwesomeMachine View Post
Try editing:
Code:
nova/virt/libvirt/config.py
Thanks, but I using KVM on CentOS 7.4 host. So I don't have nova/virt/libvirt/config.py file.

After some deep search, I came across this Redhat Bug Report page, and it turns out that the flags are set by default for Windows VM.

The recommended qemu configuration is:

Code:
 -cpu ...,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time

Which maps to the libvirt XML:

   <features>
     <hyperv>
       <relaxed state='on'/>
       <vapic state='on'/>
       <spinlocks state='on' retries='8191'/>
     </hyperv>
   <features/>

   <clock ...>
     <timer name='hypervclock' present='yes'/>
   </clock>
Proof: After running Windows Virtual Machine, I ran this command in CentOS host:
Code:
# ps -aux | grep qemu | grep -Eo 'hv_relaxed|hv_spinlocks=0x1fff|hv_vapic|hv_time'
hv_time
hv_relaxed
hv_vapic
hv_spinlocks=0x1fff

I also came across this good article on how to install Windows with Passthrough. So anybody interested can visit Running Windows 10 on Linux using KVM with VGA Passthrough

Thankyou.

Last edited by ddenial; 11-17-2017 at 07:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Scripting KVM with Python, Part 2: Add a GUI to manage KVM with libvirt and Python LXer Syndicated Linux News 0 01-17-2012 08:11 PM
[SOLVED] how to add some compiler flags in code blocks IDE for Mysql headers and APIs golden_boy615 Programming 3 07-16-2011 01:57 AM
[SOLVED] how to add some compiler flags in code blocks IDE for Mysql headers and APIs golden_boy615 Programming 2 07-14-2011 12:47 AM
How to add multiple flags in bash script manya Programming 10 10-08-2009 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration