diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-22 03:03:27 +0200 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-23 07:49:51 +0200 |
commit | 48245cc0708d49d1d0566b9fa617ad6c5f4c6934 (patch) | |
tree | b396fd2d1ab185aab20894570e7e84bd4f656355 /drivers/lguest/io.c | |
parent | Introduce guest mem offset, static link example launcher (diff) | |
download | linux-48245cc0708d49d1d0566b9fa617ad6c5f4c6934.tar.xz linux-48245cc0708d49d1d0566b9fa617ad6c5f4c6934.zip |
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.c | 10 |
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, lg->dma[i].num_dmas = numdmas; lg->dma[i].next_dma = 0; lg->dma[i].key = key; - lg->dma[i].guestid = lg->guestid; + lg->dma[i].owner = lg; lg->dma[i].interrupt = interrupt; /* Now we add it to the hash table: the position @@ -412,7 +412,7 @@ static int dma_transfer(struct lguest *srclg, /* From the "struct lguest_dma_info" we found in the hash, grab the * Guest. */ - dstlg = &lguests[dst->guestid]; + dstlg = dst->owner; /* Read in the source "struct lguest_dma" handed to SEND_DMA. */ lgread(srclg, &src_dma, udma, sizeof(src_dma)); @@ -506,8 +506,8 @@ again: struct lguest_dma_info *i; /* Look through the hash for other Guests. */ list_for_each_entry(i, &dma_hash[hash(&key)], list) { - /* Don't send to ourselves. */ - if (i->guestid == lg->guestid) + /* Don't send to ourselves (would deadlock). */ + if (i->owner->mm == lg->mm) continue; if (!key_eq(&key, &i->key)) continue; @@ -594,7 +594,7 @@ unsigned long get_dma_buffer(struct lguest *lg, * send to its own Guest for the moment, so the entry must be for this * Guest) */ list_for_each_entry(i, &dma_hash[hash(&key)], list) { - if (key_eq(&key, &i->key) && i->guestid == lg->guestid) { + if (key_eq(&key, &i->key) && i->owner == lg) { unsigned int j; /* Look through the registered DMA array for an * available buffer. */ |