diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-03-09 12:32:04 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-03-09 12:32:04 +0000 |
commit | 782d302291620bc15d5dd849d59a9351444bea46 (patch) | |
tree | 031bb502819987ac0c05beca61b61800706e5aa8 | |
parent | a148f0e67dee472f185cf66b11fbc6cdc90a1804 (diff) | |
download | xen-782d302291620bc15d5dd849d59a9351444bea46.tar.gz xen-782d302291620bc15d5dd849d59a9351444bea46.tar.bz2 xen-782d302291620bc15d5dd849d59a9351444bea46.zip |
Fix grant table debug key.
Must skip domains with gt_version==0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r-- | xen/common/grant_table.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index cba4f85d7e..98a79637d6 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -2551,13 +2551,17 @@ void gnttab_usage_print(struct domain *rd) { int first = 1; grant_ref_t ref; + struct grant_table *gt = rd->grant_table; printk(" -------- active -------- -------- shared --------\n"); printk("[ref] localdom mfn pin localdom gmfn flags\n"); - spin_lock(&rd->grant_table->lock); + spin_lock(>->lock); + + if ( gt->gt_version == 0 ) + goto out; - for ( ref = 0; ref != nr_grant_entries(rd->grant_table); ref++ ) + for ( ref = 0; ref != nr_grant_entries(gt); ref++ ) { struct active_grant_entry *act; struct grant_entry_header *sha; @@ -2566,31 +2570,31 @@ void gnttab_usage_print(struct domain *rd) uint16_t status; uint64_t frame; - act = &active_entry(rd->grant_table, ref); + act = &active_entry(gt, ref); if ( !act->pin ) continue; - sha = shared_entry_header(rd->grant_table, ref); + sha = shared_entry_header(gt, ref); - if ( rd->grant_table->gt_version == 1 ) + if ( gt->gt_version == 1 ) { - sha1 = &shared_entry_v1(rd->grant_table, ref); + sha1 = &shared_entry_v1(gt, ref); sha2 = NULL; status = sha->flags; frame = sha1->frame; } else { - sha2 = &shared_entry_v2(rd->grant_table, ref); + sha2 = &shared_entry_v2(gt, ref); sha1 = NULL; frame = sha2->full_page.frame; - status = status_entry(rd->grant_table, ref); + status = status_entry(gt, ref); } if ( first ) { printk("grant-table for remote domain:%5d (v%d)\n", - rd->domain_id, rd->grant_table->gt_version); + rd->domain_id, gt->gt_version); first = 0; } @@ -2600,7 +2604,8 @@ void gnttab_usage_print(struct domain *rd) sha->domid, frame, status); } - spin_unlock(&rd->grant_table->lock); + out: + spin_unlock(>->lock); if ( first ) printk("grant-table for remote domain:%5d ... " |