~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to clc/modules/storage-controller/native/com_eucalyptus_storage_AOEManager.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Author: Sunil Soman sunils@cs.ucsb.edu
 
3
 */
 
4
 
 
5
#include <com_eucalyptus_storage_AOEManager.h>
 
6
#include <unistd.h>
 
7
#include <string.h>
 
8
#include <stdlib.h>
 
9
 
 
10
#define EUCALYPTUS_ENV_VAR_NAME  "EUCALYPTUS"
 
11
 
 
12
extern int run_command_and_get_pid(char *cmd, char **args); 
 
13
 
 
14
JNIEXPORT jint JNICALL Java_com_eucalyptus_storage_AOEManager_exportVolume
 
15
(JNIEnv *env, jobject obj, jstring iface, jstring lvName, jint major, jint minor) {
 
16
    const jbyte* lv_name = (*env)->GetStringUTFChars(env, lvName, NULL);
 
17
    const jbyte* if_name = (*env)->GetStringUTFChars(env, iface, NULL);
 
18
    char major_str[4];
 
19
    char minor_str[4];
 
20
    char *args[7];
 
21
    
 
22
    char rootwrap[256];
 
23
    char* home = getenv (EUCALYPTUS_ENV_VAR_NAME);
 
24
    if (!home) {
 
25
        home = strdup (""); /* root by default */
 
26
    } else {
 
27
        home = strdup (home);
 
28
    }
 
29
 
 
30
    snprintf(rootwrap, 256, "%s/usr/lib/eucalyptus/euca_rootwrap", home);
 
31
 
 
32
    snprintf(major_str, 4, "%d", major);
 
33
    snprintf(minor_str, 4, "%d", minor);
 
34
 
 
35
    args[0] = rootwrap;
 
36
    args[1] = "vblade";
 
37
    args[2] = major_str;
 
38
    args[3] = minor_str;
 
39
    args[4] = (char *) if_name;
 
40
    args[5] = (char *) lv_name;
 
41
    args[6] = (char *) NULL;
 
42
 
 
43
    int pid = run_command_and_get_pid(rootwrap, args);
 
44
    (*env)->ReleaseStringUTFChars(env, lvName, lv_name);
 
45
    (*env)->ReleaseStringUTFChars(env, iface, if_name);
 
46
    if (home) free(home);
 
47
    return pid;
 
48
}
 
49