Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 580182 Details for
Bug 671510
virt-what fails to detect Citrix (upstream) Xen HVM with Viridian extensions
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Modified code to differentiate between XenServer and Hyper-V
xenvmm.patch (text/plain), 1.50 KB, created by
Valentine Sinitsyn
on 2012-04-25 15:02:56 UTC
(
hide
)
Description:
Modified code to differentiate between XenServer and Hyper-V
Filename:
MIME Type:
Creator:
Valentine Sinitsyn
Created:
2012-04-25 15:02:56 UTC
Size:
1.50 KB
patch
obsolete
>--- a/virt-what-cpuid-helper.c >+++ b/virt-what-cpuid-helper.c >@@ -39,29 +39,40 @@ cpuid (unsigned int eax, char *sig) > return eax; > } > >+#define MIN(x,y) ((x) <= (y) ? (x) : (y)) > static void > cpu_sig (void) > { > char sig[13]; > unsigned int base = 0x40000000, leaf = base; > unsigned int max_entries; >+ unsigned int xen = 0; > > memset (sig, 0, sizeof sig); > max_entries = cpuid (leaf, sig); >- puts (sig); > > /* Most hypervisors only have information in leaf 0x40000000, but > * upstream Xen contains further leaf entries (in particular when > * used with Viridian [HyperV] extensions). CPUID is supposed to > * return the maximum leaf offset in %eax, so that's what we use, > * but only if it looks sensible. >+ * >+ * The problem is that (at leat) for some Xen releases, this number >+ * doesn't look sensible. So we need to implement more sopisticated >+ * logic in order to diffirentiate between Xen and Hyper-V. > */ >- if (max_entries > 3 && max_entries < 0x10000) { >- for (leaf = base + 0x100; leaf <= base + max_entries; leaf += 0x100) { >+ if (!strcmp("Microsoft Hv", sig) && max_entries != 0) { >+ for (leaf = base + 0x100; leaf < base + MIN(max_entries, 0x10000); leaf += 0x100) { > memset (sig, 0, sizeof sig); > cpuid (leaf, sig); >- puts (sig); >+ if (!strcmp("XenVMMXenVMM", sig)) { >+ xen = 1; >+ break; >+ } > } >+ puts(xen ? "XenVMMXenVMM" : "Microsoft Hv"); >+ } else { >+ puts(sig); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 671510
: 580182