Skip to content

Commit

Permalink
OS-858 add experimental support for VM.send, VM.receive, VM.install t…
Browse files Browse the repository at this point in the history
…o VM.js and vmadm

OS-952 started update of illumos-live toward JEG
STOR-33 added VM.send and VM.receive to serve as a start toward backup/restore
  • Loading branch information
joshwilsdon committed May 18, 2012
1 parent 2bbea55 commit 96cc0ed
Show file tree
Hide file tree
Showing 99 changed files with 3,119 additions and 13,041 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
/projects
/proto
/log
/src/*.o
/src/bootparams
/src/disk_size
/src/removable_disk
/src/disklist
/src/qemu-exec
/src/vmunbundle
/src/zfs_recv
/src/zfs_send
/src/zoneevent
/src/vm/tests.tar.gz
/src/node-kstat/.lock-wscript
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ MANIFEST=manifest.gen
OVERLAYS:=$(shell cat overlay/order)
JSSTYLE=$(ROOT)/tools/jsstyle/jsstyle
JSLINT=$(ROOT)/tools/javascriptlint/build/install/jsl
CSTYLE=$(ROOT)/tools/cstyle
ifeq ($(EXTRA_TARBALL),)
EXTRA_TARBALL:=$(shell ls `pwd`/illumos-extra*.tgz 2> /dev/null | tail -n1 && echo $?)
endif
Expand Down Expand Up @@ -100,14 +101,13 @@ endif
tools/cryptpass: tools/cryptpass.c
(cd ${ROOT}/tools && gcc -Wall -W -O2 -o cryptpass cryptpass.c)

jsl: $(JSLINT)

$(JSLINT):
@(cd $(ROOT)/tools/javascriptlint; make CC=gcc install)

check: $(JSLINT)
@$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf src/vm/sbin/*.js
@$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf src/vm/node_modules/{qmp,VM}.js
@$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 src/vm/sbin/*.js
@$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 src/vm/node_modules/{qmp,VM}.js
@(cd $(ROOT)/src && make check)

clean:
rm -f $(MANIFEST)
Expand All @@ -122,4 +122,4 @@ clean:
(cd $(ROOT) && mkdir -p $(PROTO))
rm -f 0-*-stamp

.PHONY: manifest check
.PHONY: manifest check jsl
38 changes: 33 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ TARGETS=bootparams diskinfo disklist removable_disk disk_size \
node-syslog/build/Release/syslog.node \
node-zsock/build/Release/zsock_bindings.node \
node-zutil/build/Release/zutil_bindings.node \
vmunbundle zfs_send zfs_recv
ROOT=$(PWD)/..
JSSTYLE=$(ROOT)/tools/jsstyle/jsstyle
JSLINT=$(ROOT)/tools/javascriptlint/build/install/jsl
CSTYLE=$(ROOT)/tools/cstyle

SMARTDC_TARGETS=qemu-exec
DESTDIR=../proto
Expand Down Expand Up @@ -40,6 +45,9 @@ install: $(TARGETS) sysinfo
sed -e "s|var expat.*;|var expat = require('expat_binding');|" > \
$(DESTDIR)/usr/vm/node_modules/node-expat.js
cp zoneevent $(DESTDIR)/usr/vm/sbin/zoneevent
cp zfs_send $(DESTDIR)/usr/vm/sbin/zfs_send
cp zfs_recv $(DESTDIR)/usr/vm/sbin/zfs_recv
cp vmunbundle $(DESTDIR)/usr/vm/sbin/vmunbundle
mkdir -p $(DESTDIR)/lib/svc/manifest/system
cp vm/smf/system-vmadmd.xml $(DESTDIR)/lib/svc/manifest/system/system-vmadmd.xml
cp vm/smf/system-metadata.xml $(DESTDIR)/lib/svc/manifest/system/system-metadata.xml
Expand All @@ -50,10 +58,6 @@ install: $(TARGETS) sysinfo
cp -PR ds $(DESTDIR)/usr/
mkdir -m 0755 -p $(DESTDIR)/var/db/dsadm

check:
@tools/node-lint/bin/node-lint *.js \
--config=tools/node-lint.json

bootparams: bootparams.c
$(CC) $(CFLAGS) -o $@ $^ -ldevinfo

Expand All @@ -69,6 +73,15 @@ disk_size: disk_size.c
qemu-exec: qemu-exec.c
$(CC) $(CFLAGS) -o $@ $^

zfs_recv: zfs_recv.c
$(CC) $(CFLAGS) -o $@ $^ -lsocket

zfs_send: zfs_send.c
$(CC) $(CFLAGS) -o $@ $^ -lsocket

vmunbundle: vmunbundle.c
$(CC) $(CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -o $@ $^

node-kstat/build/Release/kstat.node: node-kstat/kstat.cc $(NODE_WAF)
(cd node-kstat && $(NODE_WAF) configure && $(NODE_WAF) build)

Expand Down Expand Up @@ -97,8 +110,23 @@ zoneevent: zoneevent.c
vm/tests.tar.gz:
(cd vm && ./tools/build-test-tarball.sh)

check: $(JSLINT)
$(CSTYLE) \
qemu-exec.c \
vmunbundle.c \
zfs_recv.c \
zfs_send.c \
zoneevent.c
@$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf vm/sbin/*.js
@$(JSLINT) --conf=$(ROOT)/tools/jsl.node.conf vm/node_modules/{qmp,VM}.js
@$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 vm/sbin/*.js
@$(JSSTYLE) -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1 vm/node_modules/{qmp,VM}.js

$(JSLINT):
(cd $(ROOT); $(MAKE) jsl)

clean:
@rm -f $(TARGETS) $(SMARTDC_TARGETS)
@rm -f $(TARGETS) $(SMARTDC_TARGETS) *.o
(cd node-kstat && $(NODE_WAF) clean)
(cd node-expat && $(NODE_WAF) clean)
(cd node-syslog && $(NODE_WAF) clean)
3 changes: 3 additions & 0 deletions src/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ d usr/vm/test 0555 root bin
f usr/vm/sbin/build-user-script 0555 root bin
f usr/vm/sbin/vmadm 0555 root bin
f usr/vm/sbin/vmadmd 0555 root bin
f usr/vm/sbin/vmunbundle 0555 root bin
f usr/vm/sbin/zfs_recv 0555 root bin
f usr/vm/sbin/zfs_send 0555 root bin
f usr/vm/sbin/zoneevent 0555 root bin
f usr/vm/etc/vmadm.completion 0444 root bin
f usr/vm/node_modules/expat_binding.node 0444 root bin
Expand Down
14 changes: 3 additions & 11 deletions src/qemu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ rotate_logs(void)
char old_filename[] = LOG_FILE_PATTERN;
char new_filename[] = LOG_FILE_PATTERN;

/* rename:
/*
* rename:
*
* log.8 -> log.9
* ...
* log.0 -> log.1
*
*/
for (i=9; i>0; i--) {
for (i = 9; i > 0; i--) {
if (snprintf((char *)&old_filename, strlen(LOG_FILE_PATTERN),
LOG_FILE_PATTERN, i - 1) < 0) {

Expand Down Expand Up @@ -95,8 +96,6 @@ rotate_logs(void)
if (rename(LOG_FILE, new_filename)) {
perror(LOG_FILE);
}

return;
}

void
Expand All @@ -113,8 +112,6 @@ redirect_output(void)
perror("Warning, dup2(stderr) failed");
}
}

return;
}

void
Expand All @@ -134,8 +131,6 @@ dump_privs(void)
(void) puts(pname);
}
}

return;
}

void
Expand All @@ -147,8 +142,6 @@ dump_args(int argc, char **argv)
for (i = 0; i < argc; i++) {
(void) puts(argv[i]);
}

return;
}

void
Expand All @@ -160,5 +153,4 @@ exec_next(int argc, char **argv)
execvp(*argv, argv);

/* if we got here we failed. */
return;
}
48 changes: 0 additions & 48 deletions src/tools/node-lint.json

This file was deleted.

9 changes: 0 additions & 9 deletions src/tools/node-lint/.externalToolBuilders/Vows.launch

This file was deleted.

27 changes: 0 additions & 27 deletions src/tools/node-lint/.project

This file was deleted.

6 changes: 0 additions & 6 deletions src/tools/node-lint/.settings/.jsdtscope

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/tools/node-lint/.settings/org.eclipse.core.runtime.prefs

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions src/tools/node-lint/LICENSE

This file was deleted.

57 changes: 0 additions & 57 deletions src/tools/node-lint/Makefile

This file was deleted.

Loading

0 comments on commit 96cc0ed

Please sign in to comment.