| | 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++) { |
| $param_2 <= 4095 | 726 | | | | parsehost(buf, hp) | | | 727 | | | | char *buf; | | | 728 | | | | struct hostd *hp; | | | 729 | | | | { | | | 730 | | | | char *av[10]; | | | 731 | | | | int ac; | | | 732 | | | | int err = 0; | | | 733 | | | | | | | 734 | | | | ac = sizeof(av)/sizeof(av[0]); | | | 735 | | | | if (acav(buf, &ac, av)) { | | | 736 | | | | pvmlogprintf("parsehost(): line too long\n"); | | | 737 | | | | goto bad; | | | 738 | | | | } | | | 739 | | | | if (!ac) | | | 740 | | | | goto bad; | | | 741 | | | | | | | 742 | | | | | | | 743 | | | | | | | 744 | | | | while (--ac > 0) { | | | 745 | | | | if (!strncmp(av[ac], "lo=", 3)) { | | | 746 | | | | if (hp->hd_login) | | | 747 | | | | PVM_FREE(hp->hd_login);
| | | 748 | | | | hp->hd_login = STRALLOC(av[ac] + 3);
| | | 749 | | | | continue; | | | 750 | | | | } | | | 751 | | | | if (!strncmp(av[ac], "dx=", 3)) { | | | 752 | | | | if (hp->hd_dpath) | | | 753 | | | | PVM_FREE(hp->hd_dpath);
| | | 754 | | | | hp->hd_dpath = STRALLOC(av[ac] + 3);
| | | | | | | ... | | | 791 | | | | } | | | 792 | | | | if (!strncmp(av[ac], "id=", 3)) { | | | 793 | | | | if (hp->hd_vmid) | | | 794 | | | | PVM_FREE(hp->hd_vmid);
| | | 795 | | | | hp->hd_vmid = STRALLOC(av[ac] + 3);
| | | 796 | | | | continue; | | | 797 | | | | } | | | 798 | | | | pvmlogprintf("parsehost(): unknown option \"%s\"\n", av[ac]); | | | 799 | | | | err++; | | | 800 | | | | } | | | 801 | | | | if (err) | | | 802 | | | | goto bad; | | | 803 | | | | | | hp <= 4095 | 804 | | | | if (hp->hd_name) |
|