]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
* src/xen_internal.c: Fix detection of host PAE capabilities,
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 23 Mar 2007 09:18:24 +0000 (09:18 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 23 Mar 2007 09:18:24 +0000 (09:18 +0000)
  nul-terminate the token in the output XML and a couple of
  cleanups for determining structure sizes.

ChangeLog
src/xen_internal.c

index 7f7c3c015c1bfaa1c9f147ea5a9b4cf3fc1c4fc9..86f204ec26431f919eddf8b0f91b9e64a89b0e2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 66066de6e2c90bf3aa7c17d487d90faa1a14bf11..5c4a0e7fb43dbf583960081868d2a06df7f9631f 100644 (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;