| | 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++) { | | | 900 | | hp = hd_new(0); | | | 901 | | wxp->w_hosts[i] = hp; |
| | 274 | | | | upkstralloc(mp, ss) | | | 275 | | | | struct pmsg *mp; | | | 276 | | | | char **ss; | | | 277 | | | | { | | | 278 | | | | int cc; | | | 279 | | | | int l; | | | 280 | | | | | | | 281 | | | | if (!(cc = (mp->m_codef->dec_int) (mp, (void*)&l, 1, 1, sizeof(int)))) { | | | 282 | | | | if (l <= 0) | | | 283 | | | | cc = PvmNoData;
| | | 284 | | | | else { | | | 285 | | | | *ss = TALLOC(l, char, "ustr");
| | | 286 | | | | if ((cc = (mp->m_codef->dec_byte) (mp, (void*)*ss, l, 1, 1)) < 0) { | | | 287 | | | | PVM_FREE(*ss);
| | | 288 | | | | *ss = 0; | | | 289 | | | | } | | | 290 | | | | } | | | 291 | | | | } | | | 292 | | | | return cc; | | buf <= 4095 | 293 | | | | } |
|