Permalink
Browse files

merged 'node' from 'main-dev' - everything compiles

  • Loading branch information...
Dmitrii Zagorodnov dmitrii@eucalyptus.com
Dmitrii Zagorodnov dmitrii@eucalyptus.com committed Apr 28, 2011
1 parent 67a390b commit 3375b8028133a95b5d02a6b75386cc28aa8ee242
Showing with 771 additions and 389 deletions.
  1. +1 −1 configure.ac
  2. +21 −11 node/Makefile
  3. +14 −5 node/NCclient.c
  4. +1 −0 node/client-marshal.h
  5. +64 −169 node/handlers.c
  6. +2 −2 node/handlers.h
  7. +216 −174 node/handlers_default.c
  8. +16 −14 node/handlers_kvm.c
  9. +8 −8 node/handlers_xen.c
  10. +0 −2 node/server-marshal.h
  11. +7 −2 node/test_nc.c
  12. +348 −0 node/xml.c
  13. +72 −0 node/xml.h
  14. +1 −1 storage/Makefile
View
@@ -49,7 +49,7 @@ LIBS="`getconf LFS64_LIBS` $LIBS"
CFLAGS="`getconf LFS64_CFLAGS`"
# compile options
-CFLAGS="${CFLAGS} -Wall -Wno-unused-variable -fPIC -DHAVE_CONFIG_H"
+CFLAGS="${CFLAGS} -Wall -Wno-unused-variable -fPIC -DHAVE_CONFIG_H -std=gnu99"
INCLUDES="${INCLUDES} -I. -I.. -Igenerated -I${TOP}/storage -I${TOP}/node -I${TOP}/util -I${TOP}/net"
# Arguments checking
View
@@ -12,8 +12,9 @@ SERVICE_SO=libEucalyptusNC.so
SERVICE_NAME=EucalyptusNC
CLIENT=NCclient
#WSDL2C=$(AXIS2C_HOME)/bin/tools/wsdl2c/WSDL2C.sh
-NC_LIBS = $(LIBS) $(LDFLAGS) -lvirt -lcurl -lssl -lcrypto -lrampart
-NC_HANDLERS=handlers_xen.o handlers_kvm.o handlers_default.o
+NC_LIBS = $(LIBS) $(LDFLAGS) -lvirt -lcurl -lssl -lcrypto -lrampart `xslt-config --libs`
+NC_HANDLERS=handlers_xen.o handlers_kvm.o handlers_default.o xml.o
+STORAGE_OBJS=../storage/backing.o ../storage/diskutil.o ../storage/blobstore.o ../storage/walrus.o
all: server client clientlib test_nc test
@@ -35,10 +36,19 @@ generated/stubs: $(NCWSDL)
@echo Stubs generated.
.c.o:
- $(CC) -c $(CFLAGS) $(INCLUDES) $<
+ $(CC) -c $(CFLAGS) `xslt-config --cflags` $(INCLUDES) $<
server: $(SERVICE_SO)
+../storage/backing.o: ../storage/backing.c ../util/misc.o ../util/data.o
+ make -C ../storage
+
+../storage/diskutil.o: ../storage/diskutil.c ../util/misc.o ../util/data.o
+ make -C ../storage
+
+../storage/blobstore.o: ../storage/blobstore.c ../util/misc.o ../util/data.o
+ make -C ../storage
+
../storage/storage.o: ../storage/storage.c ../util/misc.o ../util/data.o
make -C ../storage
@@ -63,24 +73,24 @@ server: $(SERVICE_SO)
../util/windows-bundle.o: ../util/windows-bundle.c ../util/windows-bundle.h
make -C ../util
-$(SERVICE_SO): generated/stubs ../storage/storage.o ../storage/http.o ../storage/walrus.o ../net/vnetwork.o ../util/misc.o ../util/data.o ../util/windows-bundle.o server-marshal.o handlers.o $(NC_HANDLERS) ../util/eucalyptus.h ../util/euca_auth.o
- $(CC) -o $(SERVICE_SO) -shared $(NC_LIBS) generated/adb_*.o generated/axis2*_skel_*.o server-marshal.o handlers.o $(NC_HANDLERS) ../storage/walrus.o ../storage/storage.o ../storage/http.o ../storage/storage-windows.o ../net/*.o ../util/*.o
+$(SERVICE_SO): generated/stubs $(STORAGE_OBJS) ../net/vnetwork.o ../util/misc.o ../util/data.o server-marshal.o handlers.o $(NC_HANDLERS) $(AXIS2C_HOME)/lib/libaxutil.so ../util/eucalyptus.h ../util/euca_auth.o ../storage/http.o ../util/windows-bundle.o
+ $(CC) -o $(SERVICE_SO) -shared $(NC_LIBS) generated/adb_*.o generated/axis2*_skel_*.o server-marshal.o handlers.o $(NC_HANDLERS) $(STORAGE_OBJS) ../net/*.o ../util/*.o ../storage/http.o ../storage/storage-windows.o
clientlib: generated/stubs ../util/data.o client-marshal-adb.o
client: $(CLIENT) $(CLIENT)_local
-$(CLIENT): generated/stubs ../util/misc.o ../util/data.o client-marshal-adb.o client-marshal-local.o $(CLIENT).c
- $(CC) -o $(CLIENT) $(CFLAGS) $(INCLUDES) $(NC_LIBS) generated/adb_*.o generated/axis2_stub_*.o client-marshal-adb.o ../util/*.o ../storage/storage.o ../storage/http.o ../storage/storage-windows.o ../storage/walrus.o ../net/*.o $(CLIENT).c
+$(CLIENT): generated/stubs $(STORAGE_OBJS) ../util/misc.o ../util/data.o client-marshal-adb.o client-marshal-local.o $(AXIS2C_HOME)/lib/libaxutil.so $(CLIENT).c
+ $(CC) -o $(CLIENT) $(CFLAGS) $(INCLUDES) $(NC_LIBS) generated/adb_*.o generated/axis2_stub_*.o client-marshal-adb.o ../util/*.o $(STORAGE_OJBS) ../net/*.o $(CLIENT).c ../storage/http.o ../storage/storage-windows.o
-$(CLIENT)_local: generated/stubs ../util/misc.o ../util/data.o client-marshal-adb.o client-marshal-local.o handlers.o $(NC_HANDLERS) $(CLIENT).c ../util/euca_auth.o
- $(CC) -o $(CLIENT)_local $(INCLUDES) $(CFLAGS) client-marshal-local.o ../util/*.o ../storage/storage.o ../storage/http.o ../storage/storage-windows.o ../storage/walrus.o ../net/*.o handlers.o $(NC_HANDLERS) $(CLIENT).c $(NC_LIBS)
+$(CLIENT)_local: generated/stubs $(STORAGE_OBJS) ../util/misc.o ../util/data.o client-marshal-adb.o client-marshal-local.o handlers.o $(NC_HANDLERS) $(CLIENT).c ../util/euca_auth.o
+ $(CC) -o $(CLIENT)_local $(INCLUDES) $(CFLAGS) client-marshal-local.o ../util/*.o $(STORAGE_OBJS) ../net/*.o handlers.o $(NC_HANDLERS) $(CLIENT).c $(NC_LIBS) ../storage/http.o ../storage/storage-windows.o
test: test.c ../util/misc.o ../util/data.o
$(CC) $(CFLAGS) $(INCLUDES) $(NC_LIBS) -o test test.c ../util/misc.o ../util/data.o ../util/euca_auth.o
-test_nc: test_nc.c ../util/misc.o
- $(CC) $(CFLAGS) $(INCLUDES) $(NC_LIBS) -o test_nc test_nc.c ../util/misc.o ../util/euca_auth.o
+test_nc: test_nc.c ../util/misc.o ../storage/diskutil.o
+ $(CC) $(CFLAGS) $(INCLUDES) $(NC_LIBS) -o test_nc test_nc.c ../util/misc.o ../storage/diskutil.o ../util/euca_auth.o
deploy:
$(INSTALL) -d $(DESTDIR)$(AXIS2C_SERVICES)/$(SERVICE_NAME)/
View
@@ -86,6 +86,7 @@ void usage (void)
"\t\bundleInstance\t\t[-i]\n"
"\toptions:\n"
"\t\t-d \t\t- print debug output\n"
+ "\t\t-l \t\t- local invocation => do not use WSSEC\n"
"\t\t-h \t\t- this help information\n"
"\t\t-w [host:port] \t- Walrus endpoint\n"
"\t\t-n [host:port] \t- NC endpoint\n"
@@ -183,17 +184,21 @@ int main (int argc, char **argv)
char ** group_names = NULL;
int group_names_size = 0;
char * command = NULL;
+ int local = 0;
int count = 1;
int ch;
- while ((ch = getopt(argc, argv, "hdn:w:i:m:k:r:e:a:c:h:u:p:V:R:L:FU:I:G:v:")) != -1) {
+ while ((ch = getopt(argc, argv, "lhdn:w:i:m:k:r:e:a:c:h:u:p:V:R:L:FU:I:G:v:")) != -1) {
switch (ch) {
case 'c':
count = atoi (optarg);
break;
case 'd':
debug = 1;
break;
+ case 'l':
+ local = 1;
+ break;
case 'n':
nc_hostport = optarg;
break;
@@ -344,7 +349,7 @@ int main (int argc, char **argv)
strncpy (si->uris[0], walrus_url, sizeof (si->uris[0]));
si->urisLen = 1;
- if (use_wssec) {
+ if (use_wssec && !local) {
if (debug) printf ("using policy file %s\n", policyFile);
rc = InitWSSEC(stub->env, stub->stub, policyFile);
if (rc) {
@@ -388,6 +393,7 @@ int main (int argc, char **argv)
mac_addr [0] = 'b';
mac_addr [1] = 'b';
privIp = strdup("10.0.0.202");
+ srand (time (NULL));
/* generate random IDs if they weren't specified*/
#define C rand()%26 + 97
@@ -446,8 +452,7 @@ int main (int argc, char **argv)
for (i=0; i<EUCA_MAX_VBRS; i++) {
if (strlen(outInst->params.virtualBootRecord[i].typeName)>0) count++;
}
- printf("instanceId=%s stateCode=%d stateName=%s deviceMappings=%d\n", outInst->instanceId, outInst->stateCode, outInst->stateName, count);
- free_instance(&outInst);
+ printf("instanceId=%s stateCode=%d stateName=%s deviceMappings=%d/%d\n", outInst->instanceId, outInst->stateCode, outInst->stateName, count, outInst->params.virtualBootRecordLen);
}
/***********************************************************/
@@ -583,5 +588,9 @@ int main (int argc, char **argv)
exit (1);
}
- exit(0);
+ if (local) {
+ pthread_exit(NULL);
+ } else {
+ _exit(0);
+ }
}
View
@@ -87,6 +87,7 @@ int ncAssignAddressStub (ncStub *st, ncMetadata *meta, char *instanceId, char *
int ncPowerDownStub (ncStub *st, ncMetadata *meta);
int ncAttachVolumeStub (ncStub *stub, ncMetadata *meta, char *instanceId, char *volumeId, char *remoteDev, char *localDev);
int ncDetachVolumeStub (ncStub *stub, ncMetadata *meta, char *instanceId, char *volumeId, char *remoteDev, char *localDev, int force);
+int ncCreateImageStub (ncStub *stub, ncMetadata *meta, char *instanceId, char *volumeId, char *remoteDev);
int ncBundleInstanceStub (ncStub *stub, ncMetadata *meta, char *instanceId, char *bucketName, char *filePrefix, char *walrusURL, char *userPublicKey, char *S3Policy, char *S3PolicySig);
int ncCancelBundleTaskStub (ncStub *stub, ncMetadata *meta, char *instanceId);
Oops, something went wrong.

0 comments on commit 3375b80

Please sign in to comment.