aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/io.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-10-21 21:03:27 -0400
committerRusty Russell <rusty@rustcorp.com.au>2007-10-23 01:49:51 -0400
commit48245cc0708d49d1d0566b9fa617ad6c5f4c6934 (patch)
treeb396fd2d1ab185aab20894570e7e84bd4f656355 /drivers/lguest/io.c
parent3c6b5bfa3cf3b4057788e08482a468cc3bc00780 (diff)
Remove fixed limit on number of guests, and lguests array.
Back when we had all the Guest state in the switcher, we had a fixed array of them. This is no longer necessary. If we switch the network code to using random_ether_addr (46 bits is enough to avoid clashes), we can get rid of the concept of "guest id" altogether. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/io.c')
-rw-r--r--drivers/lguest/io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/lguest/io.c b/drivers/lguest/io.c
index 3a845335fee8..0e842e9caf68 100644
--- a/drivers/lguest/io.c
+++ b/drivers/lguest/io.c
@@ -212,7 +212,7 @@ int bind_dma(struct lguest *lg,
212 lg->dma[i].num_dmas = numdmas; 212 lg->dma[i].num_dmas = numdmas;
213 lg->dma[i].next_dma = 0; 213 lg->dma[i].next_dma = 0;
214 lg->dma[i].key = key; 214 lg->dma[i].key = key;
215 lg->dma[i].guestid = lg->guestid; 215 lg->dma[i].owner = lg;
216 lg->dma[i].interrupt = interrupt; 216 lg->dma[i].interrupt = interrupt;
217 217
218 /* Now we add it to the hash table: the position 218 /* Now we add it to the hash table: the position
@@ -412,7 +412,7 @@ static int dma_transfer(struct lguest *srclg,
412 412
413 /* From the "struct lguest_dma_info" we found in the hash, grab the 413 /* From the "struct lguest_dma_info" we found in the hash, grab the
414 * Guest. */ 414 * Guest. */
415 dstlg = &lguests[dst->guestid]; 415 dstlg = dst->owner;
416 /* Read in the source "struct lguest_dma" handed to SEND_DMA. */ 416 /* Read in the source "struct lguest_dma" handed to SEND_DMA. */
417 lgread(srclg, &src_dma, udma, sizeof(src_dma)); 417 lgread(srclg, &src_dma, udma, sizeof(src_dma));
418 418
@@ -506,8 +506,8 @@ again:
506 struct lguest_dma_info *i; 506 struct lguest_dma_info *i;
507 /* Look through the hash for other Guests. */ 507 /* Look through the hash for other Guests. */
508 list_for_each_entry(i, &dma_hash[hash(&key)], list) { 508 list_for_each_entry(i, &dma_hash[hash(&key)], list) {
509 /* Don't send to ourselves. */ 509 /* Don't send to ourselves (would deadlock). */
510 if (i->guestid == lg->guestid) 510 if (i->owner->mm == lg->mm)
511 continue; 511 continue;
512 if (!key_eq(&key, &i->key)) 512 if (!key_eq(&key, &i->key))
513 continue; 513 continue;
@@ -594,7 +594,7 @@ unsigned long get_dma_buffer(struct lguest *lg,
594 * send to its own Guest for the moment, so the entry must be for this 594 * send to its own Guest for the moment, so the entry must be for this
595 * Guest) */ 595 * Guest) */
596 list_for_each_entry(i, &dma_hash[hash(&key)], list) { 596 list_for_each_entry(i, &dma_hash[hash(&key)], list) {
597 if (key_eq(&key, &i->key) && i->guestid == lg->guestid) { 597 if (key_eq(&key, &i->key) && i->owner == lg) {
598 unsigned int j; 598 unsigned int j;
599 /* Look through the registered DMA array for an 599 /* Look through the registered DMA array for an
600 * available buffer. */ 600 * available buffer. */