| | 840 | | addhosts(mp, rmp) | | | 841 | | struct pmsg *mp; | | | 842 | | struct pmsg *rmp; | | | 843 | | { | | | 844 | | struct hostd *hp, *hp2; | | | 845 | | struct pmsg *mp2; | | | 846 | | struct waitc *wp = 0; | | | 847 | | struct waitc_add *wxp = 0; | | | 848 | | int i, j; | | | 849 | | int count; | | | 850 | | int ngood; | | | 851 | | int ntid; | | | 852 | | struct hostent *he; | | | 853 | | int maxhostid = (tidhmask >> ffs(tidhmask) - 1); | | | 854 | | int hh; | | | 855 | | int pid; | | | 856 | | int *tids; | | | 857 | | char *winpvmdpath; | | | 858 | | char *pvmdpath; | | | 859 | | char *vmid; | | | 860 | | char *buf; | | | 861 | | int len; | | | 862 | | | | | 863 | | | | | 864 | | | | | 865 | | | | | 866 | | | | | 867 | | | | | 868 | | if (busyadding) { | | | 869 | | | | | 870 | | | | | 871 | | | | | 872 | | pkint(rmp, PvmAlready);
| | | 873 | | sendmessage(rmp); | | | 874 | | return 0; | | | 875 | | } | | | 876 | | | | | 877 | | busyadding = 1; | | | 878 | | | | | 879 | | | | | 880 | | | | | 881 | | if (upkint(mp, &count) || count < 1 || count > maxhostid) { | | | 882 | | pvmlogerror("addhosts() bad msg format\n"); | | | 883 | | goto bad; | | | 884 | | } | | | 885 | | | | | 886 | | | | | 887 | | | | | 888 | | | | | 889 | | | | | 890 | | wp = wait_new(WT_HOSTSTART);
| | | 891 | | wp->wa_tid = mp->m_src; | | | 892 | | wp->wa_dep = mp->m_wid; | | | 893 | | wxp = TALLOC(1, struct waitc_add, "waix");
| | | 894 | | wxp->w_num = count; | | | 895 | | wxp->w_hosts = TALLOC(count, struct hostd *, "waiv");
| | | 896 | | BZERO((char*)wxp->w_hosts, count * sizeof(struct hostd *));
| | | 897 | | wp->wa_spec = (void *)wxp; | | | 898 | | | | | 899 | | for (i = 0; i < count; i++) { |
|