mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Fix xen capabilities data creation
This commit is contained in:
parent
e88295804a
commit
f193e19536
@ -1,3 +1,9 @@
|
||||
Thu Sep 5 12:33:26 BST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/xen_unified.c, src/xen_internal.c, src/xen_internal.h,
|
||||
tests/xencapstest.c: Pass connection object into capabilities
|
||||
constructor since it needs to talk to XenD
|
||||
|
||||
Thu Sep 4 15:33:26 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/storage_backend_fs.c: fix a signed/unsigned issue breaking
|
||||
|
@ -2159,7 +2159,8 @@ struct guest_arch {
|
||||
|
||||
|
||||
static virCapsPtr
|
||||
xenHypervisorBuildCapabilities(const char *hostmachine,
|
||||
xenHypervisorBuildCapabilities(virConnectPtr conn,
|
||||
const char *hostmachine,
|
||||
int host_pae,
|
||||
char *hvm_type,
|
||||
struct guest_arch *guest_archs,
|
||||
@ -2185,7 +2186,7 @@ xenHypervisorBuildCapabilities(const char *hostmachine,
|
||||
|
||||
|
||||
if (sys_interface_version >= 4) {
|
||||
if (xenDaemonNodeGetTopology(NULL, caps) != 0) {
|
||||
if (xenDaemonNodeGetTopology(conn, caps) != 0) {
|
||||
virCapabilitiesFree(caps);
|
||||
return NULL;
|
||||
}
|
||||
@ -2271,7 +2272,8 @@ xenHypervisorBuildCapabilities(const char *hostmachine,
|
||||
* Return the capabilities of this hypervisor.
|
||||
*/
|
||||
virCapsPtr
|
||||
xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
|
||||
xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
|
||||
const char *hostmachine,
|
||||
FILE *cpuinfo, FILE *capabilities)
|
||||
{
|
||||
char line[1024], *str, *token;
|
||||
@ -2404,7 +2406,8 @@ xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
|
||||
}
|
||||
}
|
||||
|
||||
if ((caps = xenHypervisorBuildCapabilities(hostmachine,
|
||||
if ((caps = xenHypervisorBuildCapabilities(conn,
|
||||
hostmachine,
|
||||
host_pae,
|
||||
hvm_type,
|
||||
guest_archs,
|
||||
@ -2425,7 +2428,7 @@ xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
|
||||
* Return the capabilities of this hypervisor.
|
||||
*/
|
||||
virCapsPtr
|
||||
xenHypervisorMakeCapabilities(void)
|
||||
xenHypervisorMakeCapabilities(virConnectPtr conn)
|
||||
{
|
||||
virCapsPtr caps;
|
||||
FILE *cpuinfo, *capabilities;
|
||||
@ -2451,7 +2454,10 @@ xenHypervisorMakeCapabilities(void)
|
||||
}
|
||||
}
|
||||
|
||||
caps = xenHypervisorMakeCapabilitiesInternal(utsname.machine, cpuinfo, capabilities);
|
||||
caps = xenHypervisorMakeCapabilitiesInternal(conn,
|
||||
utsname.machine,
|
||||
cpuinfo,
|
||||
capabilities);
|
||||
|
||||
if (cpuinfo)
|
||||
fclose(cpuinfo);
|
||||
|
@ -17,7 +17,7 @@
|
||||
extern struct xenUnifiedDriver xenHypervisorDriver;
|
||||
int xenHypervisorInit (void);
|
||||
|
||||
virCapsPtr xenHypervisorMakeCapabilities (void);
|
||||
virCapsPtr xenHypervisorMakeCapabilities (virConnectPtr conn);
|
||||
|
||||
/* The following calls are made directly by the Xen proxy: */
|
||||
|
||||
@ -38,7 +38,8 @@ int xenHypervisorClose (virConnectPtr conn);
|
||||
int xenHypervisorGetVersion (virConnectPtr conn,
|
||||
unsigned long *hvVer);
|
||||
virCapsPtr
|
||||
xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
|
||||
xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
|
||||
const char *hostmachine,
|
||||
FILE *cpuinfo,
|
||||
FILE *capabilities);
|
||||
char *
|
||||
|
@ -333,7 +333,7 @@ xenUnifiedOpen (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int f
|
||||
}
|
||||
}
|
||||
|
||||
if (!(priv->caps = xenHypervisorMakeCapabilities())) {
|
||||
if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
|
||||
DEBUG0("Failed to make capabilities");
|
||||
goto fail;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ static int testCompareFiles(const char *hostmachine,
|
||||
if (!(fp2 = fopen(capabilities, "r")))
|
||||
goto fail;
|
||||
|
||||
if (!(caps = xenHypervisorMakeCapabilitiesInternal(hostmachine, fp1, fp2)))
|
||||
if (!(caps = xenHypervisorMakeCapabilitiesInternal(NULL, hostmachine, fp1, fp2)))
|
||||
goto fail;
|
||||
|
||||
if (!(actualxml = virCapabilitiesFormatXML(caps)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user