* src/xen_internal.c: Fix detection of host PAE capabilities,

nul-terminate the token in the output XML and a couple of
  cleanups for determining structure sizes.
This commit is contained in:
Richard W.M. Jones 2007-03-23 09:18:24 +00:00
parent fb624fbecf
commit ba83eae40f
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,9 @@
Fri Mar 23 09:12:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/xen_internal.c: Fix detection of host PAE capabilities,
nul-terminate the token in the output XML and a couple of
cleanups for determining structure sizes.
Thu Mar 22 19:38:38 CET 2007 Daniel Veillard <veillard@redhat.com>
* qemud/iptables.c qemud/qemud.c src/conf.c src/hash.c src/libvirt.c

View File

@ -1523,7 +1523,7 @@ xenHypervisorGetCapabilities (virConnectPtr conn)
strncpy (hvm_type,
&line[subs[1].rm_so], subs[1].rm_eo-subs[1].rm_so+1);
hvm_type[subs[1].rm_eo-subs[1].rm_so] = '\0';
} else if (regexec (&flags_hvm_rec, line, 0, NULL, 0) == 0)
} else if (regexec (&flags_pae_rec, line, 0, NULL, 0) == 0)
host_pae = 1;
}
@ -1573,10 +1573,12 @@ xenHypervisorGetCapabilities (virConnectPtr conn)
* this buffer. Parse out the features from each token.
*/
for (str = line, nr_guest_archs = 0;
nr_guest_archs < (sizeof(guest_archs)/sizeof(struct guest_arch))
nr_guest_archs < sizeof guest_archs / sizeof guest_archs[0]
&& (token = strtok_r (str, " ", &saveptr)) != NULL;
str = NULL) {
if (regexec (&xen_cap_rec, token, (sizeof(subs)/sizeof(regmatch_t)), subs, 0) == 0) {
if (regexec (&xen_cap_rec, token, sizeof subs / sizeof subs[0],
subs, 0) == 0) {
token[subs[0].rm_eo] = '\0';
guest_archs[nr_guest_archs].token = token;
guest_archs[nr_guest_archs].hvm =
strncmp (&token[subs[1].rm_so], "hvm", 3) == 0;