[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.3] hvmloader/smbios: Correctly count the number of tables written



commit 7ccd12c64bf54baa6d9379b561dc02d0ea15f83a
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Sep 9 11:47:44 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 9 11:47:44 2013 +0200

    hvmloader/smbios: Correctly count the number of tables written
    
    Fixes regression indirectly introduced by c/s 4d23036e709627
    
    That changeset added some smbios tables which were option based on the
    toolstack providing appropriate xenstore keys.  The do_struct() macro would
    unconditionally increment nr_structs, even if a table was not actually
    written.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master commit: 4aa19549e17650b9bfe2b31d7f52a95696d388f0
    master date: 2013-08-30 10:40:29 +0200
---
 tools/firmware/hvmloader/smbios.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/smbios.c 
b/tools/firmware/hvmloader/smbios.c
index 3d5dc51..9f292cc 100644
--- a/tools/firmware/hvmloader/smbios.c
+++ b/tools/firmware/hvmloader/smbios.c
@@ -192,7 +192,8 @@ write_smbios_tables(void *ep, void *start,
 
 #define do_struct(fn) do {                      \
     q = (fn);                                   \
-    (*nr_structs)++;                            \
+    if ( q != p )                               \
+        (*nr_structs)++;                        \
     if ( (q - p) > *max_struct_size )           \
         *max_struct_size = q - p;               \
     p = q;                                      \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.