From 77c9bd747e3d2816368e4e42b33d7891d8a9da7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 7 Nov 2013 16:46:51 +0100 Subject: [PATCH 01/57] Update Java tests to 4.4 --- src/oca/java/test/GroupTest.java | 2 +- src/oca/java/test/HostTest.java | 3 +- src/oca/java/test/UserTest.java | 2 +- src/oca/java/test/VirtualMachineTest.java | 13 +- src/oca/java/test/oned.conf | 382 +++++++++++++++++----- src/oca/java/test/test.sh | 8 +- 6 files changed, 330 insertions(+), 80 deletions(-) diff --git a/src/oca/java/test/GroupTest.java b/src/oca/java/test/GroupTest.java index 5d2a7015ca..836ad587e4 100644 --- a/src/oca/java/test/GroupTest.java +++ b/src/oca/java/test/GroupTest.java @@ -144,7 +144,7 @@ public class GroupTest res = system.getGroupQuotas(); assertTrue( res.getErrorMessage(), !res.isError() ); - res = system.setGroupQuotas("VM = [ VMS = 7, MEMORY = 0, CPU = 3]"); + res = system.setGroupQuotas("VM = [ VMS = 7, MEMORY = 0, CPU = 3, VOLATILE_SIZE = 1 ]"); assertTrue( res.getErrorMessage(), !res.isError() ); Node node = system.getGroupQuotasXML(); diff --git a/src/oca/java/test/HostTest.java b/src/oca/java/test/HostTest.java index 8b1990ec83..03176212e1 100644 --- a/src/oca/java/test/HostTest.java +++ b/src/oca/java/test/HostTest.java @@ -63,7 +63,7 @@ public class HostTest @Before public void setUp() throws Exception { - res = Host.allocate(client, name, "im_dummy", "vmm_dummy", "dummy"); + res = Host.allocate(client, name, "dummy", "dummy", "dummy"); int hid = !res.isError() ? Integer.parseInt(res.getMessage()) : -1; host = new Host(hid, client); @@ -76,6 +76,7 @@ public class HostTest public void tearDown() throws Exception { host.delete(); + Thread.sleep(2000); } @Test diff --git a/src/oca/java/test/UserTest.java b/src/oca/java/test/UserTest.java index b5875e5242..64f966036f 100644 --- a/src/oca/java/test/UserTest.java +++ b/src/oca/java/test/UserTest.java @@ -173,7 +173,7 @@ public class UserTest res = system.getUserQuotas(); assertTrue( res.getErrorMessage(), !res.isError() ); - res = system.setUserQuotas("VM = [ VMS = 7, MEMORY = 0, CPU = 3]"); + res = system.setUserQuotas("VM = [ VMS = 7, MEMORY = 0, CPU = 3, VOLATILE_SIZE = 1 ]"); assertTrue( res.getErrorMessage(), !res.isError() ); Node node = system.getUserQuotasXML(); diff --git a/src/oca/java/test/VirtualMachineTest.java b/src/oca/java/test/VirtualMachineTest.java index bd6fdf953d..3edaa430dd 100644 --- a/src/oca/java/test/VirtualMachineTest.java +++ b/src/oca/java/test/VirtualMachineTest.java @@ -82,11 +82,11 @@ public class VirtualMachineTest res = Host.allocate(client, "host_A", - "im_dummy", "vmm_dummy", "dummy"); + "dummy", "dummy", "dummy"); hid_A = Integer.parseInt( res.getMessage() ); res = Host.allocate(client, "host_B", - "im_dummy", "vmm_dummy", "dummy"); + "dummy", "dummy", "dummy"); hid_B = Integer.parseInt( res.getMessage() ); Datastore systemDs = new Datastore(0, client); @@ -301,6 +301,8 @@ public class VirtualMachineTest assertTrue( vm.xpath("TEMPLATE/CONTEXT/DNS").equals("192.169.1.4") ); } + // TODO +/* @Test public void savedisk() { @@ -332,6 +334,11 @@ public class VirtualMachineTest vm = new VirtualMachine(vmid, client); + res = vm.deploy(hid_A); + assertTrue( res.getErrorMessage(), !res.isError() ); + + waitAssert(vm, "ACTIVE", "RUNNING"); + res = vm.savedisk(0, "New_image"); assertTrue( res.getErrorMessage(), !res.isError() ); @@ -341,7 +348,7 @@ public class VirtualMachineTest res = vm.info(); assertTrue( res.getErrorMessage(), !res.isError() ); } - +*/ @Test public void resize() { diff --git a/src/oca/java/test/oned.conf b/src/oca/java/test/oned.conf index a2cc5ac529..d430843dda 100644 --- a/src/oca/java/test/oned.conf +++ b/src/oca/java/test/oned.conf @@ -6,15 +6,17 @@ # Daemon configuration attributes #------------------------------------------------------------------------------- # MANAGER_TIMER: Time in seconds the core uses to evaluate periodical functions. -# HOST_MONITORING_INTERVAL and VM_POLLING_INTERVAL can not have smaller values -# than MANAGER_TIMER. +# MONITORING_INTERVAL cannot have a smaller value than MANAGER_TIMER. +# +# MONITORING_INTERVAL: Time in seconds between host and VM monitorization. # -# HOST_MONITORING_INTERVAL: Time in seconds between host monitorization. # HOST_PER_INTERVAL: Number of hosts monitored in each interval. +# HOST_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring +# information. Use 0 to disable HOST monitoring recording. # -# VM_POLLING_INTERVAL: Time in seconds between virtual machine monitorization. -# (use 0 to disable VM monitoring). # VM_PER_INTERVAL: Number of VMs monitored in each interval. +# VM_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring +# information. Use 0 to disable VM monitoring recording. # # SCRIPTS_REMOTE_DIR: Remote path to store the monitoring and VM management # scripts. @@ -33,17 +35,30 @@ # VNC_BASE_PORT: VNC ports for VMs can be automatically set to VNC_BASE_PORT + # VMID # -# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG +# LOG: Configuration for the logging system +# system: defines the logging system: +# file to log in the oned.log file +# syslog to use the syslog facilities +# debug_level: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG +# +# VM_SUBMIT_ON_HOLD: Forces VMs to be created on hold state instead of pending. +# Values: YES or NO. #******************************************************************************* +LOG = [ + system = "file", + debug_level = 3 +] + #MANAGER_TIMER = 30 -HOST_MONITORING_INTERVAL = 600 -#HOST_PER_INTERVAL = 15 +MONITORING_INTERVAL = 300 -VM_POLLING_INTERVAL = 600 -#VM_PER_INTERVAL = 5 +#HOST_PER_INTERVAL = 15 +#HOST_MONITORING_EXPIRATION_TIME = 86400 +#VM_PER_INTERVAL = 5 +#VM_MONITORING_EXPIRATION_TIME = 86400 SCRIPTS_REMOTE_DIR=/var/tmp/one @@ -61,7 +76,35 @@ DB = [ backend = "sqlite" ] VNC_BASE_PORT = 5900 -DEBUG_LEVEL = 3 +#VM_SUBMIT_ON_HOLD = "NO" + +#******************************************************************************* +# XML-RPC server configuration +#------------------------------------------------------------------------------- +# These are configuration parameters for oned's xmlrpc-c server +# +# MAX_CONN: Maximum number of simultaneous TCP connections the server +# will maintain +# +# MAX_CONN_BACKLOG: Maximum number of TCP connections the operating system +# will accept on the server's behalf without the server accepting them from +# the operating system +# +# KEEPALIVE_TIMEOUT: Maximum time in seconds that the server allows a +# connection to be open between RPCs +# +# KEEPALIVE_MAX_CONN: Maximum number of RPCs that the server will execute on +# a single connection +# +# TIMEOUT: Maximum time in seconds the server will wait for the client to +# do anything while processing an RPC +#******************************************************************************* + +#MAX_CONN = 15 +#MAX_CONN_BACKLOG = 15 +#KEEPALIVE_TIMEOUT = 15 +#KEEPALIVE_MAX_CONN = 30 +#TIMEOUT = 15 #******************************************************************************* # Physical Networks configuration @@ -80,11 +123,21 @@ MAC_PREFIX = "02:00" #******************************************************************************* # DataStore Configuration #******************************************************************************* -# DATASTORE_LOCATION: Path for Datastores in the hosts. It IS the same for all -# the hosts in the cluster. DATASTORE_LOCATION IS ONLY FOR THE HOSTS AND *NOT* -# THE FRONT-END. It defaults to /var/lib/one/datastores (or +# DATASTORE_LOCATION: *Default* Path for Datastores in the hosts. It IS the +# same for all the hosts in the cluster. DATASTORE_LOCATION IS ONLY FOR THE +# HOSTS AND *NOT* THE FRONT-END. It defaults to /var/lib/one/datastores (or # $ONE_LOCATION/var/datastores in self-contained mode) # +# You can define a different DATASTORE_LOCATION in each cluster by updating +# its properties with onecluster update. +# +# DATASTORE_BASE_PATH: This is the base path for the SOURCE attribute of +# the images registered in a Datastore. This is a default value, that can be +# changed when the datastore is created. +# +# DATASTORE_CAPACITY_CHECK: Checks that there is enough capacity before +# creating a new imag. Defaults to Yes +# # DEFAULT_IMAGE_TYPE: This can take values # OS Image file holding an operating system # CDROM Image file holding a CDROM @@ -97,11 +150,16 @@ MAC_PREFIX = "02:00" # vd KVM virtual disk #******************************************************************************* -#DATASTORE_LOCATION = /var/lib/one/datastores +#DATASTORE_LOCATION = /var/lib/one/datastores + +#DATASTORE_BASE_PATH = /var/lib/one/datastores + +DATASTORE_CAPACITY_CHECK = "yes" DEFAULT_IMAGE_TYPE = "OS" DEFAULT_DEVICE_PREFIX = "hd" + #******************************************************************************* # Information Driver Configuration #******************************************************************************* @@ -119,15 +177,35 @@ DEFAULT_DEVICE_PREFIX = "hd" # /etc/one/ if OpenNebula was installed in /) #******************************************************************************* +#------------------------------------------------------------------------------- +# Information Collector for KVM and Xen IM's. +#------------------------------------------------------------------------------- +# This driver CANNOT BE ASSIGNED TO A HOST, and needs to be used with KVM or +# Xen drivers +# -h prints this help. +# -a Address to bind the collectd sockect (defults 0.0.0.0) +# -p UDP port to listen for monitor information (default 4124) +# -f Interval in seconds to flush collected information (default 5) +# -t Number of threads for the server (defult 50) +# -i Time in seconds of the monitorization push cycle. This parameter must +# be smaller than MONITORING_INTERVAL, otherwise push monitorization will +# not be effective. +#------------------------------------------------------------------------------- +IM_MAD = [ + name = "collectd", + executable = "collectd", + arguments = "-p 4124 -f 5 -t 50 -i 20" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # KVM Information Driver Manager Configuration # -r number of retries when monitoring a host # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- IM_MAD = [ - name = "im_kvm", + name = "kvm", executable = "one_im_ssh", - arguments = "-r 0 -t 15 kvm" ] + arguments = "-r 3 -t 15 kvm" ] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -135,10 +213,19 @@ IM_MAD = [ # -r number of retries when monitoring a host # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- + +# Driver for Xen 3.x #IM_MAD = [ -# name = "im_xen", +# name = "xen", # executable = "one_im_ssh", -# arguments = "xen" ] +# arguments = "xen3" ] + +# Driver for Xen 4.x +#IM_MAD = [ +# name = "xen", +# executable = "one_im_ssh", +# arguments = "xen4" ] + #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -147,33 +234,24 @@ IM_MAD = [ # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- #IM_MAD = [ -# name = "im_vmware", +# name = "vmware", # executable = "one_im_sh", -# arguments = "-t 15 -r 0 vmware" ] +# arguments = "-c -t 15 -r 0 vmware" ] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # EC2 Information Driver Manager Configuration #------------------------------------------------------------------------------- #IM_MAD = [ -# name = "im_ec2", -# executable = "one_im_ec2", -# arguments = "im_ec2/im_ec2.conf" ] -#------------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Ganglia Information Driver Manager Configuration -#----------------------------------------------------------------------------- -#IM_MAD = [ -# name = "im_ganglia", +# name = "ec2", # executable = "one_im_sh", -# arguments = "ganglia" ] -#----------------------------------------------------------------------------- +# arguments = "-c -t 1 -r 0 ec2" ] +#------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Dummy Information Driver Manager Configuration #------------------------------------------------------------------------------- -IM_MAD = [ name="im_dummy", executable="one_im_dummy"] +IM_MAD = [ name="dummy", executable="one_im_dummy"] #------------------------------------------------------------------------------- #******************************************************************************* @@ -204,10 +282,13 @@ IM_MAD = [ name="im_dummy", executable="one_im_dummy"] # -l actions executed locally, command can be # overridden for each action. # Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll -# An example: "-l migrate,poll=poll_ganglia,save" +# An example: "-l migrate=migrate_local,save" +# +# Note: You can use type = "qemu" to use qemu emulated guests, e.g. if your +# CPU does not have virtualization extensions or use nested Qemu-KVM hosts #------------------------------------------------------------------------------- VM_MAD = [ - name = "vmm_kvm", + name = "kvm", executable = "one_vmm_exec", arguments = "-t 15 -r 0 kvm", default = "vmm_exec/vmm_exec_kvm.conf", @@ -221,14 +302,25 @@ VM_MAD = [ # -l actions executed locally, command can be # overridden for each action. # Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll -# An example: "-l migrate,poll=poll_ganglia,save" +# An example: "-l migrate,save" #------------------------------------------------------------------------------- + +# Driver for Xen 3.x #VM_MAD = [ -# name = "vmm_xen", +# name = "xen", # executable = "one_vmm_exec", -# arguments = "-t 15 -r 0 xen", -# default = "vmm_exec/vmm_exec_xen.conf", +# arguments = "-t 15 -r 0 xen3", +# default = "vmm_exec/vmm_exec_xen3.conf", # type = "xen" ] + +# Driver for Xen 4.x +#VM_MAD = [ +# name = "xen", +# executable = "one_vmm_exec", +# arguments = "-t 15 -r 0 xen4", +# default = "vmm_exec/vmm_exec_xen4.conf", +# type = "xen" ] + #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -237,30 +329,29 @@ VM_MAD = [ # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- #VM_MAD = [ -# name = "vmm_vmware", +# name = "vmware", # executable = "one_vmm_sh", -# arguments = "-t 15 -r 0 vmware", +# arguments = "-t 15 -r 0 vmware -s sh", # default = "vmm_exec/vmm_exec_vmware.conf", # type = "vmware" ] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # EC2 Virtualization Driver Manager Configuration -# arguments: default values for the EC2 driver, can be an absolute path or -# relative to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was -# installed in /). +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of actions performed at the same time #------------------------------------------------------------------------------- #VM_MAD = [ -# name = "vmm_ec2", -# executable = "one_vmm_ec2", -# arguments = "vmm_ec2/vmm_ec2.conf", +# name = "ec2", +# executable = "one_vmm_sh", +# arguments = "-t 15 -r 0 ec2", # type = "xml" ] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Dummy Virtualization Driver Configuration #------------------------------------------------------------------------------- -VM_MAD = [ name="vmm_dummy", executable="one_vmm_dummy", type="xml" ] +VM_MAD = [ name="dummy", executable="one_vmm_dummy", type="xml" ] #------------------------------------------------------------------------------- #******************************************************************************* @@ -277,11 +368,93 @@ VM_MAD = [ name="vmm_dummy", executable="one_vmm_dummy", type="xml" ] # -t: number of threads, i.e. number of transfers made at the same time # -d: list of transfer drivers separated by commas, if not defined all the # drivers available will be enabled +# +# The configuration for each driver is defined in TM_MAD_CONF. These +# values are used when creating a new datastore and should not be modified +# since they define the datastore behaviour. +# name : name of the transfer driver, listed in the -d option of the +# TM_MAD section +# ln_target : determines how the persistent images will be cloned when +# a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# clone_target : determines how the non persistent images will be +# cloned when a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# shared : determines if the storage holding the system datastore is shared +# among the different hosts or not. Valid values: "yes" or "no" #******************************************************************************* TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,qcow2,ssh,vmware,iscsi" ] + arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,iscsi,ceph" +] + +TM_MAD_CONF = [ + name = "dummy", + ln_target = "NONE", + clone_target= "SYSTEM", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "lvm", + ln_target = "NONE", + clone_target= "SELF", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "shared", + ln_target = "NONE", + clone_target= "SYSTEM", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "shared_lvm", + ln_target = "SYSTEM", + clone_target= "SYSTEM", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "qcow2", + ln_target = "NONE", + clone_target= "SYSTEM", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "ssh", + ln_target = "SYSTEM", + clone_target= "SYSTEM", + shared = "no" +] + +TM_MAD_CONF = [ + name = "vmfs", + ln_target = "NONE", + clone_target= "SYSTEM", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "iscsi", + ln_target = "NONE", + clone_target= "SELF", + shared = "yes" +] + +TM_MAD_CONF = [ + name = "ceph", + ln_target = "NONE", + clone_target= "SELF", + shared = "yes" +] #******************************************************************************* # Datastore Driver Configuration @@ -298,13 +471,16 @@ TM_MAD = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d fs,vmware,iscsi,lvm" + arguments = "-t 15 -d dummy,fs,vmfs,iscsi,lvm,ceph" ] #******************************************************************************* # Hook Manager Configuration #******************************************************************************* -# The Driver (HM_MAD), used to execute the Hooks +# The Driver (HM_MAD) +# ----------------------------------------------- +# +# Used to execute the Hooks: # executable: path of the hook driver executable, can be an # absolute path or relative to $ONE_LOCATION/lib/mads (or # /usr/lib/one/mads/ if OpenNebula was installed in /) @@ -313,30 +489,52 @@ DATASTORE_MAD = [ # to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was installed # in /) # -# Virtual Machine Hooks (VM_HOOK) defined by: +# Virtual Machine Hooks (VM_HOOK) +# ------------------------------- +# +# Defined by: # name : for the hook, useful to track the hook (OPTIONAL) # on : when the hook should be executed, # - CREATE, when the VM is created (onevm create) # - PROLOG, when the VM is in the prolog state # - RUNNING, after the VM is successfully booted +# - UNKNOWN, when the VM is in the unknown state # - SHUTDOWN, after the VM is shutdown # - STOP, after the VM is stopped (including VM image transfers) # - DONE, after the VM is deleted or shutdown # - FAILED, when the VM enters the failed state +# - CUSTOM, user defined specific STATE and LCM_STATE combination +# of states to trigger the hook. # command : path is relative to $ONE_LOCATION/var/remotes/hook # (self-contained) or to /var/lib/one/remotes/hook (system-wide). # That directory will be copied on the hosts under # SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist # on the target host # arguments : for the hook. You can access to VM information with $ -# - $VMID, the ID of the virtual machine +# - $ID, the ID of the virtual machine # - $TEMPLATE, the VM template in xml and base64 encoded +# - $PREV_STATE, the previous STATE of the Virtual Machine +# - $PREV_LCM_STATE, the previous LCM STATE of the Virtual Machine # remote : values, # - YES, The hook is executed in the host where the VM was # allocated # - NO, The hook is executed in the OpenNebula server (default) # -# Host Hooks (HOST_HOOK) defined by: +# Example Virtual Machine Hook +# ---------------------------- +# +# VM_HOOK = [ +# name = "advanced_hook", +# on = "CUSTOM", +# state = "ACTIVE", +# lcm_state = "BOOT_UNKNOWN", +# command = "log.rb", +# arguments = "$ID $PREV_STATE $PREV_LCM_STATE" ] +# +# Host Hooks (HOST_HOOK) +# ------------------------------- +# +# Defined by: # name : for the hook, useful to track the hook (OPTIONAL) # on : when the hook should be executed, # - CREATE, when the Host is created (onehost create) @@ -348,30 +546,55 @@ DATASTORE_MAD = [ # SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist # on the target host. # arguments : for the hook. You can use the following Host information: -# - $HID, the ID of the host +# - $ID, the ID of the host # - $TEMPLATE, the Host template in xml and base64 encoded # remote : values, # - YES, The hook is executed in the host # - NO, The hook is executed in the OpenNebula server (default) +# +# Virtual Network (VNET_HOOK) +# User (USER_HOOK) +# Group (GROUP_HOOK) +# Image (IMAGE_HOOK) +# ------------------------------- +# +# These hooks are executed when one of the referring entities are created or +# removed. Each hook is defined by: +# name : for the hook, useful to track the hook (OPTIONAL) +# on : when the hook should be executed, +# - CREATE, when the vnet is created +# - REMOVE, when the vnet is removed +# command : path is relative to $ONE_LOCATION/var/remotes/hook +# (self-contained) or to /var/lib/one/remotes/hook (system-wide). +# That directory will be copied on the hosts under +# SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist +# on the target host. +# arguments : for the hook. You can use the following Host information: +# - $ID, the ID of the host +# - $TEMPLATE, the vnet template in xml and base64 encoded #------------------------------------------------------------------------------- HM_MAD = [ executable = "one_hm" ] -#------------------------------------------------------------------------------- #******************************************************************************* # Fault Tolerance Hooks #******************************************************************************* -# This hook is used to perform recovery actions when a host fails. The VMs -# running in the host can be deleted (use -d option) or resubmitted (-r) in -# other host -# Last argument (force) can be "y", so suspended VMs in the host will be -# resubmitted/deleted, or "n", so suspended VMs in the host will be ignored +# This hook is used to perform recovery actions when a host fails. +# Script to implement host failure tolerance +# It can be set to +# -r recreate VMs running in the host +# -d delete VMs running in the host +# Additional flags +# -f force resubmission of suspended VMs +# -p avoid resubmission if host comes +# back after n monitoring cycles +#******************************************************************************* # #HOST_HOOK = [ # name = "error", # on = "ERROR", # command = "ft/host_error.rb", -# arguments = "$HID -r n", +# arguments = "$ID -r", # remote = "no" ] #------------------------------------------------------------------------------- # These two hooks can be used to automatically delete or resubmit VMs that reach @@ -386,13 +609,13 @@ HM_MAD = [ # name = "on_failure_delete", # on = "FAILED", # command = "/usr/bin/env onevm delete", -# arguments = "$VMID" ] +# arguments = "$ID" ] # #VM_HOOK = [ -# name = "on_failure_resubmit", +# name = "on_failure_recreate", # on = "FAILED", -# command = "/usr/bin/env onevm resubmit", -# arguments = "$VMID" ] +# command = "/usr/bin/env onevm delete --recreate", +# arguments = "$ID" ] #------------------------------------------------------------------------------- #******************************************************************************* @@ -414,21 +637,25 @@ HM_MAD = [ # valid. During this time, the driver is not used. Use 0 to disable session # caching # -# ENABLE_OTHER_PERMISSIONS: Whether or not to enable the permissions for -# 'other'. Users in the oneadmin group will still be able to change -# these permissions. Values: YES or NO +# ENABLE_OTHER_PERMISSIONS: Whether or not users can set the permissions for +# 'other', so publishing or sharing resources with others. Users in the oneadmin +# group will still be able to change these permissions. Values: YES or NO. +# +# DEFAULT_UMASK: Similar to Unix umask, sets the default resources permissions. +# Its format must be 3 octal digits. For example a umask of 137 will set +# the new object's permissions to 640 "um- u-- ---" #******************************************************************************* AUTH_MAD = [ executable = "one_auth_mad", authn = "ssh,x509,ldap,server_cipher,server_x509" -# , authz = "quota" ] SESSION_EXPIRATION_TIME = 900 #ENABLE_OTHER_PERMISSIONS = "YES" +DEFAULT_UMASK = 177 #******************************************************************************* # Restricted Attributes Configuration @@ -437,9 +664,18 @@ SESSION_EXPIRATION_TIME = 900 #******************************************************************************* VM_RESTRICTED_ATTR = "CONTEXT/FILES" -VM_RESTRICTED_ATTR = "DISK/SOURCE" VM_RESTRICTED_ATTR = "NIC/MAC" VM_RESTRICTED_ATTR = "NIC/VLAN_ID" -VM_RESTRICTED_ATTR = "RANK" + +#VM_RESTRICTED_ATTR = "RANK" +#VM_RESTRICTED_ATTR = "SCHED_RANK" +#VM_RESTRICTED_ATTR = "REQUIREMENTS" +#VM_RESTRICTED_ATTR = "SCHED_REQUIREMENTS" IMAGE_RESTRICTED_ATTR = "SOURCE" + +#******************************************************************************* +# OneGate +#******************************************************************************* + +#ONEGATE_ENDPOINT = "http://frontend:5030" diff --git a/src/oca/java/test/test.sh b/src/oca/java/test/test.sh index 4b3f30c4c6..03f10e87cf 100755 --- a/src/oca/java/test/test.sh +++ b/src/oca/java/test/test.sh @@ -23,8 +23,10 @@ JUNIT_JAR="/usr/share/java/junit4.jar" if [ -z $ONE_LOCATION ]; then DB_LOCATION="/var/lib/one/one.db" + LOG_LOCATION="/var/log/one" else DB_LOCATION="$ONE_LOCATION/var/one.db" + LOG_LOCATION="$ONE_LOCATION/var" fi if [ -f $DB_LOCATION ]; then @@ -40,7 +42,11 @@ PID=$$ oned -f & -sleep 10s; +sleep 2; + +until grep 'Datastore default (1) successfully monitored' $LOG_LOCATION/oned.log; do + sleep 1; +done java -cp ../lib/*:../jar/*:$JUNIT_JAR:. org.junit.runner.JUnitCore $1 From 6cee0680b92787bc25f6a32f3a9df411f088d81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 7 Nov 2013 16:48:04 +0100 Subject: [PATCH 02/57] Fix segfault in TM finalize action --- src/tm/TransferManager.cc | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/tm/TransferManager.cc b/src/tm/TransferManager.cc index 0552b89295..a83f01a7e2 100644 --- a/src/tm/TransferManager.cc +++ b/src/tm/TransferManager.cc @@ -165,6 +165,15 @@ void TransferManager::do_action(const string &action, void * arg) delete static_cast(arg); + if (action == ACTION_FINALIZE) + { + NebulaLog::log("TrM",Log::INFO,"Stopping Transfer Manager..."); + + MadManager::stop(); + + return; + } + vm = vmpool->get(vid,true); if (vm == 0) @@ -172,10 +181,20 @@ void TransferManager::do_action(const string &action, void * arg) return; } - hid = vm->get_hid(); - vm->unlock(); + if (vm->hasHistory()) + { + hid = vm->get_hid(); - host = hpool->get(hid,true); + vm->unlock(); + + host = hpool->get(hid,true); + } + else + { + vm->unlock(); + + host = 0; + } if ( host == 0) { @@ -334,12 +353,6 @@ void TransferManager::do_action(const string &action, void * arg) { driver_cancel_action(vid); } - else if (action == ACTION_FINALIZE) - { - NebulaLog::log("TrM",Log::INFO,"Stopping Transfer Manager..."); - - MadManager::stop(); - } else { ostringstream oss; From b07e876fb1ea4fad6ab2075206dac4deddf2f2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 7 Nov 2013 18:25:10 +0100 Subject: [PATCH 03/57] Bug #2440: Images to be saved-as are only set to ready if the VM is shutdown correctly (epilog phase) --- src/dm/DispatchManagerStates.cc | 8 ++++---- src/vm/VirtualMachine.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dm/DispatchManagerStates.cc b/src/dm/DispatchManagerStates.cc index 41817174e0..1ac3eb0c90 100644 --- a/src/dm/DispatchManagerStates.cc +++ b/src/dm/DispatchManagerStates.cc @@ -203,6 +203,10 @@ void DispatchManager::done_action(int vid) lcm_state == VirtualMachine::CANCEL || lcm_state == VirtualMachine::CLEANUP_DELETE)) { + vm->release_network_leases(); + + vm->release_disk_images(); + vm->set_state(VirtualMachine::DONE); vm->set_state(VirtualMachine::LCM_INIT); @@ -213,10 +217,6 @@ void DispatchManager::done_action(int vid) vm->log("DiM", Log::INFO, "New VM state is DONE"); - vm->release_network_leases(); - - vm->release_disk_images(); - uid = vm->get_uid(); gid = vm->get_gid(); tmpl = vm->clone_template(); diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 873abbc117..0700061790 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -2321,7 +2321,7 @@ void VirtualMachine::release_disk_images() if ( rc == 0 ) { - imagem->release_image(oid, save_as_id, (state == FAILED)); + imagem->release_image(oid, save_as_id, (state != ACTIVE || lcm_state != EPILOG)); } } } From eb3422970dd56a0fa9735b6fc6e4f82fa7c58e33 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 8 Nov 2013 14:36:19 +0100 Subject: [PATCH 04/57] bug #2411: only run vmcontext with parameter start --- .../base/etc/init.d/vmcontext | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/share/scripts/context-packages/base/etc/init.d/vmcontext b/share/scripts/context-packages/base/etc/init.d/vmcontext index 641620edf3..30deb54a7b 100755 --- a/share/scripts/context-packages/base/etc/init.d/vmcontext +++ b/share/scripts/context-packages/base/etc/init.d/vmcontext @@ -50,16 +50,21 @@ function execute_scripts { done } -if [ -e "/dev/disk/by-label/CONTEXT" ]; then - mount -t iso9660 -L CONTEXT -o ro /mnt - if [ -f /mnt/context.sh ]; then - export_rc_vars /mnt/context.sh +case "$1" in +"start") + if [ -e "/dev/disk/by-label/CONTEXT" ]; then + mount -t iso9660 -L CONTEXT -o ro /mnt + if [ -f /mnt/context.sh ]; then + export_rc_vars /mnt/context.sh + fi + + execute_scripts + + umount /mnt + else + execute_scripts fi + ;; - execute_scripts - - umount /mnt -else - execute_scripts -fi +esac From 4f373795ed32b0d88dc5e6999c67b87bdeaa8b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 8 Nov 2013 15:28:19 +0100 Subject: [PATCH 05/57] Feature #2442: New oned.conf default values --- share/etc/oned.conf | 6 +++--- src/nebula/NebulaTemplate.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/etc/oned.conf b/share/etc/oned.conf index a3f176ab42..905cc589f2 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -52,13 +52,13 @@ LOG = [ #MANAGER_TIMER = 30 -MONITORING_INTERVAL = 300 +MONITORING_INTERVAL = 60 #HOST_PER_INTERVAL = 15 -#HOST_MONITORING_EXPIRATION_TIME = 86400 +#HOST_MONITORING_EXPIRATION_TIME = 43200 #VM_PER_INTERVAL = 5 -#VM_MONITORING_EXPIRATION_TIME = 86400 +#VM_MONITORING_EXPIRATION_TIME = 14400 SCRIPTS_REMOTE_DIR=/var/tmp/one diff --git a/src/nebula/NebulaTemplate.cc b/src/nebula/NebulaTemplate.cc index 672dc7a36e..66ce0899d6 100644 --- a/src/nebula/NebulaTemplate.cc +++ b/src/nebula/NebulaTemplate.cc @@ -102,7 +102,7 @@ void OpenNebulaTemplate::set_conf_default() #******************************************************************************* */ // MONITORING_INTERVAL - value = "300"; + value = "60"; attribute = new SingleAttribute("MONITORING_INTERVAL",value); conf_default.insert(make_pair(attribute->name(),attribute)); @@ -114,7 +114,7 @@ void OpenNebulaTemplate::set_conf_default() conf_default.insert(make_pair(attribute->name(),attribute)); // HOST_MONITORING_EXPIRATION_TIME - value = "86400"; + value = "43200"; attribute = new SingleAttribute("HOST_MONITORING_EXPIRATION_TIME",value); conf_default.insert(make_pair(attribute->name(),attribute)); @@ -126,7 +126,7 @@ void OpenNebulaTemplate::set_conf_default() conf_default.insert(make_pair(attribute->name(),attribute)); // VM_MONITORING_EXPIRATION_TIME - value = "86400"; + value = "14400"; attribute = new SingleAttribute("VM_MONITORING_EXPIRATION_TIME",value); conf_default.insert(make_pair(attribute->name(),attribute)); From f5876a248ec52fe1e06c54754829c5b0fee7bbb1 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sun, 10 Nov 2013 20:40:04 +0100 Subject: [PATCH 06/57] bug #2144: Execute epilog commands if an attach operation fails --- include/VirtualMachineManager.h | 2 ++ src/vmm/VirtualMachineManager.cc | 46 +++++++++++++++++++++++++++++--- src/vmm_mad/exec/one_vmm_exec.rb | 10 +++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index c53b7d7965..9a7f188fb6 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -211,6 +211,7 @@ private: * @param cfile checkpoint file to save the VM * @param disk_id Disk to attach/detach, if any * @param tm_command Transfer Manager command to attach/detach, if any + * @param tm_command_rollback TM command in case of attach failure * @param disk_target_path Path of the disk to attach, if any * @param tmpl the VM information in XML */ @@ -224,6 +225,7 @@ private: const string& rdfile, const string& cfile, const string& tm_command, + const string& tm_command_rollback, const string& disk_target_path, const string& tmpl); diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index c53baeb367..6bfd98fda2 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -352,6 +352,7 @@ string * VirtualMachineManager::format_message( const string& rdfile, const string& cfile, const string& tm_command, + const string& tm_command_rollback, const string& disk_target_path, const string& tmpl) { @@ -402,13 +403,23 @@ string * VirtualMachineManager::format_message( if ( !tm_command.empty() ) { - oss << ""; + oss << ""; } else { oss << ""; } + if (!tm_command_rollback.empty()) + { + oss << ""; + } + else + { + oss << ""; + } + if ( !disk_target_path.empty() ) { oss << ""<< disk_target_path << ""; @@ -483,6 +494,7 @@ void VirtualMachineManager::deploy_action(int vid) "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->deploy(vid, *drv_msg); @@ -582,6 +594,7 @@ void VirtualMachineManager::save_action( vm->get_checkpoint_file(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->save(vid, *drv_msg); @@ -663,6 +676,7 @@ void VirtualMachineManager::shutdown_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->shutdown(vid, *drv_msg); @@ -739,6 +753,7 @@ void VirtualMachineManager::reboot_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->reboot(vid, *drv_msg); @@ -810,6 +825,7 @@ void VirtualMachineManager::reset_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->reset(vid, *drv_msg); @@ -882,6 +898,7 @@ void VirtualMachineManager::cancel_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->cancel(vid, *drv_msg); @@ -959,6 +976,7 @@ void VirtualMachineManager::cancel_previous_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->cancel(vid, *drv_msg); @@ -1051,6 +1069,7 @@ void VirtualMachineManager::cleanup_action( "", os.str(), "", + "", vm->to_xml(vm_tmpl)); vmd->cleanup(vid, *drv_msg); @@ -1135,6 +1154,7 @@ void VirtualMachineManager::cleanup_previous_action( "", os.str(), "", + "", vm->to_xml(vm_tmpl)); vmd->cleanup(vid, *drv_msg); @@ -1214,6 +1234,7 @@ void VirtualMachineManager::migrate_action( "", os.str(), "", + "", vm->to_xml(vm_tmpl)); vmd->migrate(vid, *drv_msg); @@ -1296,6 +1317,7 @@ void VirtualMachineManager::restore_action( vm->get_checkpoint_file(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->restore(vid, *drv_msg); @@ -1373,6 +1395,7 @@ void VirtualMachineManager::poll_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->poll(vid, *drv_msg); @@ -1549,6 +1572,7 @@ void VirtualMachineManager::timer_action() "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->poll(*it, *drv_msg); @@ -1580,13 +1604,15 @@ void VirtualMachineManager::attach_action( string vm_tm_mad; string opennebula_hostname; string prolog_cmd; + string epilog_cmd; string disk_path; const VectorAttribute * disk; int disk_id; int rc; - Nebula& nd = Nebula::instance(); + Nebula& nd = Nebula::instance(); + TransferManager * tm = nd.get_tm(); // Get the VM from the pool vm = vmpool->get(vid,true); @@ -1617,9 +1643,10 @@ void VirtualMachineManager::attach_action( } vm_tm_mad = vm->get_tm_mad(); + opennebula_hostname = nd.get_nebula_hostname(); - rc = nd.get_tm()->prolog_transfer_command( + rc = tm->prolog_transfer_command( vm, disk, vm_tm_mad, @@ -1636,6 +1663,12 @@ void VirtualMachineManager::attach_action( os.str(""); + tm->epilog_transfer_command(vm, disk, os); + + epilog_cmd = os.str(); + + os.str(""); + disk->vector_value("DISK_ID", disk_id); os << vm->get_remote_system_dir() << "/disk." << disk_id; @@ -1653,6 +1686,7 @@ void VirtualMachineManager::attach_action( "", "", prolog_cmd, + epilog_cmd, disk_path, vm->to_xml(vm_tmpl)); @@ -1773,6 +1807,7 @@ void VirtualMachineManager::detach_action( "", "", epilog_cmd, + "", disk_path, vm->to_xml(vm_tmpl)); @@ -1855,6 +1890,7 @@ void VirtualMachineManager::snapshot_create_action(int vid) "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->snapshot_create(vid, *drv_msg); @@ -1932,6 +1968,7 @@ void VirtualMachineManager::snapshot_revert_action(int vid) "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->snapshot_revert(vid, *drv_msg); @@ -2009,6 +2046,7 @@ void VirtualMachineManager::snapshot_delete_action(int vid) "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->snapshot_delete(vid, *drv_msg); @@ -2088,6 +2126,7 @@ void VirtualMachineManager::attach_nic_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->attach_nic(vid, *drv_msg); @@ -2167,6 +2206,7 @@ void VirtualMachineManager::detach_nic_action( "", "", "", + "", vm->to_xml(vm_tmpl)); vmd->detach_nic(vid, *drv_msg); diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index dc73f45f2c..9ef2a19ecf 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -535,12 +535,15 @@ class ExecDriver < VirtualMachineDriver xml_data = decode(drv_message) tm_command = ensure_xpath(xml_data, id, action, 'TM_COMMAND') || return + tm_rollback= xml_data.elements['TM_COMMAND_ROLLBACK'].text.strip target_xpath = "VM/TEMPLATE/DISK[ATTACH='YES']/TARGET" target = ensure_xpath(xml_data, id, action, target_xpath) || return target_index = target.downcase[-1..-1].unpack('c').first - 97 + + action = VmmAction.new(self, id, :attach_disk, drv_message) # Bug #1355, argument character limitation in ESX @@ -566,6 +569,13 @@ class ExecDriver < VirtualMachineDriver target, target_index, drv_message + ], + :fail_actions => [ + { + :driver => :tm, + :action => :tm_detach, + :parameters => tm_rollback.split + } ] } ] From 5301a4c3a8a0ec627086d888427c2bf1e7de5dde Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sun, 10 Nov 2013 23:05:16 +0100 Subject: [PATCH 07/57] Feature #2439: Adds requirements expression to give more feedback to the user --- src/scheduler/src/sched/Scheduler.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index fae6eb514f..02067ae977 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -584,7 +584,12 @@ void Scheduler::match_schedule() } else if (n_matched == 0) { - vm->log("No host meets SCHED_REQUIREMENTS"); + ostringstream oss; + + oss << "No host meets SCHED_REQUIREMENTS: " + << reqs; + + vm->log(oss.str()); } else { @@ -726,7 +731,12 @@ void Scheduler::match_schedule() } else if (n_matched == 0) { - vm->log("No system datastore meets SCHED_DS_REQUIREMENTS"); + ostringstream oss; + + oss << "No system datastore meets SCHED_DS_REQUIREMENTS: " + << ds_reqs; + + vm->log(oss.str()); } else { From 7f4bfee4cce1571acb8bea5f04d242a58da7d246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 11 Nov 2013 10:59:12 +0100 Subject: [PATCH 08/57] Feature #2413: Add ETHX_MAC context attribute for CONTEXT/NETWORK=YES --- src/vm/VirtualMachine.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 0700061790..88dc58aabf 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -686,6 +686,7 @@ int VirtualMachine::parse_context(string& error_str) string name = vatt->vector_value("NETWORK"); string ip = vatt->vector_value("IP"); + string mac = vatt->vector_value("MAC"); string ip6 = vatt->vector_value("IP6_GLOBAL"); string nic_id = vatt->vector_value("NIC_ID"); @@ -697,6 +698,11 @@ int VirtualMachine::parse_context(string& error_str) var.str(""); val.str(""); + var << "ETH" << nic_id << "_MAC"; + context->replace(var.str(), mac); + + var.str(""); val.str(""); + var << "ETH" << nic_id << "_NETWORK"; val << "$NETWORK[NETWORK_ADDRESS, NETWORK=\"" << name << "\"]"; context->replace(var.str(), val.str()); From 149bfbaa17521c22b23eff9df544d45d0ecaee88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 11 Nov 2013 11:08:14 +0100 Subject: [PATCH 09/57] typo --- src/vm/VirtualMachine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 88dc58aabf..1d7fa7cfd7 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -1908,7 +1908,7 @@ VectorAttribute * VirtualMachine::set_up_attach_disk( { ostringstream oss; - oss << "Target " << target << "is already in use."; + oss << "Target " << target << " is already in use."; error_str = oss.str(); imagem->release_image(vm_id, image_id, false); From 9044b6491b3b201029f8a982d38404cc040c3e3f Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 11 Nov 2013 15:32:56 +0100 Subject: [PATCH 10/57] feature #2391: changed variable SEARCH to SEARCH_DOMAIN SEARCH is too generic and could be mistanken with some other ot may be used in the future for other things. --- share/scripts/context-packages/base/etc/one-context.d/01-dns | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/scripts/context-packages/base/etc/one-context.d/01-dns b/share/scripts/context-packages/base/etc/one-context.d/01-dns index fff9d9cf1a..d0336addad 100755 --- a/share/scripts/context-packages/base/etc/one-context.d/01-dns +++ b/share/scripts/context-packages/base/etc/one-context.d/01-dns @@ -18,7 +18,7 @@ export DNS_VARIABLES="DNS $(env | sed 's/=.*$//' | grep -E '^ETH[0-9]+_DNS$' | sort)" -export SEARCH_VARIABLES="SEARCH $(env | sed 's/=.*$//' | grep -E '^ETH[0-9]+_SEARCH$' | sort)" +export SEARCH_VARIABLES="SEARCH_DOMAIN $(env | sed 's/=.*$//' | grep -E '^ETH[0-9]+_SEARCH_DOMAIN$' | sort)" nameservers=$( for var in ${DNS_VARIABLES}; do @@ -49,3 +49,4 @@ done [ -z "$searchdomains" ] && exit 0 echo search $searchdomains >> /etc/resolv.conf + From 391d759cd31f18cfe778ff966ea79a6d37615b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 11 Nov 2013 15:33:36 +0100 Subject: [PATCH 11/57] Feature #2406: Make all monitoring log messages debug level --- src/im/InformationManager.cc | 2 +- src/im/InformationManagerDriver.cc | 2 +- src/image/ImageManager.cc | 2 +- src/image/ImageManagerDriver.cc | 5 +++-- src/vmm/VirtualMachineManager.cc | 2 +- src/vmm/VirtualMachineManagerDriver.cc | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/im/InformationManager.cc b/src/im/InformationManager.cc index 64b286470e..0a0b0ff0de 100644 --- a/src/im/InformationManager.cc +++ b/src/im/InformationManager.cc @@ -338,7 +338,7 @@ void InformationManager::timer_action() oss << "Monitoring host " << host->get_name() << " (" << host->get_oid() << ")"; - NebulaLog::log("InM",Log::INFO,oss); + NebulaLog::log("InM",Log::DEBUG,oss); imd = get(host->get_im_mad()); diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index cc05503951..e48dc2285a 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -219,7 +219,7 @@ void InformationManagerDriver::protocol(const string& message) const oss << "Datastore " << ds->get_name() << " (" << ds->get_oid() << ") successfully monitored."; - NebulaLog::log("ImM", Log::INFO, oss); + NebulaLog::log("ImM", Log::DEBUG, oss); dspool->update(ds); } diff --git a/src/image/ImageManager.cc b/src/image/ImageManager.cc index b77185e9f0..82da45d41a 100644 --- a/src/image/ImageManager.cc +++ b/src/image/ImageManager.cc @@ -223,7 +223,7 @@ void ImageManager::monitor_datastore(int ds_id) oss << "Monitoring datastore " << ds->get_name() << " (" << ds_id << ")"; - NebulaLog::log("InM", Log::INFO, oss); + NebulaLog::log("InM", Log::DEBUG, oss); ds->unlock(); diff --git a/src/image/ImageManagerDriver.cc b/src/image/ImageManagerDriver.cc index ace0c93a17..91e5ec0701 100644 --- a/src/image/ImageManagerDriver.cc +++ b/src/image/ImageManagerDriver.cc @@ -195,7 +195,8 @@ static int cp_action(istringstream& is, image->unlock(); - NebulaLog::log("ImM", Log::INFO, "Image copied and ready to use."); + oss << "Image (" << id << ") copied and ready to use."; + NebulaLog::log("ImM", Log::INFO, oss); return ds_id; @@ -661,7 +662,7 @@ static void monitor_action(istringstream& is, oss << "Datastore " << ds_name << " (" << id << ") successfully monitored."; - NebulaLog::log("ImM", Log::INFO, oss); + NebulaLog::log("ImM", Log::DEBUG, oss); return; } diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 6bfd98fda2..d136cd5168 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -1551,7 +1551,7 @@ void VirtualMachineManager::timer_action() os.str(""); os << "Monitoring VM " << *it << "."; - NebulaLog::log("VMM", Log::INFO, os); + NebulaLog::log("VMM", Log::DEBUG, os); vmd = get(vm->get_vmm_mad()); diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index 9e2a2c4d0d..357d52aca9 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -635,7 +635,7 @@ void VirtualMachineManagerDriver::process_poll( } oss << "VM " << vm->get_oid() << " successfully monitored: " << monitor_str; - NebulaLog::log("VMM", Log::INFO, oss); + NebulaLog::log("VMM", Log::DEBUG, oss); vm->update_info(memory, cpu, net_tx, net_rx, custom); From 113881d96b2aa3bcefc5d6372ad8f073759d67bc Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 11 Nov 2013 15:52:00 +0100 Subject: [PATCH 12/57] feature #2391: add SEARCH_DOMAIN to network context --- src/vm/VirtualMachine.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index e43667f7a1..885b3f9204 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -725,6 +725,12 @@ int VirtualMachine::parse_context(string& error_str) val << "$NETWORK[DNS, NETWORK=\"" << name << "\"]"; context->replace(var.str(), val.str()); + var.str(""); val.str(""); + + var << "ETH" << nic_id << "_SEARCH_DOMAIN"; + val << "$NETWORK[SEARCH_DOMAIN, NETWORK=\"" << name << "\"]"; + context->replace(var.str(), val.str()); + if (!ip6.empty()) { var.str(""); val.str(""); From 33f535e4f1307f9ff6fd107fef4991c091fc5494 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 11 Nov 2013 17:33:49 +0100 Subject: [PATCH 13/57] feature #2183: Add init scripts for CentOS and Debian --- share/pkgs/CentOS/opennebula-econe | 98 +++++++++++++++++++++++++++ share/pkgs/Debian/opennebula-econe | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-flow | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-gate | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-occi | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-sunstone | 94 +++++++++++++++++++++++++ 6 files changed, 568 insertions(+) create mode 100644 share/pkgs/CentOS/opennebula-econe create mode 100644 share/pkgs/Debian/opennebula-econe create mode 100644 share/pkgs/Debian/opennebula-flow create mode 100644 share/pkgs/Debian/opennebula-gate create mode 100644 share/pkgs/Debian/opennebula-occi create mode 100644 share/pkgs/Debian/opennebula-sunstone diff --git a/share/pkgs/CentOS/opennebula-econe b/share/pkgs/CentOS/opennebula-econe new file mode 100644 index 0000000000..9e907eba3c --- /dev/null +++ b/share/pkgs/CentOS/opennebula-econe @@ -0,0 +1,98 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/opennebula-econe +# +# Starts the OpenNebula ECONE Server +# +# chkconfig: 345 66 34 +# description: Starts the ECONE Server daemon +# processname: opennebula-econe + +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $local_fs $remote_fs oned +# Required-Stop: $local_fs $remote_fs oned +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop opennebula-econe +# Description: start and stop opennebula-econe +### END INIT INFO + +prog="opennebula-econe" + +SERVER_BIN=/usr/bin/econe-server +SERVER_PROGRAM=econe-server.rb +LOCKFILE=/var/lock/subsys/${prog} +PID_FILE=/var/run/${prog}.pid + +# Source function library. +. /etc/rc.d/init.d/functions + + +RETVAL=0 + +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if $SERVER_BIN is executable + test -x $SERVER_BIN || exit 5 +} + +start() { + check + + echo -n $"Starting $prog Server: " + daemon --user oneadmin $SERVER_BIN start + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && { + touch $LOCKFILE + echo $(ps -ef|grep $SERVER_PROGRAM | awk '{print $2}') > $PID_FILE + } + + return $RETVAL +} + +stop() { + + check + + echo -n $"Stopping $prog Server daemon: " + daemon --user oneadmin $SERVER_BIN stop + RETVAL=$? + + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PID_FILE + + return $RETVAL +} + +restart() { + stop + start +} + + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status $prog + RETVAL=$? + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian/opennebula-econe new file mode 100644 index 0000000000..db2bbd625a --- /dev/null +++ b/share/pkgs/Debian/opennebula-econe @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ECONE Server init script +# Description: OpenNebula ECONE service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="ECONE Service" +NAME=econe-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian/opennebula-flow new file mode 100644 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Debian/opennebula-flow @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-flow +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneFlow init script +# Description: OpenNebula OneFlow service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneFlow Service" +NAME=oneflow-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian/opennebula-gate new file mode 100644 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Debian/opennebula-gate @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-gate +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneGate init script +# Description: OpenNebula OneGate service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneGate Service" +NAME=onegate-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-occi b/share/pkgs/Debian/opennebula-occi new file mode 100644 index 0000000000..c0816c2811 --- /dev/null +++ b/share/pkgs/Debian/opennebula-occi @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-occi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OCCI Server init script +# Description: OpenNebula OCCI service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OCCI Service" +NAME=occi-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian/opennebula-sunstone new file mode 100644 index 0000000000..f7917044d3 --- /dev/null +++ b/share/pkgs/Debian/opennebula-sunstone @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-sunstone +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Sunstone init script +# Description: OpenNebula Sunstone web interface cloud initialisation script +### END INIT INFO + +# Author: Jaime Melis + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Sunstone Web interface" +NAME=sunstone-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: From 8b250c9f62fbf68beebc5581bdb3ab8d57c109a3 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 11 Nov 2013 17:33:49 +0100 Subject: [PATCH 14/57] feature #2183: Add init scripts for CentOS and Debian (cherry picked from commit 33f535e4f1307f9ff6fd107fef4991c091fc5494) --- share/pkgs/CentOS/opennebula-econe | 98 +++++++++++++++++++++++++++ share/pkgs/Debian/opennebula-econe | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-flow | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-gate | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-occi | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-sunstone | 94 +++++++++++++++++++++++++ 6 files changed, 568 insertions(+) create mode 100644 share/pkgs/CentOS/opennebula-econe create mode 100644 share/pkgs/Debian/opennebula-econe create mode 100644 share/pkgs/Debian/opennebula-flow create mode 100644 share/pkgs/Debian/opennebula-gate create mode 100644 share/pkgs/Debian/opennebula-occi create mode 100644 share/pkgs/Debian/opennebula-sunstone diff --git a/share/pkgs/CentOS/opennebula-econe b/share/pkgs/CentOS/opennebula-econe new file mode 100644 index 0000000000..9e907eba3c --- /dev/null +++ b/share/pkgs/CentOS/opennebula-econe @@ -0,0 +1,98 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/opennebula-econe +# +# Starts the OpenNebula ECONE Server +# +# chkconfig: 345 66 34 +# description: Starts the ECONE Server daemon +# processname: opennebula-econe + +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $local_fs $remote_fs oned +# Required-Stop: $local_fs $remote_fs oned +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop opennebula-econe +# Description: start and stop opennebula-econe +### END INIT INFO + +prog="opennebula-econe" + +SERVER_BIN=/usr/bin/econe-server +SERVER_PROGRAM=econe-server.rb +LOCKFILE=/var/lock/subsys/${prog} +PID_FILE=/var/run/${prog}.pid + +# Source function library. +. /etc/rc.d/init.d/functions + + +RETVAL=0 + +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if $SERVER_BIN is executable + test -x $SERVER_BIN || exit 5 +} + +start() { + check + + echo -n $"Starting $prog Server: " + daemon --user oneadmin $SERVER_BIN start + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && { + touch $LOCKFILE + echo $(ps -ef|grep $SERVER_PROGRAM | awk '{print $2}') > $PID_FILE + } + + return $RETVAL +} + +stop() { + + check + + echo -n $"Stopping $prog Server daemon: " + daemon --user oneadmin $SERVER_BIN stop + RETVAL=$? + + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PID_FILE + + return $RETVAL +} + +restart() { + stop + start +} + + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status $prog + RETVAL=$? + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian/opennebula-econe new file mode 100644 index 0000000000..db2bbd625a --- /dev/null +++ b/share/pkgs/Debian/opennebula-econe @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ECONE Server init script +# Description: OpenNebula ECONE service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="ECONE Service" +NAME=econe-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian/opennebula-flow new file mode 100644 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Debian/opennebula-flow @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-flow +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneFlow init script +# Description: OpenNebula OneFlow service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneFlow Service" +NAME=oneflow-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian/opennebula-gate new file mode 100644 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Debian/opennebula-gate @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-gate +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneGate init script +# Description: OpenNebula OneGate service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneGate Service" +NAME=onegate-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-occi b/share/pkgs/Debian/opennebula-occi new file mode 100644 index 0000000000..c0816c2811 --- /dev/null +++ b/share/pkgs/Debian/opennebula-occi @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-occi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OCCI Server init script +# Description: OpenNebula OCCI service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OCCI Service" +NAME=occi-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian/opennebula-sunstone new file mode 100644 index 0000000000..f7917044d3 --- /dev/null +++ b/share/pkgs/Debian/opennebula-sunstone @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-sunstone +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Sunstone init script +# Description: OpenNebula Sunstone web interface cloud initialisation script +### END INIT INFO + +# Author: Jaime Melis + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Sunstone Web interface" +NAME=sunstone-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: From 8cf0f56b8f1411e5fe56f9e6c5066c42a4753bd2 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 11 Nov 2013 17:43:57 +0100 Subject: [PATCH 15/57] feature #2446: rename shared_lvm to fs_lvm --- install.sh | 22 +++++++++---------- share/etc/oned.conf | 4 ++-- .../public/js/plugins/datastores-tab.js | 4 ++-- src/tm_mad/{shared_lvm => fs_lvm}/clone | 0 src/tm_mad/{shared_lvm => fs_lvm}/cpds | 0 src/tm_mad/{shared_lvm => fs_lvm}/delete | 0 src/tm_mad/{shared_lvm => fs_lvm}/ln | 0 src/tm_mad/{shared_lvm => fs_lvm}/mv | 0 src/tm_mad/{shared_lvm => fs_lvm}/mvds | 0 src/tm_mad/{shared_lvm => fs_lvm}/postmigrate | 0 src/tm_mad/{shared_lvm => fs_lvm}/premigrate | 0 11 files changed, 15 insertions(+), 15 deletions(-) rename src/tm_mad/{shared_lvm => fs_lvm}/clone (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/cpds (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/delete (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/ln (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/mv (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/mvds (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/postmigrate (100%) rename src/tm_mad/{shared_lvm => fs_lvm}/premigrate (100%) diff --git a/install.sh b/install.sh index bc5d6a6505..b07d10f9c1 100755 --- a/install.sh +++ b/install.sh @@ -284,7 +284,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/tm/ \ $VAR_LOCATION/remotes/tm/dummy \ $VAR_LOCATION/remotes/tm/shared \ - $VAR_LOCATION/remotes/tm/shared_lvm \ + $VAR_LOCATION/remotes/tm/fs_lvm \ $VAR_LOCATION/remotes/tm/qcow2 \ $VAR_LOCATION/remotes/tm/ssh \ $VAR_LOCATION/remotes/tm/vmfs \ @@ -470,7 +470,7 @@ INSTALL_FILES=( VMM_EXEC_EC2_SCRIPTS:$VAR_LOCATION/remotes/vmm/ec2 TM_FILES:$VAR_LOCATION/remotes/tm TM_SHARED_FILES:$VAR_LOCATION/remotes/tm/shared - TM_SHARED_LVM_FILES:$VAR_LOCATION/remotes/tm/shared_lvm + TM_FS_LVM_FILES:$VAR_LOCATION/remotes/tm/fs_lvm TM_QCOW2_FILES:$VAR_LOCATION/remotes/tm/qcow2 TM_SSH_FILES:$VAR_LOCATION/remotes/tm/ssh TM_VMFS_FILES:$VAR_LOCATION/remotes/tm/vmfs @@ -979,7 +979,7 @@ NETWORK_VMWARE_FILES="src/vnm_mad/remotes/vmware/clean \ #------------------------------------------------------------------------------- # Transfer Manager commands, to be installed under $LIB_LOCATION/tm_commands # - SHARED TM, $VAR_LOCATION/tm/shared -# - SHARED_LVM TM, $VAR_LOCATION/tm/shared_lvm +# - FS_LVM TM, $VAR_LOCATION/tm/fs_lvm # - QCOW2 TM, $VAR_LOCATION/tm/qcow2 # - SSH TM, $VAR_LOCATION/tm/ssh # - DUMMY TM, $VAR_LOCATION/tm/dummy @@ -1003,14 +1003,14 @@ TM_SHARED_FILES="src/tm_mad/shared/clone \ src/tm_mad/shared/mvds \ src/tm_mad/shared/cpds" -TM_SHARED_LVM_FILES="src/tm_mad/shared_lvm/clone \ - src/tm_mad/shared_lvm/ln \ - src/tm_mad/shared_lvm/mv \ - src/tm_mad/shared_lvm/mvds \ - src/tm_mad/shared_lvm/cpds \ - src/tm_mad/shared_lvm/premigrate \ - src/tm_mad/shared_lvm/postmigrate \ - src/tm_mad/shared_lvm/delete" +TM_FS_LVM_FILES="src/tm_mad/fs_lvm/clone \ + src/tm_mad/fs_lvm/ln \ + src/tm_mad/fs_lvm/mv \ + src/tm_mad/fs_lvm/mvds \ + src/tm_mad/fs_lvm/cpds \ + src/tm_mad/fs_lvm/premigrate \ + src/tm_mad/fs_lvm/postmigrate \ + src/tm_mad/fs_lvm/delete" TM_QCOW2_FILES="src/tm_mad/qcow2/clone \ src/tm_mad/qcow2/delete \ diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 905cc589f2..39d87509c0 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -390,7 +390,7 @@ VM_MAD = [ TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,iscsi,ceph" + arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,iscsi,ceph" ] TM_MAD_CONF = [ @@ -415,7 +415,7 @@ TM_MAD_CONF = [ ] TM_MAD_CONF = [ - name = "shared_lvm", + name = "fs_lvm", ln_target = "SYSTEM", clone_target= "SYSTEM", shared = "yes" diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 55771177c6..39e4245e61 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -194,7 +194,7 @@ var create_datastore_tmpl = \ \ \ - \ + \ \ \ \ @@ -1144,7 +1144,7 @@ function select_block_lvm(){ function select_fs_lvm(){ $('select#ds_mad').val('fs'); $('select#ds_mad').attr('disabled', 'disabled'); - $('select#tm_mad').val('shared_lvm'); + $('select#tm_mad').val('fs_lvm'); $('select#tm_mad').attr('disabled', 'disabled'); $('input#image_ds_type').attr('checked', 'true'); $('input[name=ds_type]').attr('disabled', 'disabled'); diff --git a/src/tm_mad/shared_lvm/clone b/src/tm_mad/fs_lvm/clone similarity index 100% rename from src/tm_mad/shared_lvm/clone rename to src/tm_mad/fs_lvm/clone diff --git a/src/tm_mad/shared_lvm/cpds b/src/tm_mad/fs_lvm/cpds similarity index 100% rename from src/tm_mad/shared_lvm/cpds rename to src/tm_mad/fs_lvm/cpds diff --git a/src/tm_mad/shared_lvm/delete b/src/tm_mad/fs_lvm/delete similarity index 100% rename from src/tm_mad/shared_lvm/delete rename to src/tm_mad/fs_lvm/delete diff --git a/src/tm_mad/shared_lvm/ln b/src/tm_mad/fs_lvm/ln similarity index 100% rename from src/tm_mad/shared_lvm/ln rename to src/tm_mad/fs_lvm/ln diff --git a/src/tm_mad/shared_lvm/mv b/src/tm_mad/fs_lvm/mv similarity index 100% rename from src/tm_mad/shared_lvm/mv rename to src/tm_mad/fs_lvm/mv diff --git a/src/tm_mad/shared_lvm/mvds b/src/tm_mad/fs_lvm/mvds similarity index 100% rename from src/tm_mad/shared_lvm/mvds rename to src/tm_mad/fs_lvm/mvds diff --git a/src/tm_mad/shared_lvm/postmigrate b/src/tm_mad/fs_lvm/postmigrate similarity index 100% rename from src/tm_mad/shared_lvm/postmigrate rename to src/tm_mad/fs_lvm/postmigrate diff --git a/src/tm_mad/shared_lvm/premigrate b/src/tm_mad/fs_lvm/premigrate similarity index 100% rename from src/tm_mad/shared_lvm/premigrate rename to src/tm_mad/fs_lvm/premigrate From 1618ffa4e5ab6d40984daaa4dc8604507397583d Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 11 Nov 2013 18:05:11 +0100 Subject: [PATCH 16/57] feature #2183: Add init scripts for Ubuntu --- share/pkgs/CentOS/opennebula-econe | 0 share/pkgs/CentOS/opennebula-ozones | 98 +++++++++++++++++++++++++++ share/pkgs/Debian/opennebula-econe | 0 share/pkgs/Debian/opennebula-flow | 0 share/pkgs/Debian/opennebula-gate | 0 share/pkgs/Debian/opennebula-occi | 0 share/pkgs/Debian/opennebula-ozones | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-sunstone | 0 share/pkgs/Ubuntu/opennebula-econe | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-flow | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-gate | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-occi | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-ozones | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-sunstone | 94 +++++++++++++++++++++++++ 14 files changed, 756 insertions(+) mode change 100644 => 100755 share/pkgs/CentOS/opennebula-econe create mode 100755 share/pkgs/CentOS/opennebula-ozones mode change 100644 => 100755 share/pkgs/Debian/opennebula-econe mode change 100644 => 100755 share/pkgs/Debian/opennebula-flow mode change 100644 => 100755 share/pkgs/Debian/opennebula-gate mode change 100644 => 100755 share/pkgs/Debian/opennebula-occi create mode 100755 share/pkgs/Debian/opennebula-ozones mode change 100644 => 100755 share/pkgs/Debian/opennebula-sunstone create mode 100755 share/pkgs/Ubuntu/opennebula-econe create mode 100755 share/pkgs/Ubuntu/opennebula-flow create mode 100755 share/pkgs/Ubuntu/opennebula-gate create mode 100755 share/pkgs/Ubuntu/opennebula-occi create mode 100755 share/pkgs/Ubuntu/opennebula-ozones create mode 100755 share/pkgs/Ubuntu/opennebula-sunstone diff --git a/share/pkgs/CentOS/opennebula-econe b/share/pkgs/CentOS/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/CentOS/opennebula-ozones b/share/pkgs/CentOS/opennebula-ozones new file mode 100755 index 0000000000..0c616034b9 --- /dev/null +++ b/share/pkgs/CentOS/opennebula-ozones @@ -0,0 +1,98 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/opennebula-ozones +# +# Starts the OpenNebula oZones Server +# +# chkconfig: 345 66 34 +# description: Starts the oZones Server daemon +# processname: opennebula-ozones + +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $local_fs $remote_fs oned +# Required-Stop: $local_fs $remote_fs oned +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop opennebula-ozones +# Description: start and stop opennebula-ozones +### END INIT INFO + +prog="opennebula-ozones" + +SERVER_BIN=/usr/bin/ozones-server +SERVER_PROGRAM=ozones-server.rb +LOCKFILE=/var/lock/subsys/${prog} +PID_FILE=/var/run/${prog}.pid + +# Source function library. +. /etc/rc.d/init.d/functions + + +RETVAL=0 + +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if $SERVER_BIN is executable + test -x $SERVER_BIN || exit 5 +} + +start() { + check + + echo -n $"Starting $prog Server: " + daemon --user oneadmin $SERVER_BIN start + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && { + touch $LOCKFILE + echo $(ps -ef|grep $SERVER_PROGRAM | awk '{print $2}') > $PID_FILE + } + + return $RETVAL +} + +stop() { + + check + + echo -n $"Stopping $prog Server daemon: " + daemon --user oneadmin $SERVER_BIN stop + RETVAL=$? + + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PID_FILE + + return $RETVAL +} + +restart() { + stop + start +} + + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status $prog + RETVAL=$? + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian/opennebula-flow old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian/opennebula-gate old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-occi b/share/pkgs/Debian/opennebula-occi old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-ozones b/share/pkgs/Debian/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Debian/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian/opennebula-sunstone old mode 100644 new mode 100755 diff --git a/share/pkgs/Ubuntu/opennebula-econe b/share/pkgs/Ubuntu/opennebula-econe new file mode 100755 index 0000000000..db2bbd625a --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-econe @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ECONE Server init script +# Description: OpenNebula ECONE service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="ECONE Service" +NAME=econe-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-flow b/share/pkgs/Ubuntu/opennebula-flow new file mode 100755 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-flow @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-flow +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneFlow init script +# Description: OpenNebula OneFlow service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneFlow Service" +NAME=oneflow-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-gate b/share/pkgs/Ubuntu/opennebula-gate new file mode 100755 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-gate @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-gate +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneGate init script +# Description: OpenNebula OneGate service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneGate Service" +NAME=onegate-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-occi b/share/pkgs/Ubuntu/opennebula-occi new file mode 100755 index 0000000000..c0816c2811 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-occi @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-occi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OCCI Server init script +# Description: OpenNebula OCCI service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OCCI Service" +NAME=occi-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-ozones b/share/pkgs/Ubuntu/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-sunstone b/share/pkgs/Ubuntu/opennebula-sunstone new file mode 100755 index 0000000000..f7917044d3 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-sunstone @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-sunstone +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Sunstone init script +# Description: OpenNebula Sunstone web interface cloud initialisation script +### END INIT INFO + +# Author: Jaime Melis + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Sunstone Web interface" +NAME=sunstone-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: From b34232d6c40aae30430105132ea934145e2a2ebb Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 11 Nov 2013 18:05:11 +0100 Subject: [PATCH 17/57] feature #2183: Add init scripts for Ubuntu (cherry picked from commit 1618ffa4e5ab6d40984daaa4dc8604507397583d) --- share/pkgs/CentOS/opennebula-econe | 0 share/pkgs/CentOS/opennebula-ozones | 98 +++++++++++++++++++++++++++ share/pkgs/Debian/opennebula-econe | 0 share/pkgs/Debian/opennebula-flow | 0 share/pkgs/Debian/opennebula-gate | 0 share/pkgs/Debian/opennebula-occi | 0 share/pkgs/Debian/opennebula-ozones | 94 +++++++++++++++++++++++++ share/pkgs/Debian/opennebula-sunstone | 0 share/pkgs/Ubuntu/opennebula-econe | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-flow | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-gate | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-occi | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-ozones | 94 +++++++++++++++++++++++++ share/pkgs/Ubuntu/opennebula-sunstone | 94 +++++++++++++++++++++++++ 14 files changed, 756 insertions(+) mode change 100644 => 100755 share/pkgs/CentOS/opennebula-econe create mode 100755 share/pkgs/CentOS/opennebula-ozones mode change 100644 => 100755 share/pkgs/Debian/opennebula-econe mode change 100644 => 100755 share/pkgs/Debian/opennebula-flow mode change 100644 => 100755 share/pkgs/Debian/opennebula-gate mode change 100644 => 100755 share/pkgs/Debian/opennebula-occi create mode 100755 share/pkgs/Debian/opennebula-ozones mode change 100644 => 100755 share/pkgs/Debian/opennebula-sunstone create mode 100755 share/pkgs/Ubuntu/opennebula-econe create mode 100755 share/pkgs/Ubuntu/opennebula-flow create mode 100755 share/pkgs/Ubuntu/opennebula-gate create mode 100755 share/pkgs/Ubuntu/opennebula-occi create mode 100755 share/pkgs/Ubuntu/opennebula-ozones create mode 100755 share/pkgs/Ubuntu/opennebula-sunstone diff --git a/share/pkgs/CentOS/opennebula-econe b/share/pkgs/CentOS/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/CentOS/opennebula-ozones b/share/pkgs/CentOS/opennebula-ozones new file mode 100755 index 0000000000..0c616034b9 --- /dev/null +++ b/share/pkgs/CentOS/opennebula-ozones @@ -0,0 +1,98 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/opennebula-ozones +# +# Starts the OpenNebula oZones Server +# +# chkconfig: 345 66 34 +# description: Starts the oZones Server daemon +# processname: opennebula-ozones + +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $local_fs $remote_fs oned +# Required-Stop: $local_fs $remote_fs oned +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop opennebula-ozones +# Description: start and stop opennebula-ozones +### END INIT INFO + +prog="opennebula-ozones" + +SERVER_BIN=/usr/bin/ozones-server +SERVER_PROGRAM=ozones-server.rb +LOCKFILE=/var/lock/subsys/${prog} +PID_FILE=/var/run/${prog}.pid + +# Source function library. +. /etc/rc.d/init.d/functions + + +RETVAL=0 + +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if $SERVER_BIN is executable + test -x $SERVER_BIN || exit 5 +} + +start() { + check + + echo -n $"Starting $prog Server: " + daemon --user oneadmin $SERVER_BIN start + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && { + touch $LOCKFILE + echo $(ps -ef|grep $SERVER_PROGRAM | awk '{print $2}') > $PID_FILE + } + + return $RETVAL +} + +stop() { + + check + + echo -n $"Stopping $prog Server daemon: " + daemon --user oneadmin $SERVER_BIN stop + RETVAL=$? + + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PID_FILE + + return $RETVAL +} + +restart() { + stop + start +} + + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status $prog + RETVAL=$? + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian/opennebula-flow old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian/opennebula-gate old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-occi b/share/pkgs/Debian/opennebula-occi old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-ozones b/share/pkgs/Debian/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Debian/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian/opennebula-sunstone old mode 100644 new mode 100755 diff --git a/share/pkgs/Ubuntu/opennebula-econe b/share/pkgs/Ubuntu/opennebula-econe new file mode 100755 index 0000000000..db2bbd625a --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-econe @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ECONE Server init script +# Description: OpenNebula ECONE service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="ECONE Service" +NAME=econe-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-flow b/share/pkgs/Ubuntu/opennebula-flow new file mode 100755 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-flow @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-flow +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneFlow init script +# Description: OpenNebula OneFlow service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneFlow Service" +NAME=oneflow-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-gate b/share/pkgs/Ubuntu/opennebula-gate new file mode 100755 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-gate @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-gate +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneGate init script +# Description: OpenNebula OneGate service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneGate Service" +NAME=onegate-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-occi b/share/pkgs/Ubuntu/opennebula-occi new file mode 100755 index 0000000000..c0816c2811 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-occi @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-occi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OCCI Server init script +# Description: OpenNebula OCCI service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OCCI Service" +NAME=occi-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-ozones b/share/pkgs/Ubuntu/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-sunstone b/share/pkgs/Ubuntu/opennebula-sunstone new file mode 100755 index 0000000000..f7917044d3 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-sunstone @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-sunstone +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Sunstone init script +# Description: OpenNebula Sunstone web interface cloud initialisation script +### END INIT INFO + +# Author: Jaime Melis + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Sunstone Web interface" +NAME=sunstone-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: From 514ffed512dd3602b4ff5f61eb395c45df6a4cfe Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 11 Nov 2013 18:21:10 +0100 Subject: [PATCH 18/57] Bug #2172: NIC Hot Plug with OpenVSwitch not working --- src/mad/sh/scripts_common.sh | 27 +++++++++++++++++++ src/vmm_mad/exec/one_vmm_exec.rb | 9 ++++++- src/vmm_mad/remotes/kvm/attach_nic | 38 +++++++++++++++++++++------ src/vmm_mad/remotes/vmware/attach_nic | 2 +- 4 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index e194ae532d..730743340a 100644 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -148,6 +148,33 @@ function exec_and_log fi } +# Executes a command, if it fails returns error message and exits. Similar to +# exec_and_log, except that it allows multiline commands. +# If a second parameter is present it is used as the error message when +# the command fails. +function multiline_exec_and_log +{ + message=$2 + + EXEC_LOG_ERR=`bash -s 2>&1 1>/dev/null < :vmm, :action => :attach_nic, - :parameters => [:deploy_id, mac, source, model] + :parameters => [:deploy_id, mac, source, model, net_drv] }, # Execute post-boot networking setup { diff --git a/src/vmm_mad/remotes/kvm/attach_nic b/src/vmm_mad/remotes/kvm/attach_nic index 7c4e539d9d..d37ef7b05e 100755 --- a/src/vmm_mad/remotes/kvm/attach_nic +++ b/src/vmm_mad/remotes/kvm/attach_nic @@ -21,14 +21,36 @@ source $(dirname $0)/../../scripts_common.sh DOMAIN=$1 MAC=$2 -SOURCE=$3 -MODEL=$4 +BRIDGE=$3 +THE_MODEL=$4 +NET_DRV=$5 -ATTACH_ARGS="--domain $DOMAIN --type bridge --source $SOURCE --mac $MAC" - -if [ "$MODEL" != "-" ]; then - ATTACH_ARGS="$ATTACH_ARGS --model $MODEL" +if [ "$THE_MODEL" != "-" ]; then + MODEL="" fi -exec_and_log "virsh --connect $LIBVIRT_URI attach-interface $ATTACH_ARGS" \ - "Could not attach NIC ($MAC) to $DOMAIN" +if [ "$NET_DRV" = "ovswitch" ]; then + VIRTUALPORT="" +fi + +DEVICE=$(cat < + + + $MODEL + $VIRTUALPORT + +EOF +) + +ATTACH_CMD=$(cat < Date: Mon, 11 Nov 2013 18:41:39 +0100 Subject: [PATCH 19/57] feature #2183: Add init scripts for openSUSE --- share/pkgs/openSUSE/systemd/econe.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/occi.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/oneflow.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/onegate.service | 20 ++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 share/pkgs/openSUSE/systemd/econe.service create mode 100644 share/pkgs/openSUSE/systemd/occi.service create mode 100644 share/pkgs/openSUSE/systemd/oneflow.service create mode 100644 share/pkgs/openSUSE/systemd/onegate.service diff --git a/share/pkgs/openSUSE/systemd/econe.service b/share/pkgs/openSUSE/systemd/econe.service new file mode 100644 index 0000000000..cd739bca66 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/econe.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula EC2 Interface Service +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.econe.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/econe-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.econe.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/econe.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/occi.service b/share/pkgs/openSUSE/systemd/occi.service new file mode 100644 index 0000000000..a3d4931190 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/occi.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula OCCI Interface Service +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.occiserver.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/occi-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.occiserver.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/occiserver.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/oneflow.service b/share/pkgs/openSUSE/systemd/oneflow.service new file mode 100644 index 0000000000..619ed4b16b --- /dev/null +++ b/share/pkgs/openSUSE/systemd/oneflow.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula Flow Service for multi tier applications +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.oneflow.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/oneflow-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.oneflow.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/oneflow.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/onegate.service b/share/pkgs/openSUSE/systemd/onegate.service new file mode 100644 index 0000000000..eebea7c256 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/onegate.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula Gate Service for Service monitoring +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.onegate.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/onegate-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.onegate.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/onegate.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target From a601da0f6bc3544e189331bef8b090516ded82ed Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 11 Nov 2013 18:41:39 +0100 Subject: [PATCH 20/57] feature #2183: Add init scripts for openSUSE (cherry picked from commit bb4e4b568ae424c363fcc635531a6da709b7f8b6) --- share/pkgs/openSUSE/systemd/econe.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/occi.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/oneflow.service | 20 ++++++++++++++++++++ share/pkgs/openSUSE/systemd/onegate.service | 20 ++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 share/pkgs/openSUSE/systemd/econe.service create mode 100644 share/pkgs/openSUSE/systemd/occi.service create mode 100644 share/pkgs/openSUSE/systemd/oneflow.service create mode 100644 share/pkgs/openSUSE/systemd/onegate.service diff --git a/share/pkgs/openSUSE/systemd/econe.service b/share/pkgs/openSUSE/systemd/econe.service new file mode 100644 index 0000000000..cd739bca66 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/econe.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula EC2 Interface Service +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.econe.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/econe-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.econe.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/econe.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/occi.service b/share/pkgs/openSUSE/systemd/occi.service new file mode 100644 index 0000000000..a3d4931190 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/occi.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula OCCI Interface Service +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.occiserver.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/occi-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.occiserver.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/occiserver.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/oneflow.service b/share/pkgs/openSUSE/systemd/oneflow.service new file mode 100644 index 0000000000..619ed4b16b --- /dev/null +++ b/share/pkgs/openSUSE/systemd/oneflow.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula Flow Service for multi tier applications +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.oneflow.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/oneflow-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.oneflow.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/oneflow.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target diff --git a/share/pkgs/openSUSE/systemd/onegate.service b/share/pkgs/openSUSE/systemd/onegate.service new file mode 100644 index 0000000000..eebea7c256 --- /dev/null +++ b/share/pkgs/openSUSE/systemd/onegate.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenNebula Gate Service for Service monitoring +After=syslog.target +After=network.target +After=one.service +After=one_scheduler.service +BindTo=one.service +!ConditionFileExists=/var/lock/one/.onegate.lock + +[Service] +ExecStart=/bin/bash -c "/usr/bin/onegate-server start" +ExecStartPost=/usr/bin/touch /var/lock/one/.onegate.lock +ExecStop=/bin/kill -INT $MAINPID +PIDFile=/var/run/one/onegate.pid +Type=simple +Group=cloud +User=oneadmin + +[Install] +WantedBy=multi-user.target From 5827326f265498a582274a2e1bee2e71caa7f80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 11 Nov 2013 10:59:12 +0100 Subject: [PATCH 21/57] Feature #2413: Add ETHX_MAC context attribute for CONTEXT/NETWORK=YES (cherry picked from commit 7f4bfee4cce1571acb8bea5f04d242a58da7d246) --- src/vm/VirtualMachine.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index e43667f7a1..1d7fa7cfd7 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -686,6 +686,7 @@ int VirtualMachine::parse_context(string& error_str) string name = vatt->vector_value("NETWORK"); string ip = vatt->vector_value("IP"); + string mac = vatt->vector_value("MAC"); string ip6 = vatt->vector_value("IP6_GLOBAL"); string nic_id = vatt->vector_value("NIC_ID"); @@ -697,6 +698,11 @@ int VirtualMachine::parse_context(string& error_str) var.str(""); val.str(""); + var << "ETH" << nic_id << "_MAC"; + context->replace(var.str(), mac); + + var.str(""); val.str(""); + var << "ETH" << nic_id << "_NETWORK"; val << "$NETWORK[NETWORK_ADDRESS, NETWORK=\"" << name << "\"]"; context->replace(var.str(), val.str()); From e479cc550a6540b13cb47d34dc7f2ef87890e9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 11 Nov 2013 15:33:36 +0100 Subject: [PATCH 22/57] Feature #2406: Make all monitoring log messages debug level (cherry picked from commit 391d759cd31f18cfe778ff966ea79a6d37615b99) --- src/im/InformationManager.cc | 2 +- src/im/InformationManagerDriver.cc | 2 +- src/image/ImageManager.cc | 2 +- src/image/ImageManagerDriver.cc | 5 +++-- src/vmm/VirtualMachineManager.cc | 2 +- src/vmm/VirtualMachineManagerDriver.cc | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/im/InformationManager.cc b/src/im/InformationManager.cc index 64b286470e..0a0b0ff0de 100644 --- a/src/im/InformationManager.cc +++ b/src/im/InformationManager.cc @@ -338,7 +338,7 @@ void InformationManager::timer_action() oss << "Monitoring host " << host->get_name() << " (" << host->get_oid() << ")"; - NebulaLog::log("InM",Log::INFO,oss); + NebulaLog::log("InM",Log::DEBUG,oss); imd = get(host->get_im_mad()); diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index cc05503951..e48dc2285a 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -219,7 +219,7 @@ void InformationManagerDriver::protocol(const string& message) const oss << "Datastore " << ds->get_name() << " (" << ds->get_oid() << ") successfully monitored."; - NebulaLog::log("ImM", Log::INFO, oss); + NebulaLog::log("ImM", Log::DEBUG, oss); dspool->update(ds); } diff --git a/src/image/ImageManager.cc b/src/image/ImageManager.cc index b77185e9f0..82da45d41a 100644 --- a/src/image/ImageManager.cc +++ b/src/image/ImageManager.cc @@ -223,7 +223,7 @@ void ImageManager::monitor_datastore(int ds_id) oss << "Monitoring datastore " << ds->get_name() << " (" << ds_id << ")"; - NebulaLog::log("InM", Log::INFO, oss); + NebulaLog::log("InM", Log::DEBUG, oss); ds->unlock(); diff --git a/src/image/ImageManagerDriver.cc b/src/image/ImageManagerDriver.cc index ace0c93a17..91e5ec0701 100644 --- a/src/image/ImageManagerDriver.cc +++ b/src/image/ImageManagerDriver.cc @@ -195,7 +195,8 @@ static int cp_action(istringstream& is, image->unlock(); - NebulaLog::log("ImM", Log::INFO, "Image copied and ready to use."); + oss << "Image (" << id << ") copied and ready to use."; + NebulaLog::log("ImM", Log::INFO, oss); return ds_id; @@ -661,7 +662,7 @@ static void monitor_action(istringstream& is, oss << "Datastore " << ds_name << " (" << id << ") successfully monitored."; - NebulaLog::log("ImM", Log::INFO, oss); + NebulaLog::log("ImM", Log::DEBUG, oss); return; } diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 6bfd98fda2..d136cd5168 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -1551,7 +1551,7 @@ void VirtualMachineManager::timer_action() os.str(""); os << "Monitoring VM " << *it << "."; - NebulaLog::log("VMM", Log::INFO, os); + NebulaLog::log("VMM", Log::DEBUG, os); vmd = get(vm->get_vmm_mad()); diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index 9e2a2c4d0d..357d52aca9 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -635,7 +635,7 @@ void VirtualMachineManagerDriver::process_poll( } oss << "VM " << vm->get_oid() << " successfully monitored: " << monitor_str; - NebulaLog::log("VMM", Log::INFO, oss); + NebulaLog::log("VMM", Log::DEBUG, oss); vm->update_info(memory, cpu, net_tx, net_rx, custom); From 59f9e09aac019c44bfa1a1d4da637b7a819cf4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 12 Nov 2013 13:57:21 +0100 Subject: [PATCH 23/57] Bug #2285: unescape only eats one backslash --- src/template/template_syntax.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/template/template_syntax.y b/src/template/template_syntax.y index 4c234e5074..103c886cb6 100644 --- a/src/template/template_syntax.y +++ b/src/template/template_syntax.y @@ -165,9 +165,9 @@ array_val: VARIABLE EQUAL STRING string& unescape (string &str) { - size_t pos; + size_t pos = 0; - while ((pos = str.find("\\\"")) != string::npos) + while ((pos = str.find("\\\"", pos)) != string::npos) { str.replace(pos,2,"\""); } From c1d86c3c188a7678734ce8a8c03e98b600154da2 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 12 Nov 2013 14:06:45 +0100 Subject: [PATCH 24/57] Bug #2285: redo parsers --- src/template/template_syntax.cc | 826 ++++++++++++------------------- src/template/template_syntax.h | 61 ++- src/vm/vm_var_syntax.cc | 827 ++++++++++++-------------------- src/vm/vm_var_syntax.h | 65 ++- 4 files changed, 691 insertions(+), 1088 deletions(-) diff --git a/src/template/template_syntax.cc b/src/template/template_syntax.cc index 1345d65449..7d7e77fa53 100644 --- a/src/template/template_syntax.cc +++ b/src/template/template_syntax.cc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,15 +63,12 @@ #define yyparse template__parse #define yylex template__lex #define yyerror template__error -#define yylval template__lval -#define yychar template__char #define yydebug template__debug #define yynerrs template__nerrs -#define yylloc template__lloc + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "template_syntax.y" +#line 17 "template_syntax.y" /* yacc.c:339 */ #include #include @@ -122,8 +119,7 @@ extern "C" } -/* Line 371 of yacc.c */ -#line 127 "template_syntax.cc" +#line 123 "template_syntax.cc" /* yacc.c:339 */ # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -145,7 +141,7 @@ extern "C" by #include "template_syntax.hh". */ #ifndef YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED # define YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -153,75 +149,60 @@ extern "C" extern int template__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EQUAL_EMPTY = 262, - STRING = 263, - VARIABLE = 264 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EQUAL_EMPTY = 262, + STRING = 263, + VARIABLE = 264 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 74 "template_syntax.y" +#line 74 "template_syntax.y" /* yacc.c:355 */ char * val_str; void * val_attr; - -/* Line 387 of yacc.c */ -#line 185 "template_syntax.cc" -} YYSTYPE; +#line 178 "template_syntax.cc" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int template__parse (void *YYPARSE_PARAM); -#else -int template__parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus + int template__parse (mem_collector * mc, Template * tmpl, char ** error_msg); -#else -int template__parse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 225 "template_syntax.cc" +#line 206 "template_syntax.cc" /* yacc.c:358 */ #ifdef short # undef short @@ -235,11 +216,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -259,8 +237,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -297,24 +274,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif #if ! defined yyoverflow || YYERROR_VERBOSE @@ -333,8 +311,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -346,8 +323,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -363,7 +340,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -371,15 +348,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -389,8 +364,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -416,16 +391,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -444,7 +419,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -460,17 +435,19 @@ union yyalloc #define YYNNTS 5 /* YYNRULES -- Number of rules. */ #define YYNRULES 10 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 20 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 264 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -503,24 +480,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 11, 15, 21, 24, - 28 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 11, 0, -1, -1, 12, -1, 13, -1, 12, 13, - -1, 9, 3, 8, -1, 9, 3, 5, 14, 6, - -1, 9, 7, -1, 9, 3, 8, -1, 14, 4, - 9, 3, 8, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 94, 94, 95, 98, 99, 102, 112, 125, 137, @@ -540,112 +500,100 @@ static const char *const yytname[] = #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 10, 11, 11, 12, 12, 13, 13, 13, 14, - 14 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 3, 5, 2, 3, - 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 0, 3, 4, 0, 8, 1, 5, 0, - 6, 0, 0, 0, 0, 7, 9, 0, 0, 10 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 3, 4, 12 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -9 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-9))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -8, -3, 2, -8, -9, -2, -9, -9, -9, -1, -9, 6, 1, 3, 4, -9, -9, 7, 8, -9 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 0, 0, 3, 4, 0, 8, 1, 5, 0, + 6, 0, 0, 0, 0, 7, 9, 0, 0, 10 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -9, -9, -9, 9, -9 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 3, 4, 12 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 5, 1, 7, 9, 6, 14, 10, 15, 11, 13, 18, 16, 8, 17, 0, 0, 19 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-9))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 3, 9, 0, 5, 7, 4, 8, 6, 9, 3, 3, 8, 3, 9, -1, -1, 8 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 9, 11, 12, 13, 3, 7, 0, 13, 5, 8, 9, 14, 3, 4, 6, 8, 9, 3, 8 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 10, 11, 11, 12, 12, 13, 13, 13, 14, + 14 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 5, 2, 3, + 5 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -662,13 +610,13 @@ do \ else \ { \ yyerror (&yylloc, mc, tmpl, error_msg, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -678,7 +626,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -692,12 +640,27 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ @@ -708,35 +671,27 @@ while (YYID (0)) /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ __attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static unsigned yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -#else -static unsigned -yy_location_print_ (yyo, yylocp) - FILE *yyo; - YYLTYPE const * const yylocp; -#endif { unsigned res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } @@ -750,73 +705,36 @@ yy_location_print_ (yyo, yylocp) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, mc) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, mc, tmpl, error_msg); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, mc, tmpl, error_msg); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); - if (!yyvaluep) - return; YYUSE (yylocationp); YYUSE (mc); YYUSE (tmpl); YYUSE (error_msg); + if (!yyvaluep) + return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif YYUSE (yytype); } @@ -826,26 +744,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_ | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -858,16 +761,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -878,53 +773,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, mc, tmpl, error_msg) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, Template * tmpl, char ** error_msg) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, tmpl, error_msg); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, tmpl, error_msg); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, mc, tmpl, error_msg); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, mc, tmpl, error_msg); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -938,7 +822,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -961,15 +845,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -985,16 +862,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1024,27 +893,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1079,10 +948,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1199,34 +1064,21 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (mc); YYUSE (tmpl); YYUSE (error_msg); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1236,68 +1088,27 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (mem_collector * mc, Template * tmpl, char ** error_msg) -#else -int -yyparse (mc, tmpl, error_msg) - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif -#endif { /* The lookahead symbol. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - -/* Location data for the lookahead symbol. */ YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ int yynerrs; @@ -1306,9 +1117,9 @@ YYLTYPE yylloc = yyloc_default; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1387,26 +1198,26 @@ YYLTYPE yylloc = yyloc_default; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1414,23 +1225,23 @@ YYLTYPE yylloc = yyloc_default; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1440,10 +1251,10 @@ YYLTYPE yylloc = yyloc_default; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1472,7 +1283,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc, mc); } if (yychar <= YYEOF) @@ -1537,7 +1348,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1552,57 +1363,56 @@ yyreduce: switch (yyn) { case 6: -/* Line 1787 of yacc.c */ -#line 103 "template_syntax.y" +#line 103 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (3)].val_str)); - string value((yyvsp[(3) - (3)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); pattr = new SingleAttribute(name,unescape(value)); tmpl->set(pattr); } +#line 1377 "template_syntax.cc" /* yacc.c:1646 */ break; case 7: -/* Line 1787 of yacc.c */ -#line 113 "template_syntax.y" +#line 113 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (5)].val_str)); + string name((yyvsp[-4].val_str)); map * amap; - amap = static_cast *>((yyvsp[(4) - (5)].val_attr)); + amap = static_cast *>((yyvsp[-1].val_attr)); pattr = new VectorAttribute(name,*amap); tmpl->set(pattr); delete amap; } +#line 1394 "template_syntax.cc" /* yacc.c:1646 */ break; case 8: -/* Line 1787 of yacc.c */ -#line 126 "template_syntax.y" +#line 126 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (2)].val_str)); + string name((yyvsp[-1].val_str)); string value(""); pattr = new SingleAttribute(name,value); tmpl->set(pattr); } +#line 1408 "template_syntax.cc" /* yacc.c:1646 */ break; case 9: -/* Line 1787 of yacc.c */ -#line 138 "template_syntax.y" +#line 138 "template_syntax.y" /* yacc.c:1646 */ { map* vattr; - string name((yyvsp[(1) - (3)].val_str)); - string value((yyvsp[(3) - (3)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); TEMPLATE_TO_UPPER(name); @@ -1611,28 +1421,28 @@ yyreduce: (yyval.val_attr) = static_cast(vattr); } +#line 1425 "template_syntax.cc" /* yacc.c:1646 */ break; case 10: -/* Line 1787 of yacc.c */ -#line 151 "template_syntax.y" +#line 151 "template_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(3) - (5)].val_str)); - string value((yyvsp[(5) - (5)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); map * attrmap; TEMPLATE_TO_UPPER(name); - attrmap = static_cast *>((yyvsp[(1) - (5)].val_attr)); + attrmap = static_cast *>((yyvsp[-4].val_attr)); attrmap->insert(make_pair(name,unescape(value))); - (yyval.val_attr) = (yyvsp[(1) - (5)].val_attr); + (yyval.val_attr) = (yyvsp[-4].val_attr); } +#line 1442 "template_syntax.cc" /* yacc.c:1646 */ break; -/* Line 1787 of yacc.c */ -#line 1636 "template_syntax.cc" +#line 1446 "template_syntax.cc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1655,7 +1465,7 @@ yyreduce: *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1670,9 +1480,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -1723,20 +1533,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, mc, tmpl, error_msg); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, mc, tmpl, error_msg); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -1756,7 +1566,7 @@ yyerrorlab: goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -1769,29 +1579,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, mc, tmpl, error_msg); + yystos[yystate], yyvsp, yylsp, mc, tmpl, error_msg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1847,14 +1657,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, mc, tmpl, error_msg); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, mc, tmpl, error_msg); + yystos[*yyssp], yyvsp, yylsp, mc, tmpl, error_msg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1865,20 +1675,16 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2050 of yacc.c */ -#line 164 "template_syntax.y" +#line 164 "template_syntax.y" /* yacc.c:1906 */ string& unescape (string &str) { - size_t pos; + size_t pos = 0; - while ((pos = str.find("\\\"")) != string::npos) + while ((pos = str.find("\\\"", pos)) != string::npos) { str.replace(pos,2,"\""); } diff --git a/src/template/template_syntax.h b/src/template/template_syntax.h index 55ed0e45da..28cce191b6 100644 --- a/src/template/template_syntax.h +++ b/src/template/template_syntax.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED # define YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,50 +40,47 @@ extern int template__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EQUAL_EMPTY = 262, - STRING = 263, - VARIABLE = 264 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EQUAL_EMPTY = 262, + STRING = 263, + VARIABLE = 264 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 2053 of yacc.c */ -#line 74 "template_syntax.y" +#line 74 "template_syntax.y" /* yacc.c:1909 */ char * val_str; void * val_attr; - -/* Line 2053 of yacc.c */ -#line 72 "template_syntax.hh" -} YYSTYPE; +#line 69 "template_syntax.hh" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif diff --git a/src/vm/vm_var_syntax.cc b/src/vm/vm_var_syntax.cc index 3579984451..9c26901060 100644 --- a/src/vm/vm_var_syntax.cc +++ b/src/vm/vm_var_syntax.cc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,15 +63,12 @@ #define yyparse vm_var__parse #define yylex vm_var__lex #define yyerror vm_var__error -#define yylval vm_var__lval -#define yychar vm_var__char #define yydebug vm_var__debug #define yynerrs vm_var__nerrs -#define yylloc vm_var__lloc + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "vm_var_syntax.y" +#line 17 "vm_var_syntax.y" /* yacc.c:339 */ #include #include @@ -474,8 +471,7 @@ void insert_vector(VirtualMachine * vm, /* -------------------------------------------------------------------------- */ -/* Line 371 of yacc.c */ -#line 479 "vm_var_syntax.cc" +#line 475 "vm_var_syntax.cc" /* yacc.c:339 */ # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -497,7 +493,7 @@ void insert_vector(VirtualMachine * vm, by #include "vm_var_syntax.hh". */ #ifndef YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED # define YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -505,78 +501,63 @@ void insert_vector(VirtualMachine * vm, extern int vm_var__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EOA = 262, - STRING = 263, - VARIABLE = 264, - RSTRING = 265, - INTEGER = 266 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EOA = 262, + STRING = 263, + VARIABLE = 264, + RSTRING = 265, + INTEGER = 266 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 427 "vm_var_syntax.y" +#line 427 "vm_var_syntax.y" /* yacc.c:355 */ char * val_str; int val_int; char val_char; - -/* Line 387 of yacc.c */ -#line 540 "vm_var_syntax.cc" -} YYSTYPE; +#line 533 "vm_var_syntax.cc" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int vm_var__parse (void *YYPARSE_PARAM); -#else -int vm_var__parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus + int vm_var__parse (mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg); -#else -int vm_var__parse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 580 "vm_var_syntax.cc" +#line 561 "vm_var_syntax.cc" /* yacc.c:358 */ #ifdef short # undef short @@ -590,11 +571,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -614,8 +592,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -652,24 +629,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif #if ! defined yyoverflow || YYERROR_VERBOSE @@ -688,8 +666,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -701,8 +678,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -718,7 +695,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -726,15 +703,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -744,8 +719,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -771,16 +746,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -799,7 +774,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -815,17 +790,19 @@ union yyalloc #define YYNNTS 3 /* YYNRULES -- Number of rules. */ #define YYNRULES 7 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 18 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 266 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -858,22 +835,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 8, 10, 13, 19 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 13, 0, -1, 14, -1, 13, 14, -1, 10, -1, - 9, 7, -1, 9, 5, 9, 6, 7, -1, 9, - 5, 9, 4, 9, 3, 8, 6, 7, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 451, 451, 452, 455, 459, 472, 487 @@ -892,8 +854,8 @@ static const char *const yytname[] = #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -901,102 +863,90 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 12, 13, 13, 14, 14, 14, 14 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 2, 1, 2, 5, 9 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 4, 0, 2, 0, 5, 1, 3, 0, - 0, 0, 0, 6, 0, 0, 0, 7 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 3, 4 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -5 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-5))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -3, -4, -5, 0, -5, -1, -5, -5, -5, -2, 2, 5, 10, -5, 6, 9, 11, -5 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 4, 0, 2, 0, 5, 1, 3, 0, + 0, 0, 0, 6, 0, 0, 0, 7 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -5, -5, 13 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 3, 4 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 7, 5, 10, 6, 11, 0, 1, 2, 9, 1, 2, 12, 13, 14, 15, 16, 8, 0, 17 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-5))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 0, 5, 4, 7, 6, -1, 9, 10, 9, 9, 10, 9, 7, 3, 8, 6, 3, -1, 7 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 9, 10, 13, 14, 5, 7, 0, 14, 9, 4, 6, 9, 7, 3, 8, 6, 7 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 12, 13, 13, 14, 14, 14, 14 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 2, 1, 2, 5, 9 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1013,13 +963,13 @@ do \ else \ { \ yyerror (&yylloc, mc, vm, parsed, errmsg, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -1029,7 +979,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -1043,12 +993,27 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ @@ -1059,35 +1024,27 @@ while (YYID (0)) /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ __attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static unsigned yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -#else -static unsigned -yy_location_print_ (yyo, yylocp) - FILE *yyo; - YYLTYPE const * const yylocp; -#endif { unsigned res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } @@ -1101,75 +1058,37 @@ yy_location_print_ (yyo, yylocp) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, mc) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, mc, vm, parsed, errmsg); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, mc, vm, parsed, errmsg); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); - if (!yyvaluep) - return; YYUSE (yylocationp); YYUSE (mc); YYUSE (vm); YYUSE (parsed); YYUSE (errmsg); + if (!yyvaluep) + return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif YYUSE (yytype); } @@ -1179,27 +1098,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -1212,16 +1115,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1232,54 +1127,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, mc, vm, parsed, errmsg) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, vm, parsed, errmsg); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, vm, parsed, errmsg); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, mc, vm, parsed, errmsg); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, mc, vm, parsed, errmsg); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1293,7 +1176,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1316,15 +1199,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1340,16 +1216,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1379,27 +1247,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1434,10 +1302,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1554,23 +1418,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); @@ -1578,12 +1427,13 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) YYUSE (vm); YYUSE (parsed); YYUSE (errmsg); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1593,69 +1443,27 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -int -yyparse (mc, vm, parsed, errmsg) - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif -#endif { /* The lookahead symbol. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - -/* Location data for the lookahead symbol. */ YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ int yynerrs; @@ -1664,9 +1472,9 @@ YYLTYPE yylloc = yyloc_default; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1745,26 +1553,26 @@ YYLTYPE yylloc = yyloc_default; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1772,23 +1580,23 @@ YYLTYPE yylloc = yyloc_default; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1798,10 +1606,10 @@ YYLTYPE yylloc = yyloc_default; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1830,7 +1638,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc, mc); } if (yychar <= YYEOF) @@ -1895,7 +1703,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1910,57 +1718,56 @@ yyreduce: switch (yyn) { case 4: -/* Line 1787 of yacc.c */ -#line 456 "vm_var_syntax.y" +#line 456 "vm_var_syntax.y" /* yacc.c:1646 */ { - (*parsed) << (yyvsp[(1) - (1)].val_str); + (*parsed) << (yyvsp[0].val_str); } +#line 1726 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 5: -/* Line 1787 of yacc.c */ -#line 460 "vm_var_syntax.y" +#line 460 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (2)].val_str)); + string name((yyvsp[-1].val_str)); VM_VAR_TO_UPPER(name); insert_single(vm,*parsed,name); - if ( (yyvsp[(2) - (2)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(2) - (2)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1743 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 6: -/* Line 1787 of yacc.c */ -#line 473 "vm_var_syntax.y" +#line 473 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (5)].val_str)); - string vname((yyvsp[(3) - (5)].val_str)); + string name((yyvsp[-4].val_str)); + string vname((yyvsp[-2].val_str)); VM_VAR_TO_UPPER(name); VM_VAR_TO_UPPER(vname); insert_vector(vm,*parsed,name,vname,"",""); - if ( (yyvsp[(5) - (5)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(5) - (5)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1762 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 7: -/* Line 1787 of yacc.c */ -#line 488 "vm_var_syntax.y" +#line 488 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (9)].val_str)); - string vname((yyvsp[(3) - (9)].val_str)); - string vvar((yyvsp[(5) - (9)].val_str)); - string vval((yyvsp[(7) - (9)].val_str)); + string name((yyvsp[-8].val_str)); + string vname((yyvsp[-6].val_str)); + string vvar((yyvsp[-4].val_str)); + string vval((yyvsp[-2].val_str)); VM_VAR_TO_UPPER(name); VM_VAR_TO_UPPER(vname); @@ -1968,16 +1775,16 @@ yyreduce: insert_vector(vm,*parsed,name,vname,vvar,vval); - if ( (yyvsp[(9) - (9)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(9) - (9)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1784 "vm_var_syntax.cc" /* yacc.c:1646 */ break; -/* Line 1787 of yacc.c */ -#line 1981 "vm_var_syntax.cc" +#line 1788 "vm_var_syntax.cc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2000,7 +1807,7 @@ yyreduce: *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2015,9 +1822,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2068,20 +1875,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2101,7 +1908,7 @@ yyerrorlab: goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2114,29 +1921,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, mc, vm, parsed, errmsg); + yystos[yystate], yyvsp, yylsp, mc, vm, parsed, errmsg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2192,14 +1999,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, mc, vm, parsed, errmsg); + yystos[*yyssp], yyvsp, yylsp, mc, vm, parsed, errmsg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2210,13 +2017,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2050 of yacc.c */ -#line 506 "vm_var_syntax.y" +#line 506 "vm_var_syntax.y" /* yacc.c:1906 */ extern "C" void vm_var__error( diff --git a/src/vm/vm_var_syntax.h b/src/vm/vm_var_syntax.h index 3d71ff86c0..0860edf372 100644 --- a/src/vm/vm_var_syntax.h +++ b/src/vm/vm_var_syntax.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED # define YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,53 +40,50 @@ extern int vm_var__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EOA = 262, - STRING = 263, - VARIABLE = 264, - RSTRING = 265, - INTEGER = 266 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EOA = 262, + STRING = 263, + VARIABLE = 264, + RSTRING = 265, + INTEGER = 266 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 2053 of yacc.c */ -#line 427 "vm_var_syntax.y" +#line 427 "vm_var_syntax.y" /* yacc.c:1909 */ char * val_str; int val_int; char val_char; - -/* Line 2053 of yacc.c */ -#line 75 "vm_var_syntax.hh" -} YYSTYPE; +#line 72 "vm_var_syntax.hh" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif From 3a67b4e4c88416196e36976440e61c824dfdb562 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 5 Nov 2013 18:20:09 +0100 Subject: [PATCH 25/57] Revert "StopMonitor action for IM dummy drivers" This reverts commit b1d27857077be4a46049c908a7b32ed7e54f0502. --- src/im_mad/dummy/one_im_dummy.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/im_mad/dummy/one_im_dummy.rb b/src/im_mad/dummy/one_im_dummy.rb index f12aeea009..9e8b145db8 100755 --- a/src/im_mad/dummy/one_im_dummy.rb +++ b/src/im_mad/dummy/one_im_dummy.rb @@ -45,7 +45,6 @@ class DummyInformationManager < OpenNebulaDriver # register actions register_action(:MONITOR, method("action_monitor")) - register_action(:STOPMONITOR, method("stop_monitor")) end # Execute the sensor array in the remote host @@ -73,10 +72,6 @@ class DummyInformationManager < OpenNebulaDriver send_message("MONITOR", RESULT[:success], number, results) end - - def stop_monitor(number, host) - send_message("STOPMONITOR", RESULT[:success], number, nil) - end end From ef260045a15eab39da321d7e46f9c0a5f1fa0d42 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 5 Nov 2013 18:20:20 +0100 Subject: [PATCH 26/57] Revert "Fix deadlock when deleting a host with running VMs" This reverts commit 4988ddd0ecbe8bebaf3b1b908030267e085ce5a5. --- src/rm/RequestManagerDelete.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/rm/RequestManagerDelete.cc b/src/rm/RequestManagerDelete.cc index b29f5d7ee9..52c757adda 100644 --- a/src/rm/RequestManagerDelete.cc +++ b/src/rm/RequestManagerDelete.cc @@ -157,9 +157,6 @@ int HostDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) if ( host->get_share_running_vms() > 0 ) { error_msg = "Can not remove a host with running VMs"; - - host->unlock(); - return -1; } From e5cf19d15401b6499f3f554b5423371c2a607a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 12 Nov 2013 13:57:21 +0100 Subject: [PATCH 27/57] Bug #2285: unescape only eats one backslash (cherry picked from commit 59f9e09aac019c44bfa1a1d4da637b7a819cf4e0) --- src/template/template_syntax.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/template/template_syntax.y b/src/template/template_syntax.y index 4c234e5074..103c886cb6 100644 --- a/src/template/template_syntax.y +++ b/src/template/template_syntax.y @@ -165,9 +165,9 @@ array_val: VARIABLE EQUAL STRING string& unescape (string &str) { - size_t pos; + size_t pos = 0; - while ((pos = str.find("\\\"")) != string::npos) + while ((pos = str.find("\\\"", pos)) != string::npos) { str.replace(pos,2,"\""); } From 1a91738f4e2f8a58966899ffc63b44311ba97096 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 12 Nov 2013 14:06:45 +0100 Subject: [PATCH 28/57] Bug #2285: redo parsers (cherry picked from commit c1d86c3c188a7678734ce8a8c03e98b600154da2) --- src/template/template_syntax.cc | 826 ++++++++++++------------------- src/template/template_syntax.h | 61 ++- src/vm/vm_var_syntax.cc | 827 ++++++++++++-------------------- src/vm/vm_var_syntax.h | 65 ++- 4 files changed, 691 insertions(+), 1088 deletions(-) diff --git a/src/template/template_syntax.cc b/src/template/template_syntax.cc index 1345d65449..7d7e77fa53 100644 --- a/src/template/template_syntax.cc +++ b/src/template/template_syntax.cc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,15 +63,12 @@ #define yyparse template__parse #define yylex template__lex #define yyerror template__error -#define yylval template__lval -#define yychar template__char #define yydebug template__debug #define yynerrs template__nerrs -#define yylloc template__lloc + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "template_syntax.y" +#line 17 "template_syntax.y" /* yacc.c:339 */ #include #include @@ -122,8 +119,7 @@ extern "C" } -/* Line 371 of yacc.c */ -#line 127 "template_syntax.cc" +#line 123 "template_syntax.cc" /* yacc.c:339 */ # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -145,7 +141,7 @@ extern "C" by #include "template_syntax.hh". */ #ifndef YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED # define YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -153,75 +149,60 @@ extern "C" extern int template__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EQUAL_EMPTY = 262, - STRING = 263, - VARIABLE = 264 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EQUAL_EMPTY = 262, + STRING = 263, + VARIABLE = 264 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 74 "template_syntax.y" +#line 74 "template_syntax.y" /* yacc.c:355 */ char * val_str; void * val_attr; - -/* Line 387 of yacc.c */ -#line 185 "template_syntax.cc" -} YYSTYPE; +#line 178 "template_syntax.cc" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int template__parse (void *YYPARSE_PARAM); -#else -int template__parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus + int template__parse (mem_collector * mc, Template * tmpl, char ** error_msg); -#else -int template__parse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 225 "template_syntax.cc" +#line 206 "template_syntax.cc" /* yacc.c:358 */ #ifdef short # undef short @@ -235,11 +216,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -259,8 +237,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -297,24 +274,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif #if ! defined yyoverflow || YYERROR_VERBOSE @@ -333,8 +311,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -346,8 +323,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -363,7 +340,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -371,15 +348,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -389,8 +364,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -416,16 +391,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -444,7 +419,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -460,17 +435,19 @@ union yyalloc #define YYNNTS 5 /* YYNRULES -- Number of rules. */ #define YYNRULES 10 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 20 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 264 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -503,24 +480,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 11, 15, 21, 24, - 28 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 11, 0, -1, -1, 12, -1, 13, -1, 12, 13, - -1, 9, 3, 8, -1, 9, 3, 5, 14, 6, - -1, 9, 7, -1, 9, 3, 8, -1, 14, 4, - 9, 3, 8, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 94, 94, 95, 98, 99, 102, 112, 125, 137, @@ -540,112 +500,100 @@ static const char *const yytname[] = #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 10, 11, 11, 12, 12, 13, 13, 13, 14, - 14 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 3, 5, 2, 3, - 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 0, 3, 4, 0, 8, 1, 5, 0, - 6, 0, 0, 0, 0, 7, 9, 0, 0, 10 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 3, 4, 12 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -9 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-9))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -8, -3, 2, -8, -9, -2, -9, -9, -9, -1, -9, 6, 1, 3, 4, -9, -9, 7, 8, -9 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 0, 0, 3, 4, 0, 8, 1, 5, 0, + 6, 0, 0, 0, 0, 7, 9, 0, 0, 10 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -9, -9, -9, 9, -9 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 3, 4, 12 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 5, 1, 7, 9, 6, 14, 10, 15, 11, 13, 18, 16, 8, 17, 0, 0, 19 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-9))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 3, 9, 0, 5, 7, 4, 8, 6, 9, 3, 3, 8, 3, 9, -1, -1, 8 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 9, 11, 12, 13, 3, 7, 0, 13, 5, 8, 9, 14, 3, 4, 6, 8, 9, 3, 8 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 10, 11, 11, 12, 12, 13, 13, 13, 14, + 14 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 5, 2, 3, + 5 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -662,13 +610,13 @@ do \ else \ { \ yyerror (&yylloc, mc, tmpl, error_msg, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -678,7 +626,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -692,12 +640,27 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ @@ -708,35 +671,27 @@ while (YYID (0)) /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ __attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static unsigned yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -#else -static unsigned -yy_location_print_ (yyo, yylocp) - FILE *yyo; - YYLTYPE const * const yylocp; -#endif { unsigned res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } @@ -750,73 +705,36 @@ yy_location_print_ (yyo, yylocp) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, mc) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, mc, tmpl, error_msg); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, mc, tmpl, error_msg); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); - if (!yyvaluep) - return; YYUSE (yylocationp); YYUSE (mc); YYUSE (tmpl); YYUSE (error_msg); + if (!yyvaluep) + return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif YYUSE (yytype); } @@ -826,26 +744,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_ | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -858,16 +761,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -878,53 +773,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, mc, tmpl, error_msg) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, Template * tmpl, char ** error_msg) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, tmpl, error_msg); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, tmpl, error_msg); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, mc, tmpl, error_msg); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, mc, tmpl, error_msg); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -938,7 +822,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -961,15 +845,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -985,16 +862,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1024,27 +893,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1079,10 +948,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1199,34 +1064,21 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, mem_collector * mc, Template * tmpl, char ** error_msg) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (mc); YYUSE (tmpl); YYUSE (error_msg); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1236,68 +1088,27 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (mem_collector * mc, Template * tmpl, char ** error_msg) -#else -int -yyparse (mc, tmpl, error_msg) - mem_collector * mc; - Template * tmpl; - char ** error_msg; -#endif -#endif { /* The lookahead symbol. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - -/* Location data for the lookahead symbol. */ YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ int yynerrs; @@ -1306,9 +1117,9 @@ YYLTYPE yylloc = yyloc_default; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1387,26 +1198,26 @@ YYLTYPE yylloc = yyloc_default; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1414,23 +1225,23 @@ YYLTYPE yylloc = yyloc_default; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1440,10 +1251,10 @@ YYLTYPE yylloc = yyloc_default; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1472,7 +1283,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc, mc); } if (yychar <= YYEOF) @@ -1537,7 +1348,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1552,57 +1363,56 @@ yyreduce: switch (yyn) { case 6: -/* Line 1787 of yacc.c */ -#line 103 "template_syntax.y" +#line 103 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (3)].val_str)); - string value((yyvsp[(3) - (3)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); pattr = new SingleAttribute(name,unescape(value)); tmpl->set(pattr); } +#line 1377 "template_syntax.cc" /* yacc.c:1646 */ break; case 7: -/* Line 1787 of yacc.c */ -#line 113 "template_syntax.y" +#line 113 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (5)].val_str)); + string name((yyvsp[-4].val_str)); map * amap; - amap = static_cast *>((yyvsp[(4) - (5)].val_attr)); + amap = static_cast *>((yyvsp[-1].val_attr)); pattr = new VectorAttribute(name,*amap); tmpl->set(pattr); delete amap; } +#line 1394 "template_syntax.cc" /* yacc.c:1646 */ break; case 8: -/* Line 1787 of yacc.c */ -#line 126 "template_syntax.y" +#line 126 "template_syntax.y" /* yacc.c:1646 */ { Attribute * pattr; - string name((yyvsp[(1) - (2)].val_str)); + string name((yyvsp[-1].val_str)); string value(""); pattr = new SingleAttribute(name,value); tmpl->set(pattr); } +#line 1408 "template_syntax.cc" /* yacc.c:1646 */ break; case 9: -/* Line 1787 of yacc.c */ -#line 138 "template_syntax.y" +#line 138 "template_syntax.y" /* yacc.c:1646 */ { map* vattr; - string name((yyvsp[(1) - (3)].val_str)); - string value((yyvsp[(3) - (3)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); TEMPLATE_TO_UPPER(name); @@ -1611,28 +1421,28 @@ yyreduce: (yyval.val_attr) = static_cast(vattr); } +#line 1425 "template_syntax.cc" /* yacc.c:1646 */ break; case 10: -/* Line 1787 of yacc.c */ -#line 151 "template_syntax.y" +#line 151 "template_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(3) - (5)].val_str)); - string value((yyvsp[(5) - (5)].val_str)); + string name((yyvsp[-2].val_str)); + string value((yyvsp[0].val_str)); map * attrmap; TEMPLATE_TO_UPPER(name); - attrmap = static_cast *>((yyvsp[(1) - (5)].val_attr)); + attrmap = static_cast *>((yyvsp[-4].val_attr)); attrmap->insert(make_pair(name,unescape(value))); - (yyval.val_attr) = (yyvsp[(1) - (5)].val_attr); + (yyval.val_attr) = (yyvsp[-4].val_attr); } +#line 1442 "template_syntax.cc" /* yacc.c:1646 */ break; -/* Line 1787 of yacc.c */ -#line 1636 "template_syntax.cc" +#line 1446 "template_syntax.cc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1655,7 +1465,7 @@ yyreduce: *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1670,9 +1480,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -1723,20 +1533,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, mc, tmpl, error_msg); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, mc, tmpl, error_msg); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -1756,7 +1566,7 @@ yyerrorlab: goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -1769,29 +1579,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, mc, tmpl, error_msg); + yystos[yystate], yyvsp, yylsp, mc, tmpl, error_msg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1847,14 +1657,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, mc, tmpl, error_msg); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, mc, tmpl, error_msg); + yystos[*yyssp], yyvsp, yylsp, mc, tmpl, error_msg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1865,20 +1675,16 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2050 of yacc.c */ -#line 164 "template_syntax.y" +#line 164 "template_syntax.y" /* yacc.c:1906 */ string& unescape (string &str) { - size_t pos; + size_t pos = 0; - while ((pos = str.find("\\\"")) != string::npos) + while ((pos = str.find("\\\"", pos)) != string::npos) { str.replace(pos,2,"\""); } diff --git a/src/template/template_syntax.h b/src/template/template_syntax.h index 55ed0e45da..28cce191b6 100644 --- a/src/template/template_syntax.h +++ b/src/template/template_syntax.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED # define YY_TEMPLATE_TEMPLATE_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,50 +40,47 @@ extern int template__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EQUAL_EMPTY = 262, - STRING = 263, - VARIABLE = 264 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EQUAL_EMPTY = 262, + STRING = 263, + VARIABLE = 264 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 2053 of yacc.c */ -#line 74 "template_syntax.y" +#line 74 "template_syntax.y" /* yacc.c:1909 */ char * val_str; void * val_attr; - -/* Line 2053 of yacc.c */ -#line 72 "template_syntax.hh" -} YYSTYPE; +#line 69 "template_syntax.hh" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif diff --git a/src/vm/vm_var_syntax.cc b/src/vm/vm_var_syntax.cc index 3579984451..9c26901060 100644 --- a/src/vm/vm_var_syntax.cc +++ b/src/vm/vm_var_syntax.cc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,15 +63,12 @@ #define yyparse vm_var__parse #define yylex vm_var__lex #define yyerror vm_var__error -#define yylval vm_var__lval -#define yychar vm_var__char #define yydebug vm_var__debug #define yynerrs vm_var__nerrs -#define yylloc vm_var__lloc + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "vm_var_syntax.y" +#line 17 "vm_var_syntax.y" /* yacc.c:339 */ #include #include @@ -474,8 +471,7 @@ void insert_vector(VirtualMachine * vm, /* -------------------------------------------------------------------------- */ -/* Line 371 of yacc.c */ -#line 479 "vm_var_syntax.cc" +#line 475 "vm_var_syntax.cc" /* yacc.c:339 */ # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -497,7 +493,7 @@ void insert_vector(VirtualMachine * vm, by #include "vm_var_syntax.hh". */ #ifndef YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED # define YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -505,78 +501,63 @@ void insert_vector(VirtualMachine * vm, extern int vm_var__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EOA = 262, - STRING = 263, - VARIABLE = 264, - RSTRING = 265, - INTEGER = 266 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EOA = 262, + STRING = 263, + VARIABLE = 264, + RSTRING = 265, + INTEGER = 266 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 427 "vm_var_syntax.y" +#line 427 "vm_var_syntax.y" /* yacc.c:355 */ char * val_str; int val_int; char val_char; - -/* Line 387 of yacc.c */ -#line 540 "vm_var_syntax.cc" -} YYSTYPE; +#line 533 "vm_var_syntax.cc" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int vm_var__parse (void *YYPARSE_PARAM); -#else -int vm_var__parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus + int vm_var__parse (mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg); -#else -int vm_var__parse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 580 "vm_var_syntax.cc" +#line 561 "vm_var_syntax.cc" /* yacc.c:358 */ #ifdef short # undef short @@ -590,11 +571,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -614,8 +592,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -652,24 +629,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif #if ! defined yyoverflow || YYERROR_VERBOSE @@ -688,8 +666,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -701,8 +678,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -718,7 +695,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -726,15 +703,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -744,8 +719,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -771,16 +746,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -799,7 +774,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -815,17 +790,19 @@ union yyalloc #define YYNNTS 3 /* YYNRULES -- Number of rules. */ #define YYNRULES 7 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 18 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 266 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -858,22 +835,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 8, 10, 13, 19 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 13, 0, -1, 14, -1, 13, 14, -1, 10, -1, - 9, 7, -1, 9, 5, 9, 6, 7, -1, 9, - 5, 9, 4, 9, 3, 8, 6, 7, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 451, 451, 452, 455, 459, 472, 487 @@ -892,8 +854,8 @@ static const char *const yytname[] = #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -901,102 +863,90 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 12, 13, 13, 14, 14, 14, 14 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 2, 1, 2, 5, 9 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 4, 0, 2, 0, 5, 1, 3, 0, - 0, 0, 0, 6, 0, 0, 0, 7 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 3, 4 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -5 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-5))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -3, -4, -5, 0, -5, -1, -5, -5, -5, -2, 2, 5, 10, -5, 6, 9, 11, -5 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 4, 0, 2, 0, 5, 1, 3, 0, + 0, 0, 0, 6, 0, 0, 0, 7 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -5, -5, 13 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 3, 4 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 7, 5, 10, 6, 11, 0, 1, 2, 9, 1, 2, 12, 13, 14, 15, 16, 8, 0, 17 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-5))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 0, 5, 4, 7, 6, -1, 9, 10, 9, 9, 10, 9, 7, 3, 8, 6, 3, -1, 7 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 9, 10, 13, 14, 5, 7, 0, 14, 9, 4, 6, 9, 7, 3, 8, 6, 7 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 12, 13, 13, 14, 14, 14, 14 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 2, 1, 2, 5, 9 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1013,13 +963,13 @@ do \ else \ { \ yyerror (&yylloc, mc, vm, parsed, errmsg, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -1029,7 +979,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -1043,12 +993,27 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ @@ -1059,35 +1024,27 @@ while (YYID (0)) /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ __attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static unsigned yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -#else -static unsigned -yy_location_print_ (yyo, yylocp) - FILE *yyo; - YYLTYPE const * const yylocp; -#endif { unsigned res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } @@ -1101,75 +1058,37 @@ yy_location_print_ (yyo, yylocp) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, mc) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, mc, vm, parsed, errmsg); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, mc, vm, parsed, errmsg); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); - if (!yyvaluep) - return; YYUSE (yylocationp); YYUSE (mc); YYUSE (vm); YYUSE (parsed); YYUSE (errmsg); + if (!yyvaluep) + return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif YYUSE (yytype); } @@ -1179,27 +1098,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -1212,16 +1115,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1232,54 +1127,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, mc, vm, parsed, errmsg) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, vm, parsed, errmsg); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , mc, vm, parsed, errmsg); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, mc, vm, parsed, errmsg); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, mc, vm, parsed, errmsg); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1293,7 +1176,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1316,15 +1199,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1340,16 +1216,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1379,27 +1247,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1434,10 +1302,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1554,23 +1418,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); @@ -1578,12 +1427,13 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) YYUSE (vm); YYUSE (parsed); YYUSE (errmsg); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1593,69 +1443,27 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (mem_collector * mc, VirtualMachine * vm, ostringstream * parsed, char ** errmsg) -#else -int -yyparse (mc, vm, parsed, errmsg) - mem_collector * mc; - VirtualMachine * vm; - ostringstream * parsed; - char ** errmsg; -#endif -#endif { /* The lookahead symbol. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - -/* Location data for the lookahead symbol. */ YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ int yynerrs; @@ -1664,9 +1472,9 @@ YYLTYPE yylloc = yyloc_default; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1745,26 +1553,26 @@ YYLTYPE yylloc = yyloc_default; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1772,23 +1580,23 @@ YYLTYPE yylloc = yyloc_default; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1798,10 +1606,10 @@ YYLTYPE yylloc = yyloc_default; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1830,7 +1638,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc, mc); } if (yychar <= YYEOF) @@ -1895,7 +1703,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1910,57 +1718,56 @@ yyreduce: switch (yyn) { case 4: -/* Line 1787 of yacc.c */ -#line 456 "vm_var_syntax.y" +#line 456 "vm_var_syntax.y" /* yacc.c:1646 */ { - (*parsed) << (yyvsp[(1) - (1)].val_str); + (*parsed) << (yyvsp[0].val_str); } +#line 1726 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 5: -/* Line 1787 of yacc.c */ -#line 460 "vm_var_syntax.y" +#line 460 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (2)].val_str)); + string name((yyvsp[-1].val_str)); VM_VAR_TO_UPPER(name); insert_single(vm,*parsed,name); - if ( (yyvsp[(2) - (2)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(2) - (2)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1743 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 6: -/* Line 1787 of yacc.c */ -#line 473 "vm_var_syntax.y" +#line 473 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (5)].val_str)); - string vname((yyvsp[(3) - (5)].val_str)); + string name((yyvsp[-4].val_str)); + string vname((yyvsp[-2].val_str)); VM_VAR_TO_UPPER(name); VM_VAR_TO_UPPER(vname); insert_vector(vm,*parsed,name,vname,"",""); - if ( (yyvsp[(5) - (5)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(5) - (5)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1762 "vm_var_syntax.cc" /* yacc.c:1646 */ break; case 7: -/* Line 1787 of yacc.c */ -#line 488 "vm_var_syntax.y" +#line 488 "vm_var_syntax.y" /* yacc.c:1646 */ { - string name((yyvsp[(1) - (9)].val_str)); - string vname((yyvsp[(3) - (9)].val_str)); - string vvar((yyvsp[(5) - (9)].val_str)); - string vval((yyvsp[(7) - (9)].val_str)); + string name((yyvsp[-8].val_str)); + string vname((yyvsp[-6].val_str)); + string vvar((yyvsp[-4].val_str)); + string vval((yyvsp[-2].val_str)); VM_VAR_TO_UPPER(name); VM_VAR_TO_UPPER(vname); @@ -1968,16 +1775,16 @@ yyreduce: insert_vector(vm,*parsed,name,vname,vvar,vval); - if ( (yyvsp[(9) - (9)].val_char) != '\0' ) + if ( (yyvsp[0].val_char) != '\0' ) { - (*parsed) << (yyvsp[(9) - (9)].val_char); + (*parsed) << (yyvsp[0].val_char); } } +#line 1784 "vm_var_syntax.cc" /* yacc.c:1646 */ break; -/* Line 1787 of yacc.c */ -#line 1981 "vm_var_syntax.cc" +#line 1788 "vm_var_syntax.cc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2000,7 +1807,7 @@ yyreduce: *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2015,9 +1822,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2068,20 +1875,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2101,7 +1908,7 @@ yyerrorlab: goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2114,29 +1921,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, mc, vm, parsed, errmsg); + yystos[yystate], yyvsp, yylsp, mc, vm, parsed, errmsg); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2192,14 +1999,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, mc, vm, parsed, errmsg); + yystos[*yyssp], yyvsp, yylsp, mc, vm, parsed, errmsg); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2210,13 +2017,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2050 of yacc.c */ -#line 506 "vm_var_syntax.y" +#line 506 "vm_var_syntax.y" /* yacc.c:1906 */ extern "C" void vm_var__error( diff --git a/src/vm/vm_var_syntax.h b/src/vm/vm_var_syntax.h index 3d71ff86c0..0860edf372 100644 --- a/src/vm/vm_var_syntax.h +++ b/src/vm/vm_var_syntax.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED # define YY_VM_VAR_VM_VAR_SYNTAX_HH_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,53 +40,50 @@ extern int vm_var__debug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - EQUAL = 258, - COMMA = 259, - OBRACKET = 260, - CBRACKET = 261, - EOA = 262, - STRING = 263, - VARIABLE = 264, - RSTRING = 265, - INTEGER = 266 - }; + enum yytokentype + { + EQUAL = 258, + COMMA = 259, + OBRACKET = 260, + CBRACKET = 261, + EOA = 262, + STRING = 263, + VARIABLE = 264, + RSTRING = 265, + INTEGER = 266 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { -/* Line 2053 of yacc.c */ -#line 427 "vm_var_syntax.y" +#line 427 "vm_var_syntax.y" /* yacc.c:1909 */ char * val_str; int val_int; char val_char; - -/* Line 2053 of yacc.c */ -#line 75 "vm_var_syntax.hh" -} YYSTYPE; +#line 72 "vm_var_syntax.hh" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif From 729ea754d46cb68dd7809ba1bd7e9ad3c742bde8 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 12 Nov 2013 14:09:58 +0100 Subject: [PATCH 29/57] Revert "Revert "Fix deadlock when deleting a host with running VMs"" This reverts commit ef260045a15eab39da321d7e46f9c0a5f1fa0d42. --- src/rm/RequestManagerDelete.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rm/RequestManagerDelete.cc b/src/rm/RequestManagerDelete.cc index 52c757adda..b29f5d7ee9 100644 --- a/src/rm/RequestManagerDelete.cc +++ b/src/rm/RequestManagerDelete.cc @@ -157,6 +157,9 @@ int HostDelete::drop(int oid, PoolObjectSQL * object, string& error_msg) if ( host->get_share_running_vms() > 0 ) { error_msg = "Can not remove a host with running VMs"; + + host->unlock(); + return -1; } From b8d5b58ea0fc2079548db1d85fd88daf64f474eb Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 12 Nov 2013 14:10:39 +0100 Subject: [PATCH 30/57] Revert "Revert "StopMonitor action for IM dummy drivers"" This reverts commit 3a67b4e4c88416196e36976440e61c824dfdb562. --- src/im_mad/dummy/one_im_dummy.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/im_mad/dummy/one_im_dummy.rb b/src/im_mad/dummy/one_im_dummy.rb index 9e8b145db8..f12aeea009 100755 --- a/src/im_mad/dummy/one_im_dummy.rb +++ b/src/im_mad/dummy/one_im_dummy.rb @@ -45,6 +45,7 @@ class DummyInformationManager < OpenNebulaDriver # register actions register_action(:MONITOR, method("action_monitor")) + register_action(:STOPMONITOR, method("stop_monitor")) end # Execute the sensor array in the remote host @@ -72,6 +73,10 @@ class DummyInformationManager < OpenNebulaDriver send_message("MONITOR", RESULT[:success], number, results) end + + def stop_monitor(number, host) + send_message("STOPMONITOR", RESULT[:success], number, nil) + end end From 14f0051b24c5d8e2fbfc7ca86b6ddbfff15c9edb Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 12 Nov 2013 16:16:50 +0100 Subject: [PATCH 31/57] feature #2183: Fix for ozones init script in openSUSE --- share/pkgs/openSUSE/systemd/ozones.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/pkgs/openSUSE/systemd/ozones.service b/share/pkgs/openSUSE/systemd/ozones.service index d4be12dafa..01e08b25f0 100644 --- a/share/pkgs/openSUSE/systemd/ozones.service +++ b/share/pkgs/openSUSE/systemd/ozones.service @@ -8,7 +8,7 @@ BindTo=one.service !ConditionFileExists=/var/lock/one/.ozones.lock [Service] -ExecStart=/bin/bash -c "/usr/bin/rackup /usr/lib/one/ozones/config.ru -s thin -P /var/run/one/ozones.pid > /var/log/one/ozones-server.log 2>&1" +ExecStart=/bin/bash -c "/usr/bin/ozones-server start" ExecStartPost=/usr/bin/touch /var/lock/one/.ozones.lock ExecStop=/bin/kill -INT $MAINPID PIDFile=/var/run/one/ozones.pid From 9979c5e261c8c60fb86e38cb42dc1a36da0ef244 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 12 Nov 2013 16:16:50 +0100 Subject: [PATCH 32/57] feature #2183: Fix for ozones init script in openSUSE (cherry picked from commit 14f0051b24c5d8e2fbfc7ca86b6ddbfff15c9edb) --- share/pkgs/openSUSE/systemd/ozones.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/pkgs/openSUSE/systemd/ozones.service b/share/pkgs/openSUSE/systemd/ozones.service index d4be12dafa..01e08b25f0 100644 --- a/share/pkgs/openSUSE/systemd/ozones.service +++ b/share/pkgs/openSUSE/systemd/ozones.service @@ -8,7 +8,7 @@ BindTo=one.service !ConditionFileExists=/var/lock/one/.ozones.lock [Service] -ExecStart=/bin/bash -c "/usr/bin/rackup /usr/lib/one/ozones/config.ru -s thin -P /var/run/one/ozones.pid > /var/log/one/ozones-server.log 2>&1" +ExecStart=/bin/bash -c "/usr/bin/ozones-server start" ExecStartPost=/usr/bin/touch /var/lock/one/.ozones.lock ExecStop=/bin/kill -INT $MAINPID PIDFile=/var/run/one/ozones.pid From 9f952bea35197fea883fee2e1dca0f2c1f1eaf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 12 Nov 2013 17:36:51 +0100 Subject: [PATCH 33/57] Add missing return statement in Nebula::start --- src/nebula/Nebula.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index a28e1f76a6..9164560e8f 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -989,6 +989,8 @@ void Nebula::start(bool bootstrap_only) NebulaLog::log("ONE", Log::INFO, "All modules finalized, exiting.\n"); + return; + error_mad: NebulaLog::log("ONE", Log::ERROR, "Could not load driver"); throw runtime_error("Could not load an OpenNebula driver"); From f35df3207f21f8225bb94a07be8bdc93d8fb8dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 12 Nov 2013 17:36:51 +0100 Subject: [PATCH 34/57] Add missing return statement in Nebula::start (cherry picked from commit 9f952bea35197fea883fee2e1dca0f2c1f1eaf46) --- src/nebula/Nebula.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index a28e1f76a6..9164560e8f 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -989,6 +989,8 @@ void Nebula::start(bool bootstrap_only) NebulaLog::log("ONE", Log::INFO, "All modules finalized, exiting.\n"); + return; + error_mad: NebulaLog::log("ONE", Log::ERROR, "Could not load driver"); throw runtime_error("Could not load an OpenNebula driver"); From 63b7956d4326a0941983df1bed88fef60458e5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 13 Nov 2013 12:32:25 +0100 Subject: [PATCH 35/57] Feature #2449: Print a nice table for VM requirements in sched.log --- .../src/pool/VirtualMachinePoolXML.cc | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/scheduler/src/pool/VirtualMachinePoolXML.cc b/src/scheduler/src/pool/VirtualMachinePoolXML.cc index 631f1fe585..9b997219b2 100644 --- a/src/scheduler/src/pool/VirtualMachinePoolXML.cc +++ b/src/scheduler/src/pool/VirtualMachinePoolXML.cc @@ -16,6 +16,7 @@ #include "VirtualMachinePoolXML.h" #include +#include int VirtualMachinePoolXML::set_up() { @@ -32,7 +33,14 @@ int VirtualMachinePoolXML::set_up() if (NebulaLog::log_level() == Log::DEBUG) { ostringstream oss; - oss << "Pending/rescheduling VM and capacity requirements:"; + oss << "Pending/rescheduling VM and capacity requirements:" << endl; + + oss << right << setw(8) << "VM" << " " + << right << setw(4) << "CPU" << " " + << right << setw(11) << "Memory" << " " + << right << setw(11) << "System DS" << " " + << " Image DS" + << endl << setw(60) << setfill('-') << "-" << setfill(' '); for (map::iterator it=objects.begin();it!=objects.end();it++) { @@ -44,18 +52,17 @@ int VirtualMachinePoolXML::set_up() vm->get_requirements(cpu, mem, disk); oss << endl - << "\tVM: " << it->first << endl - << "\t CPU: " << cpu << endl - << "\t Memory: " << mem << endl - << "\t System DS: " << disk << endl; + << right << setw(8) << it->first << " " + << right << setw(4) << cpu << " " + << right << setw(11) << mem << " " + << right << setw(11) << disk << " "; map ds_usage = vm->get_storage_usage(); for (map::const_iterator ds_it = ds_usage.begin(); ds_it != ds_usage.end(); ds_it++) { - oss << "\t Image DS " << ds_it->first << ": " << ds_it->second - << endl; + oss << " DS " << ds_it->first << ": " << ds_it->second << " "; } } From 04c72e8119c40d32ab8dfbf08cc2456f35ac0e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 13 Nov 2013 12:32:25 +0100 Subject: [PATCH 36/57] Feature #2449: Print a nice table for VM requirements in sched.log (cherry picked from commit 63b7956d4326a0941983df1bed88fef60458e5f5) --- .../src/pool/VirtualMachinePoolXML.cc | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/scheduler/src/pool/VirtualMachinePoolXML.cc b/src/scheduler/src/pool/VirtualMachinePoolXML.cc index 631f1fe585..9b997219b2 100644 --- a/src/scheduler/src/pool/VirtualMachinePoolXML.cc +++ b/src/scheduler/src/pool/VirtualMachinePoolXML.cc @@ -16,6 +16,7 @@ #include "VirtualMachinePoolXML.h" #include +#include int VirtualMachinePoolXML::set_up() { @@ -32,7 +33,14 @@ int VirtualMachinePoolXML::set_up() if (NebulaLog::log_level() == Log::DEBUG) { ostringstream oss; - oss << "Pending/rescheduling VM and capacity requirements:"; + oss << "Pending/rescheduling VM and capacity requirements:" << endl; + + oss << right << setw(8) << "VM" << " " + << right << setw(4) << "CPU" << " " + << right << setw(11) << "Memory" << " " + << right << setw(11) << "System DS" << " " + << " Image DS" + << endl << setw(60) << setfill('-') << "-" << setfill(' '); for (map::iterator it=objects.begin();it!=objects.end();it++) { @@ -44,18 +52,17 @@ int VirtualMachinePoolXML::set_up() vm->get_requirements(cpu, mem, disk); oss << endl - << "\tVM: " << it->first << endl - << "\t CPU: " << cpu << endl - << "\t Memory: " << mem << endl - << "\t System DS: " << disk << endl; + << right << setw(8) << it->first << " " + << right << setw(4) << cpu << " " + << right << setw(11) << mem << " " + << right << setw(11) << disk << " "; map ds_usage = vm->get_storage_usage(); for (map::const_iterator ds_it = ds_usage.begin(); ds_it != ds_usage.end(); ds_it++) { - oss << "\t Image DS " << ds_it->first << ": " << ds_it->second - << endl; + oss << " DS " << ds_it->first << ": " << ds_it->second << " "; } } From a1a2cb93d61079354167e732277d6fcabaf5eaf4 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Wed, 13 Nov 2013 16:01:32 +0100 Subject: [PATCH 37/57] Do not call with sudo vgdisplay if it doesn't exist (cherry picked from commit 5415fe686b8a19e325f7c008989b9a43c3bcd4f1) --- src/im_mad/remotes/common.d/monitor_ds.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/im_mad/remotes/common.d/monitor_ds.sh b/src/im_mad/remotes/common.d/monitor_ds.sh index 08d8102a9d..523fcf26d8 100755 --- a/src/im_mad/remotes/common.d/monitor_ds.sh +++ b/src/im_mad/remotes/common.d/monitor_ds.sh @@ -5,7 +5,12 @@ HYPERVISOR=$1 DATASTORE_LOCATION=${2:-"/var/lib/one/datastores"} LVM_VG_PREFIX="vg-one-" -LVM_SIZE_CMD="sudo vgdisplay --separator : --units m -o vg_size,vg_free --nosuffix --noheadings -C" + +PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin which vgdisplay &> /dev/null + +if [ $? == 0 ]; then + LVM_SIZE_CMD="sudo vgdisplay --separator : --units m -o vg_size,vg_free --nosuffix --noheadings -C" +fi USED_MB=$(du -sLm $DATASTORE_LOCATION 2>/dev/null | cut -f1) TOTAL_MB=$(df -B1M -P $DATASTORE_LOCATION 2>/dev/null | tail -n 1 | awk '{print $2}') @@ -26,8 +31,12 @@ for ds in $dirs; do TOTAL_MB=$(df -B1M -P $dir 2>/dev/null | tail -n 1 | awk '{print $2}') FREE_MB=$(df -B1M -P $dir 2>/dev/null | tail -n 1 | awk '{print $4}') - LVM_SIZE=$($LVM_SIZE_CMD ${LVM_VG_PREFIX}${ds} 2>/dev/null) - LVM_STATUS=$? + if [ -n "$LVM_SIZE_CMD" ]; then + LVM_SIZE=$($LVM_SIZE_CMD ${LVM_VG_PREFIX}${ds} 2>/dev/null) + LVM_STATUS=$? + else + LVM_STATUS=255 + fi echo "DS = [" echo " ID = $ds," From e5e5a62d43309603a052eb788e70b1818cf8bd73 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 13 Nov 2013 16:47:55 +0100 Subject: [PATCH 38/57] bug #2108: LVM datastore clone script doesn't work if hostname contains a dot --- src/datastore_mad/remotes/lvm/clone | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/datastore_mad/remotes/lvm/clone b/src/datastore_mad/remotes/lvm/clone index 545b74eb6e..0ee7365e3f 100755 --- a/src/datastore_mad/remotes/lvm/clone +++ b/src/datastore_mad/remotes/lvm/clone @@ -65,9 +65,8 @@ fi SAFE_DIRS="" -SRC_HOST=`echo $SRC|cut -d. -f1` -SRC_PATH=`echo $SRC|cut -d. -f2` - +SRC_HOST=`echo $SRC|cut -d: -f1` +SRC_PATH=`echo $SRC|awk -F. '{print $NF}'` LV_SRC=$(echo $SRC_PATH|cut -d. -f2) DEV_SRC="/dev/$VG_NAME/$LV_SRC" From b559b3250a80732937c26f76c7cd629bc6624587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 14 Nov 2013 11:49:53 +0100 Subject: [PATCH 39/57] Feature #2459: Define image, ds and vnet attributes to be inherited to the VM disk or nic sections --- include/Datastore.h | 7 ++++++- include/Image.h | 9 ++++++--- include/ImagePool.h | 25 +++++++++++++++++------ include/VirtualNetwork.h | 7 ++++++- include/VirtualNetworkPool.h | 16 ++++++++++----- share/etc/oned.conf | 21 +++++++++++++++++++ src/datastore/Datastore.cc | 17 +++++++++++++++- src/image/Image.cc | 20 +++++++++++++++--- src/image/ImagePool.cc | 38 ++++++++++++++++++++++++++--------- src/nebula/Nebula.cc | 15 ++++++++++++-- src/vnm/VirtualNetwork.cc | 18 ++++++++++++++++- src/vnm/VirtualNetworkPool.cc | 22 ++++++++++++++------ 12 files changed, 176 insertions(+), 39 deletions(-) diff --git a/include/Datastore.h b/include/Datastore.h index 988f05ce3a..90ea071d53 100644 --- a/include/Datastore.h +++ b/include/Datastore.h @@ -146,9 +146,14 @@ public: * attributes * * @param disk + * @param inherit_attrs Attributes to be inherited from the DS template + * into the disk * @return 0 on success */ - int disk_attribute(VectorAttribute * disk); + int disk_attribute( + VectorAttribute * disk, + const vector& inherit_attrs); + /** * Replace template for this object. Object should be updated diff --git a/include/Image.h b/include/Image.h index d9a222f704..ca2fc37d40 100644 --- a/include/Image.h +++ b/include/Image.h @@ -467,12 +467,15 @@ public: * @param img_type will be set to the used image's type * @param dev_prefix will be set to the defined dev_prefix, * or the default one + * @param inherit_attrs Attributes to be inherited from the image template + * into the disk * * @return 0 on success, -1 otherwise */ - int disk_attribute( VectorAttribute * disk, - ImageType& img_type, - string& dev_prefix); + int disk_attribute( VectorAttribute * disk, + ImageType& img_type, + string& dev_prefix, + const vector& inherit_attrs); /** * Factory method for image templates diff --git a/include/ImagePool.h b/include/ImagePool.h index ed55a17d0f..27d039c1a3 100644 --- a/include/ImagePool.h +++ b/include/ImagePool.h @@ -39,12 +39,15 @@ class ImagePool : public PoolSQL { public: - ImagePool(SqlDB * db, - const string& _default_type, - const string& _default_dev_prefix, - vector& restricted_attrs, - vector hook_mads, - const string& remotes_location); + ImagePool( + SqlDB * db, + const string& __default_type, + const string& __default_dev_prefix, + vector& restricted_attrs, + vector hook_mads, + const string& remotes_location, + const vector& _inherit_image_attrs, + const vector& _inherit_datastore_attrs); ~ImagePool(){}; @@ -212,6 +215,16 @@ private: **/ static string _default_dev_prefix; + /** + * Image attributes to be inherited into the VM disk + */ + vector inherit_image_attrs; + + /** + * Datastore attributes to be inherited into the VM disk + */ + vector inherit_datastore_attrs; + //-------------------------------------------------------------------------- // Pool Attributes // ------------------------------------------------------------------------- diff --git a/include/VirtualNetwork.h b/include/VirtualNetwork.h index 08c1d3e21a..7096a8ebb6 100644 --- a/include/VirtualNetwork.h +++ b/include/VirtualNetwork.h @@ -201,9 +201,14 @@ public: * * BRIDGE: for this virtual network * @param nic attribute for the VM template * @param vid of the VM getting the lease + * @param inherit_attrs Attributes to be inherited from the vnet template + * into the nic * @return 0 on success */ - int nic_attribute(VectorAttribute * nic, int vid); + int nic_attribute( + VectorAttribute * nic, + int vid, + const vector& inherit_attrs); private: diff --git a/include/VirtualNetworkPool.h b/include/VirtualNetworkPool.h index 369612f0e0..fbd694265f 100644 --- a/include/VirtualNetworkPool.h +++ b/include/VirtualNetworkPool.h @@ -33,11 +33,12 @@ class VirtualNetworkPool : public PoolSQL { public: - VirtualNetworkPool(SqlDB * db, - const string& str_mac_prefix, - int default_size, - vector hook_mads, - const string& remotes_location); + VirtualNetworkPool(SqlDB * db, + const string& str_mac_prefix, + int default_size, + vector hook_mads, + const string& remotes_location, + const vector& _inherit_attrs); ~VirtualNetworkPool(){}; @@ -174,6 +175,11 @@ private: */ static unsigned int _default_size; + /** + * VNet attributes to be injected into the VM nic + */ + vector inherit_attrs; + /** * Factory method to produce VN objects * @return a pointer to the new VN diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 39d87509c0..fad9691843 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -679,3 +679,24 @@ IMAGE_RESTRICTED_ATTR = "SOURCE" #******************************************************************************* #ONEGATE_ENDPOINT = "http://frontend:5030" + +#******************************************************************************* +# Inherited Attributes Configuration +#******************************************************************************* +# The following attributes will be copied from the resource template to the +# instantiated VMs. More than one attribute can be defined. +# +# INHERIT_IMAGE_ATTR: Attribute to be copied from the Image template +# to each VM/DISK. +# +# INHERIT_DATASTORE_ATTR: Attribute to be copied from the Datastore template +# to each VM/DISK. +# +# INHERIT_VNET_ATTR: Attribute to be copied from the Network template +# to each VM/NIC. +#******************************************************************************* + +#INHERIT_IMAGE_ATTR = "EXAMPLE" +#INHERIT_IMAGE_ATTR = "SECOND_EXAMPLE" +#INHERIT_DATASTORE_ATTR = "COLOR" +#INHERIT_VNET_ATTR = "BANDWIDTH_THROTTLING" diff --git a/src/datastore/Datastore.cc b/src/datastore/Datastore.cc index 065a326599..795571370d 100644 --- a/src/datastore/Datastore.cc +++ b/src/datastore/Datastore.cc @@ -71,10 +71,15 @@ Datastore::Datastore( /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ -int Datastore::disk_attribute(VectorAttribute * disk) +int Datastore::disk_attribute( + VectorAttribute * disk, + const vector& inherit_attrs) { ostringstream oss; string st; + string inherit_val; + + vector::const_iterator it; oss << oid; @@ -104,6 +109,16 @@ int Datastore::disk_attribute(VectorAttribute * disk) disk->replace("LN_TARGET", st); } + for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++) + { + get_template_attribute((*it).c_str(), inherit_val); + + if (!inherit_val.empty()) + { + disk->replace(*it, inherit_val); + } + } + return 0; } diff --git a/src/image/Image.cc b/src/image/Image.cc index efca871a72..935aed30f9 100644 --- a/src/image/Image.cc +++ b/src/image/Image.cc @@ -467,18 +467,22 @@ int Image::from_xml(const string& xml) /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ -int Image::disk_attribute( VectorAttribute * disk, - ImageType& img_type, - string& dev_prefix) +int Image::disk_attribute( VectorAttribute * disk, + ImageType& img_type, + string& dev_prefix, + const vector& inherit_attrs) { string target; string driver; string disk_attr_type; + string inherit_val; bool ro; ostringstream iid; + vector::const_iterator it; + img_type = type; target = disk->vector_value("TARGET"); driver = disk->vector_value("DRIVER"); @@ -614,6 +618,16 @@ int Image::disk_attribute( VectorAttribute * disk, disk->replace("TARGET", template_target); } + for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++) + { + get_template_attribute((*it).c_str(), inherit_val); + + if (!inherit_val.empty()) + { + disk->replace(*it, inherit_val); + } + } + return 0; } diff --git a/src/image/ImagePool.cc b/src/image/ImagePool.cc index ad2f871f76..b2f7cff44d 100644 --- a/src/image/ImagePool.cc +++ b/src/image/ImagePool.cc @@ -31,20 +31,38 @@ string ImagePool::_default_dev_prefix; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -ImagePool::ImagePool(SqlDB * db, - const string& __default_type, - const string& __default_dev_prefix, - vector& restricted_attrs, - vector hook_mads, - const string& remotes_location) +ImagePool::ImagePool( + SqlDB * db, + const string& __default_type, + const string& __default_dev_prefix, + vector& restricted_attrs, + vector hook_mads, + const string& remotes_location, + const vector& _inherit_image_attrs, + const vector& _inherit_datastore_attrs) :PoolSQL(db, Image::table, true) { - ostringstream sql; - // Init static defaults _default_type = __default_type; _default_dev_prefix = __default_dev_prefix; + // Init inherit attributes + vector::const_iterator it; + + for (it = _inherit_image_attrs.begin(); it != _inherit_image_attrs.end(); it++) + { + const SingleAttribute* sattr = static_cast(*it); + + inherit_image_attrs.push_back(sattr->value()); + } + + for (it = _inherit_datastore_attrs.begin(); it != _inherit_datastore_attrs.end(); it++) + { + const SingleAttribute* sattr = static_cast(*it); + + inherit_datastore_attrs.push_back(sattr->value()); + } + // Set default type if (_default_type != "OS" && _default_type != "CDROM" && @@ -385,7 +403,7 @@ int ImagePool::disk_attribute(int vm_id, Datastore * ds; iid = img->get_oid(); - rc = img->disk_attribute(disk, img_type, dev_prefix); + rc = img->disk_attribute(disk, img_type, dev_prefix, inherit_image_attrs); image_id = img->get_oid(); datastore_id = img->get_ds_id(); @@ -410,7 +428,7 @@ int ImagePool::disk_attribute(int vm_id, return -1; } - ds->disk_attribute(disk); + ds->disk_attribute(disk, inherit_datastore_attrs); ds->unlock(); } diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 9164560e8f..c7d330d582 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -555,6 +555,10 @@ void Nebula::start(bool bootstrap_only) vector vm_restricted_attrs; vector img_restricted_attrs; + vector inherit_image_attrs; + vector inherit_datastore_attrs; + vector inherit_vnet_attrs; + clpool = new ClusterPool(db); docpool = new DocumentPool(db); @@ -568,6 +572,10 @@ void Nebula::start(bool bootstrap_only) nebula_configuration->get("VM_RESTRICTED_ATTR", vm_restricted_attrs); nebula_configuration->get("IMAGE_RESTRICTED_ATTR", img_restricted_attrs); + nebula_configuration->get("INHERIT_IMAGE_ATTR", inherit_image_attrs); + nebula_configuration->get("INHERIT_DATASTORE_ATTR", inherit_datastore_attrs); + nebula_configuration->get("INHERIT_VNET_ATTR", inherit_vnet_attrs); + nebula_configuration->get("VM_MONITORING_EXPIRATION_TIME",vm_expiration); nebula_configuration->get("HOST_MONITORING_EXPIRATION_TIME",host_expiration); @@ -593,7 +601,8 @@ void Nebula::start(bool bootstrap_only) mac_prefix, size, vnet_hooks, - remotes_location); + remotes_location, + inherit_vnet_attrs); gpool = new GroupPool(db, group_hooks, remotes_location); @@ -609,7 +618,9 @@ void Nebula::start(bool bootstrap_only) default_device_prefix, img_restricted_attrs, image_hooks, - remotes_location); + remotes_location, + inherit_image_attrs, + inherit_datastore_attrs); tpool = new VMTemplatePool(db); diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc index aa7b7ef23c..eeca10cf11 100644 --- a/src/vnm/VirtualNetwork.cc +++ b/src/vnm/VirtualNetwork.cc @@ -706,18 +706,24 @@ int VirtualNetwork::from_xml(const string &xml_str) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int VirtualNetwork::nic_attribute(VectorAttribute *nic, int vid) +int VirtualNetwork::nic_attribute( + VectorAttribute * nic, + int vid, + const vector& inherit_attrs) { int rc; string ip; string mac; + string inherit_val; unsigned int eui64[2]; unsigned int prefix[2] = {0, 0}; ostringstream oss; + vector::const_iterator it; + ip = nic->vector_value("IP"); oss << oid; @@ -792,6 +798,16 @@ int VirtualNetwork::nic_attribute(VectorAttribute *nic, int vid) nic->replace("CLUSTER_ID", oss.str()); } + for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++) + { + get_template_attribute((*it).c_str(), inherit_val); + + if (!inherit_val.empty()) + { + nic->replace(*it, inherit_val); + } + } + return 0; } diff --git a/src/vnm/VirtualNetworkPool.cc b/src/vnm/VirtualNetworkPool.cc index 44e49958b3..87734657dc 100644 --- a/src/vnm/VirtualNetworkPool.cc +++ b/src/vnm/VirtualNetworkPool.cc @@ -32,11 +32,12 @@ unsigned int VirtualNetworkPool::_default_size; /* -------------------------------------------------------------------------- */ VirtualNetworkPool::VirtualNetworkPool( - SqlDB * db, - const string& prefix, - int __default_size, - vector hook_mads, - const string& remotes_location): + SqlDB * db, + const string& prefix, + int __default_size, + vector hook_mads, + const string& remotes_location, + const vector& _inherit_attrs): PoolSQL(db, VirtualNetwork::table, true) { istringstream iss; @@ -44,6 +45,8 @@ VirtualNetworkPool::VirtualNetworkPool( int count = 0; unsigned int tmp; + vector::const_iterator it; + string mac = prefix; _mac_prefix = 0; @@ -71,6 +74,13 @@ VirtualNetworkPool::VirtualNetworkPool( _mac_prefix += tmp; register_hooks(hook_mads, remotes_location); + + for (it = _inherit_attrs.begin(); it != _inherit_attrs.end(); it++) + { + const SingleAttribute* sattr = static_cast(*it); + + inherit_attrs.push_back(sattr->value()); + } } /* -------------------------------------------------------------------------- */ @@ -250,7 +260,7 @@ int VirtualNetworkPool::nic_attribute(VectorAttribute * nic, return -1; } - int rc = vnet->nic_attribute(nic,vid); + int rc = vnet->nic_attribute(nic, vid, inherit_attrs); if ( rc == 0 ) { From 5abd430094bb6e2e57756431d04fa9e99522e8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 14 Nov 2013 15:28:04 +0100 Subject: [PATCH 40/57] Bug #2047: Add NIC/BRIDGE as a default restricted attribute (cherry picked from commit 964def4bc3a72aa1f7be7b4e892dc902dd6db254) --- share/etc/oned.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 39d87509c0..e118dfb459 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -666,6 +666,7 @@ DEFAULT_UMASK = 177 VM_RESTRICTED_ATTR = "CONTEXT/FILES" VM_RESTRICTED_ATTR = "NIC/MAC" VM_RESTRICTED_ATTR = "NIC/VLAN_ID" +VM_RESTRICTED_ATTR = "NIC/BRIDGE" #VM_RESTRICTED_ATTR = "RANK" #VM_RESTRICTED_ATTR = "SCHED_RANK" From 3675520470b9b746ce40308cf11ba96626323f82 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 15:54:33 +0100 Subject: [PATCH 41/57] bug #2255: Fix bug when a tag contains double quotes in the user template info panel (cherry picked from commit 3f6716bb0308d616f8ef458d9793760c5dd6dcc7) --- src/sunstone/public/js/sunstone-util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 1641c756bc..c107bf84ea 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -1930,7 +1930,8 @@ function insert_extended_template_table(template_json,resource_type,resource_id, var key_str=this.firstElementChild.id.substring(9,this.firstElementChild.id.length); var value_str = $("#value_td_input_"+key_str).text(); - $("#value_td_input_"+key_str).html(''); + input = $("#value_td_input_"+key_str).html(''); + $('#input_edit_'+key_str).val(value_str); }); From 88f9d5d7bcaca2d4cb2b6887d1e1f4527c89c3fd Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 15:53:51 +0100 Subject: [PATCH 42/57] bug #2255: Escape double quotes provided in an input text in Sunstone template wizard (cherry picked from commit b501d34fc3ea8145ef83436586f471877d606b63) --- .../models/OpenNebulaJSON/TemplateJSON.rb | 4 ---- .../public/js/plugins/templates-tab.js | 20 ++++++------------- src/sunstone/public/js/sunstone-util.js | 3 +-- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb index cf58644bef..d4dbfc423a 100644 --- a/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/TemplateJSON.rb @@ -65,10 +65,6 @@ module OpenNebulaJSON template = template_to_str(template_hash) end - # Substitue single quotes (not supported by ONE core) - # with \" (supported) - template.gsub!(/'/,"\\\"") - super(template) end diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 91da665a3c..94c41ef7e6 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -4148,16 +4148,12 @@ function setupCreateTemplateDialog(){ // // RAW // - function addslashes( str ) { - return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); - } - vm_json["RAW"] = {} - t = addslashes($('#raw_type', dialog).val()); + t = $('#raw_type', dialog).val(); if (t) { vm_json["RAW"]['TYPE'] = t; } - t = addslashes($('#raw_data', dialog).val()); + t = escapeDoubleQuotes($('#raw_data', dialog).val()); if (t) { vm_json["RAW"]['DATA'] = t; } - t = addslashes($('#raw_data_vmx', dialog).val()); + t = escapeDoubleQuotes($('#raw_data_vmx', dialog).val()); if (t) { vm_json["RAW"]['DATA_VMX'] = t; } $('#custom_tags tr', $('li#rawTab')).each(function(){ @@ -4199,8 +4195,6 @@ function setupCreateTemplateDialog(){ vm_json = {vmtemplate: vm_json}; vm_json =JSON.stringify(vm_json); - vm_json=vm_json.replace(/\\\"/g,"'"); - Sunstone.runAction("Template.update",template_to_update_id,vm_json); $create_template_dialog.trigger("reveal:close") @@ -4215,8 +4209,6 @@ function setupCreateTemplateDialog(){ template = {"vmtemplate": {"template_raw": template}}; var vm_json = JSON.stringify(template); - vm_json=vm_json.replace(/\\\"/g,"'"); - Sunstone.runAction("Template.update",template_to_update_id,vm_json); $create_template_dialog.trigger("reveal:close") @@ -4901,10 +4893,10 @@ function fillTemplatePopUp(request, response){ return $('
').html(value).text(); } - $('#raw_type', raw_section).val(htmlDecode(raw['TYPE'])); + $('#raw_type', raw_section).val(raw['TYPE']); $('#raw_type', raw_section).change(); - $('#raw_data', raw_section).val(htmlDecode(raw['DATA'])); - $('#raw_data_vmx', raw_section).val(htmlDecode(raw['DATA_VMX'])); + $('#raw_data', raw_section).val(raw['DATA']); + $('#raw_data_vmx', raw_section).val(raw['DATA_VMX']); delete template.RAW } diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index c107bf84ea..d4f8311ca5 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -736,8 +736,7 @@ function makeSelectOptions(dataTable, //Escape doublequote in a string and return it function escapeDoubleQuotes(string){ - string = string.replace(/\\"/g,'"'); - return string.replace(/"/g,'\\"'); + return string.replace(/\\/g,'\\').replace(/"/g,'\\"'); } function derivative(data) { From 7fd7cbad4415c621493db5d33e5ad07265261614 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 16:25:46 +0100 Subject: [PATCH 43/57] feature #2445: Include SCHED_DS_REQUIREMENTS in the placement tab for each VM(cherry picked from commit 26f2e7e0da69d862cf310866cfbe6469e291c814) --- src/sunstone/public/js/plugins/vms-tab.js | 45 +++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 1ea1f9b0dc..22c455ced2 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -1339,37 +1339,48 @@ function updateVMachinesView(request, vmachine_list){ // Some calculations are performed, inspired from what is done // in the CLI function generatePlacementTable(vm){ - var requirements_str = "-"; - var rank_str = "-"; + var requirements_str = vm.USER_TEMPLATE.SCHED_REQUIREMENTS ? vm.USER_TEMPLATE.SCHED_REQUIREMENTS : "-"; + var rank_str = vm.USER_TEMPLATE.SCHED_RANK ? vm.USER_TEMPLATE.SCHED_RANK : "-"; + var ds_requirements_str = vm.USER_TEMPLATE.SCHED_DS_REQUIREMENTS ? vm.USER_TEMPLATE.SCHED_DS_REQUIREMENTS : "-"; + var ds_rank_str = vm.USER_TEMPLATE.SCHED_DS_RANK ? vm.USER_TEMPLATE.SCHED_DS_RANK : "-"; - if (vm.USER_TEMPLATE.SCHED_REQUIREMENTS) - { - requirements_str = vm.USER_TEMPLATE.SCHED_REQUIREMENTS; - } - - if (vm.USER_TEMPLATE.SCHED_RANK) - { - rank_str = vm.USER_TEMPLATE.SCHED_RANK; - } var html = '
\ \ \ \ - \ + \ \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \
'+tr("Placement")+''+tr("Placement - Host")+'
REQUIREMENTS'+ tr("Requirements")+''+requirements_str+'
RANK'+ tr("Rank")+''+rank_str+'
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("Placement - Datastore")+'
'+ tr("DS Requirements")+''+ds_requirements_str+'
'+ tr("DS Rank")+''+ds_rank_str+'
\
\
\ \ @@ -1392,7 +1403,11 @@ function generatePlacementTable(vm){ history = vm.HISTORY_RECORDS.HISTORY; else if (vm.HISTORY_RECORDS.HISTORY.SEQ) history = [vm.HISTORY_RECORDS.HISTORY]; - }; + } else { + html += ' \ + \ + ' + } var now = Math.round(new Date().getTime() / 1000); From c569622a96497f996637a5ca26b7d8585af675d3 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 14 Nov 2013 16:58:28 +0100 Subject: [PATCH 44/57] bug #1757: add vncunused to xen deployment --- src/vmm/XenDriver.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmm/XenDriver.cc b/src/vmm/XenDriver.cc index bf6512d3de..2f852e4283 100644 --- a/src/vmm/XenDriver.cc +++ b/src/vmm/XenDriver.cc @@ -454,6 +454,7 @@ int XenDriver::deployment_description( goto error_vncdisplay; } + file << ",vncunused=0"; file << ",vncdisplay=" << display - 5900; } From dd60e0bd46ab334c3d548e57615e6a5db8466e17 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 17:04:43 +0100 Subject: [PATCH 45/57] bug #2443: Update storage information for System datastore in info panel (cherry picked from commit 4274ce545f956028053c009f2df00f1316e7c983) --- src/sunstone/public/js/plugins/datastores-tab.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 39e4245e61..ccb19294fb 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -740,7 +740,7 @@ function updateDatastoreInfo(request,ds){ cluster_str = insert_cluster_dropdown("Datastore",info.ID,info.CLUSTER,info.CLUSTER_ID); } - var is_system = (info.TYPE == 1) + var is_system_ssh = (info.TEMPLATE.SHARED == "NO") var info_tab_content = '
\
\ @@ -773,15 +773,15 @@ function updateDatastoreInfo(request,ds){
\\ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
'+tr("No data avialable in table")+'
'+tr("Capacity")+'
' + tr("Total") + ''+(is_system ? '-' : humanize_size_from_mb(info.TOTAL_MB))+''+(is_system_ssh ? '-' : humanize_size_from_mb(info.TOTAL_MB))+'
' + tr("Used") + ''+(is_system ? '-' : humanize_size_from_mb(info.USED_MB))+''+(is_system_ssh ? '-' : humanize_size_from_mb(info.USED_MB))+'
' + tr("Free") + ''+(is_system ? '-' : humanize_size_from_mb(info.FREE_MB))+''+(is_system_ssh ? '-' : humanize_size_from_mb(info.FREE_MB))+'
' From 0546c7e77a2d1d51b23b95b5b239e93b6701cf3f Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 14 Nov 2013 17:10:44 +0100 Subject: [PATCH 46/57] feature-2460: Initial take to iSCSI removal. It will be an addon from now on. https://github.com/OpenNebula/addon-iscsi/ --- install.sh | 31 --- share/doc/xsd/oned.conf | 11 +- share/etc/oned.conf | 11 +- share/scripts/tgt/tgt-setup-lun-one | 279 --------------------- src/datastore_mad/remotes/iscsi/clone | 97 ------- src/datastore_mad/remotes/iscsi/cp | 131 ---------- src/datastore_mad/remotes/iscsi/iscsi.conf | 29 --- src/datastore_mad/remotes/iscsi/mkfs | 99 -------- src/datastore_mad/remotes/iscsi/monitor | 86 ------- src/datastore_mad/remotes/iscsi/rm | 85 ------- src/datastore_mad/remotes/iscsi/stat | 1 - src/mad/sh/scripts_common.sh | 3 + src/oca/java/test/oned.conf | 11 +- src/tm_mad/iscsi/clone | 118 --------- src/tm_mad/iscsi/cpds | 92 ------- src/tm_mad/iscsi/delete | 133 ---------- src/tm_mad/iscsi/ln | 83 ------ src/tm_mad/iscsi/mv | 142 ----------- src/tm_mad/iscsi/mvds | 119 --------- src/tm_mad/iscsi/postmigrate | 1 - src/tm_mad/iscsi/premigrate | 1 - 21 files changed, 9 insertions(+), 1554 deletions(-) delete mode 100755 share/scripts/tgt/tgt-setup-lun-one delete mode 100755 src/datastore_mad/remotes/iscsi/clone delete mode 100755 src/datastore_mad/remotes/iscsi/cp delete mode 100644 src/datastore_mad/remotes/iscsi/iscsi.conf delete mode 100755 src/datastore_mad/remotes/iscsi/mkfs delete mode 100755 src/datastore_mad/remotes/iscsi/monitor delete mode 100755 src/datastore_mad/remotes/iscsi/rm delete mode 120000 src/datastore_mad/remotes/iscsi/stat delete mode 100755 src/tm_mad/iscsi/clone delete mode 100755 src/tm_mad/iscsi/cpds delete mode 100755 src/tm_mad/iscsi/delete delete mode 100755 src/tm_mad/iscsi/ln delete mode 100755 src/tm_mad/iscsi/mv delete mode 100755 src/tm_mad/iscsi/mvds delete mode 120000 src/tm_mad/iscsi/postmigrate delete mode 120000 src/tm_mad/iscsi/premigrate diff --git a/install.sh b/install.sh index b07d10f9c1..147f41b81c 100755 --- a/install.sh +++ b/install.sh @@ -224,7 +224,6 @@ else fi SHARE_DIRS="$SHARE_LOCATION/examples \ - $SHARE_LOCATION/tgt \ $SHARE_LOCATION/websockify" ETC_DIRS="$ETC_LOCATION/vmm_exec \ @@ -288,7 +287,6 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/tm/qcow2 \ $VAR_LOCATION/remotes/tm/ssh \ $VAR_LOCATION/remotes/tm/vmfs \ - $VAR_LOCATION/remotes/tm/iscsi \ $VAR_LOCATION/remotes/tm/lvm \ $VAR_LOCATION/remotes/tm/ceph \ $VAR_LOCATION/remotes/hooks \ @@ -297,7 +295,6 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/datastore/dummy \ $VAR_LOCATION/remotes/datastore/fs \ $VAR_LOCATION/remotes/datastore/vmfs \ - $VAR_LOCATION/remotes/datastore/iscsi \ $VAR_LOCATION/remotes/datastore/lvm \ $VAR_LOCATION/remotes/datastore/ceph \ $VAR_LOCATION/remotes/auth \ @@ -474,7 +471,6 @@ INSTALL_FILES=( TM_QCOW2_FILES:$VAR_LOCATION/remotes/tm/qcow2 TM_SSH_FILES:$VAR_LOCATION/remotes/tm/ssh TM_VMFS_FILES:$VAR_LOCATION/remotes/tm/vmfs - TM_ISCSI_FILES:$VAR_LOCATION/remotes/tm/iscsi TM_LVM_FILES:$VAR_LOCATION/remotes/tm/lvm TM_CEPH_FILES:$VAR_LOCATION/remotes/tm/ceph TM_DUMMY_FILES:$VAR_LOCATION/remotes/tm/dummy @@ -482,7 +478,6 @@ INSTALL_FILES=( DATASTORE_DRIVER_DUMMY_SCRIPTS:$VAR_LOCATION/remotes/datastore/dummy DATASTORE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/datastore/fs DATASTORE_DRIVER_VMFS_SCRIPTS:$VAR_LOCATION/remotes/datastore/vmfs - DATASTORE_DRIVER_ISCSI_SCRIPTS:$VAR_LOCATION/remotes/datastore/iscsi DATASTORE_DRIVER_LVM_SCRIPTS:$VAR_LOCATION/remotes/datastore/lvm DATASTORE_DRIVER_CEPH_SCRIPTS:$VAR_LOCATION/remotes/datastore/ceph NETWORK_FILES:$VAR_LOCATION/remotes/vnm @@ -494,7 +489,6 @@ INSTALL_FILES=( NETWORK_OVSWITCH_BRCOMPAT_FILES:$VAR_LOCATION/remotes/vnm/ovswitch_brcompat NETWORK_VMWARE_FILES:$VAR_LOCATION/remotes/vnm/vmware EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples - TGT_SHARE_FILES:$SHARE_LOCATION/tgt WEBSOCKIFY_SHARE_FILES:$SHARE_LOCATION/websockify INSTALL_GEMS_SHARE_FILE:$SHARE_LOCATION HOOK_FT_FILES:$VAR_LOCATION/remotes/hooks/ft @@ -984,7 +978,6 @@ NETWORK_VMWARE_FILES="src/vnm_mad/remotes/vmware/clean \ # - SSH TM, $VAR_LOCATION/tm/ssh # - DUMMY TM, $VAR_LOCATION/tm/dummy # - VMWARE TM, $VAR_LOCATION/tm/vmware -# - ISCSI TM, $VAR_LOCATION/tm/iscsi # - LVM TM, $VAR_LOCATION/tm/lvm # - CEPH TM, $VAR_LOCATION/tm/ceph #------------------------------------------------------------------------------- @@ -1060,15 +1053,6 @@ TM_VMFS_FILES="src/tm_mad/vmfs/clone \ src/tm_mad/vmfs/postmigrate \ src/tm_mad/vmfs/premigrate" -TM_ISCSI_FILES="src/tm_mad/iscsi/clone \ - src/tm_mad/iscsi/ln \ - src/tm_mad/iscsi/mv \ - src/tm_mad/iscsi/mvds \ - src/tm_mad/iscsi/cpds \ - src/tm_mad/iscsi/premigrate \ - src/tm_mad/iscsi/postmigrate \ - src/tm_mad/iscsi/delete" - TM_LVM_FILES="src/tm_mad/lvm/clone \ src/tm_mad/lvm/ln \ src/tm_mad/lvm/mv \ @@ -1092,7 +1076,6 @@ TM_CEPH_FILES="src/tm_mad/ceph/clone \ # - Dummy Image Repository, $REMOTES_LOCATION/datastore/dummy # - FS based Image Repository, $REMOTES_LOCATION/datastore/fs # - VMFS based Image Repository, $REMOTES_LOCATION/datastore/vmfs -# - iSCSI based Image Repository, $REMOTES_LOCATION/datastore/iscsi # - LVM based Image Repository, $REMOTES_LOCATION/datastore/lvm #------------------------------------------------------------------------------- @@ -1122,14 +1105,6 @@ DATASTORE_DRIVER_VMFS_SCRIPTS="src/datastore_mad/remotes/vmfs/cp \ src/datastore_mad/remotes/vmfs/rm \ src/datastore_mad/remotes/vmfs/vmfs.conf" -DATASTORE_DRIVER_ISCSI_SCRIPTS="src/datastore_mad/remotes/iscsi/cp \ - src/datastore_mad/remotes/iscsi/mkfs \ - src/datastore_mad/remotes/iscsi/stat \ - src/datastore_mad/remotes/iscsi/rm \ - src/datastore_mad/remotes/iscsi/clone \ - src/datastore_mad/remotes/iscsi/monitor \ - src/datastore_mad/remotes/iscsi/iscsi.conf" - DATASTORE_DRIVER_LVM_SCRIPTS="src/datastore_mad/remotes/lvm/cp \ src/datastore_mad/remotes/lvm/mkfs \ src/datastore_mad/remotes/lvm/stat \ @@ -1229,12 +1204,6 @@ EXAMPLE_SHARE_FILES="share/examples/vm.template \ share/examples/private.net \ share/examples/public.net" -#------------------------------------------------------------------------------- -# File required to interact with a tgtd server -#------------------------------------------------------------------------------- - -TGT_SHARE_FILES="share/scripts/tgt/tgt-setup-lun-one" - #------------------------------------------------------------------------------- # Files required to interact with the websockify server #------------------------------------------------------------------------------- diff --git a/share/doc/xsd/oned.conf b/share/doc/xsd/oned.conf index 0b76bc14a9..db09c45fc8 100644 --- a/share/doc/xsd/oned.conf +++ b/share/doc/xsd/oned.conf @@ -369,7 +369,7 @@ VM_MAD = [ name="dummy", executable="one_vmm_dummy", type="xml" ] TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,iscsi,ceph" + arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,ceph" ] TM_MAD_CONF = [ @@ -421,13 +421,6 @@ TM_MAD_CONF = [ shared = "yes" ] -TM_MAD_CONF = [ - name = "iscsi", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - TM_MAD_CONF = [ name = "ceph", ln_target = "NONE", @@ -450,7 +443,7 @@ TM_MAD_CONF = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d dummy,fs,vmfs,iscsi,lvm,ceph" + arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph" ] #******************************************************************************* diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 39d87509c0..4e0ca3983f 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -390,7 +390,7 @@ VM_MAD = [ TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,iscsi,ceph" + arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph" ] TM_MAD_CONF = [ @@ -442,13 +442,6 @@ TM_MAD_CONF = [ shared = "yes" ] -TM_MAD_CONF = [ - name = "iscsi", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - TM_MAD_CONF = [ name = "ceph", ln_target = "NONE", @@ -471,7 +464,7 @@ TM_MAD_CONF = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d dummy,fs,vmfs,iscsi,lvm,ceph" + arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph" ] #******************************************************************************* diff --git a/share/scripts/tgt/tgt-setup-lun-one b/share/scripts/tgt/tgt-setup-lun-one deleted file mode 100755 index faf08949b5..0000000000 --- a/share/scripts/tgt/tgt-setup-lun-one +++ /dev/null @@ -1,279 +0,0 @@ -#!/bin/bash - -# LUN assignment script -# -# Copyright (C) 2007 Erez Zilber -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, version 2 of the -# License. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA - -usage() -{ - name=$(basename $0); - echo "usage:"; - echo -e "\t$name -n tgt_name -d dev -b bs_name -t transport [initiator_IP1 initiator_IP2 ...]"; - echo "defaults:"; - echo -e "\tbacking store: rdwr"; - echo -e "\ttransport: iscsi"; - echo -e "\tinitiator: ALL"; - echo "examples:"; - echo -e "\t$name -n tgt-1 -d /dev/sdb1 192.168.1.2"; - echo -e "\t$name -n tgt-2 -d /tmp/null -b null -t iser"; - echo -e "\t$name -n tgt-3 -d ~/disk3.bin -b rdwr 192.168.1.2 192.168.1.3"; -} - -verify_params() -{ - if ! [ "$dev" -o "$bs_type" == "null" ]; then - echo "Error: a device is mandatory"; - exit 1; - else - return; - fi - - # Make sure that the device exists - if ! [ -b $dev -o -f $dev -o -c $dev ]; then - echo "Error: $dev is not a device"; - exit 1; - fi - - if ! [ "$tgt_name" ]; then - echo "Error: target name is mandatory"; - exit 1; - fi - - if ! [ "$lld_name" ]; then - echo "Error: lld name empty"; - exit 1; - fi -} - -find_vacant_tgt_id() -{ - tmp_file=`mktemp` - tgtadm --lld $lld_name --op show --mode target | strings > $tmp_file - id_list=$(cat $tmp_file | grep Target | cut -d" " -f2 | sed s/://) - next_vacant_id=1 - for id in $id_list; do - if (($id > $next_vacant_id)); then - break; - else - next_vacant_id=$((next_vacant_id+1)) - fi - done - rm -f $tmp_file - echo $next_vacant_id -} - -find_vacant_lun() -{ - tid=$1 - tgt_found=0 - next_vacant_lun=0 - tmp_file=`mktemp` - - tgtadm --lld $lld_name --op show --mode target | strings | tgt-admin -s | grep 'LUN\|Target' > $tmp_file - retcode=$? - while read line; do - # Check if we finished going over this target - if ((tgt_found == 1 && $(echo $line | grep -c "^Target") == 1)); then - break - fi - - # Check if we found the requested target - if (($(echo $line | grep -c "Target $tid:") == 1)); then - tgt_found=1 - continue - fi - - if ((tgt_found == 1 && $(echo $line | grep -c "LUN:") == 1)); then - curr_lun=$(echo $line | cut -d" " -f2) - if (($curr_lun > $next_vacant_lun)); then - break - else - next_vacant_lun=$((next_vacant_lun+1)) - fi - fi - done < $tmp_file - - rm -f $tmp_file - - if ((tgt_found == 0)); then - echo "Error: could not find a LUN for target $tid, guessing 1 as next vacant LUN" - return 1 - fi - if ((next_vacant_lun == 0)); then - echo "Error: could not find a LUN for target $tid, guessing 1 as next vacant LUN" - return 1 - fi - - return $next_vacant_lun -} - -err_exit() -{ - if ((new_tgt == 0)); then - exit 1 - fi - - echo "Deleting new target, tid=$tid" - tgtadm --lld $lld_name --op delete --mode target --tid $tid - res=$? - - if [ $res -ne 0 ]; then - echo "Error: failed to delete target, tid=$tid" - fi - - exit 1 -} - -check_if_tgt_exists() -{ - tgt_list=$(tgtadm --lld $lld_name --op show --mode target | strings | grep Target | cut -d" " -f3) - - for curr_tgt in $tgt_list; do - if [ $tgt_name = $curr_tgt ]; then - return 1 - fi - done - - return 0 -} - -if [ $# -eq 0 ]; then - usage - exit 1 -fi - -lld_name="iscsi" - -while getopts "d:n:b:t:h:" opt -do - case ${opt} in - d) - dev=$OPTARG;; - n) - tgt_name=$OPTARG;; - b) - bs_type=$OPTARG;; - t) - lld_name=$OPTARG;; - h*) - usage - exit 1 - esac -done - -shift $(($OPTIND - 1)) - -initiators=$* - -verify_params - -# Check if tgtd is running (we should have 2 daemons) -tgtd_count=`pidof tgtd | wc -w` -if [ $tgtd_count -lt 1 ]; then - echo "tgtd is not running" - echo "Exiting..." - exit 1 -fi - -echo "Using transport: $lld_name" - -if ! [[ $tgt_name =~ ^iqn ]]; then - tgt_name="iqn.2001-04.com.$(hostname -s)-$tgt_name" -fi - -# Make sure that a target with the same name doesn't exist -check_if_tgt_exists -if [ $? -eq 1 ]; then - echo "Error: target named $tgt_name already exists" - read -p "Add a new lun to the existing target? (yes/NO): " add_lun - if [ $add_lun != "yes" ]; then - exit 1 - fi - tid=$(tgtadm --lld $lld_name --op show --mode target | strings | grep $tgt_name | cut -d" " -f2) - tid=${tid%:} - new_tgt=0 -else - - i=0 - while [ true ] - do - let i=i+1 - tid=`find_vacant_tgt_id` - #tid=$? - # Create the new target - echo -n "Creating new target (name=$tgt_name, tid=$tid)..." - tgtoutput=`tgtadm --lld $lld_name --op new --mode target --tid $tid -T $tgt_name 2>&1` - res=$? - if [ "$tgtoutput" == "tgtadm: this target already exists" ]; then - echo "Target already exists (this should not happen)... Attempt $i" - elif [ $res -eq 0 ]; then # output is not about duplication and return value is zero, this is the normal condition - break - fi - if [ $i -eq 100 ]; then - echo "Too many attempts, giving up" - break - fi - done - if [ $res -ne 0 ]; then - echo "Error: failed to create target (name=$tgt_name, tid=$tid)" - exit 1 - fi - new_tgt=1 -fi -echo "OK" -find_vacant_lun $tid -lun=$? -echo "LUN ok, $lun" - -# Add a logical unit to the target -echo "Adding a logical unit ($dev) to target, tid=$tid" -if [ $bs_type ]; then - echo "Setting backing store type: $bs_type" - bs_opt="-E $bs_type" -fi -tgtadm --lld $lld_name --op new --mode logicalunit --tid $tid --lun $lun -b $dev $bs_opt -res=$? - -if [ $res -ne 0 ]; then - echo "Error: failed to add a logical unit ($dev) to target, tid=$tid" - err_exit -fi - -# Define which initiators can use this target -if test "$initiators" ; then - # Allow access only for specific initiators - echo "Accepting connections only from $initiators" - for initiator in $initiators; do - tgtadm --lld $lld_name --op bind --mode target --tid $tid -I $initiator - res=$? - - if [ $res -ne 0 ]; then - echo "Error: could not assign initiator $initiator to the target" - fi - done -else - # Allow access for everyone - echo "Accepting connections from all initiators" - tgtadm --lld $lld_name --op bind --mode target --tid $tid -I ALL - res=$? - - if [ $res -ne 0 ]; then - echo "Error: failed to set access for all initiators" - err_exit - fi -fi diff --git a/src/datastore_mad/remotes/iscsi/clone b/src/datastore_mad/remotes/iscsi/clone deleted file mode 100755 index f0bbabf70b..0000000000 --- a/src/datastore_mad/remotes/iscsi/clone +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# -------------------------------------------------------------------------- # -# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -#--------------------------------------------------------------------------- # - -############################################################################### -# This script is used to copy a VM image (SRC) to the image repository as DST -# Several SRC types are supported -############################################################################### -# -------- Set up the environment to source common tools & conf ------------ -if [ -z "${ONE_LOCATION}" ]; then - LIB_LOCATION=/usr/lib/one -else - LIB_LOCATION=$ONE_LOCATION/lib -fi - -. $LIB_LOCATION/sh/scripts_common.sh - -DRIVER_PATH=$(dirname $0) -source ${DRIVER_PATH}/../libfs.sh -source ${DRIVER_PATH}/iscsi.conf - -# -------- Get cp and datastore arguments from OpenNebula core ------------ - -DRV_ACTION=$1 -ID=$2 - -XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" - -unset i j XPATH_ELEMENTS - -while IFS= read -r -d '' element; do - XPATH_ELEMENTS[i++]="$element" -done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ - /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ - /DS_DRIVER_ACTION_DATA/IMAGE/SIZE) - -BASE_PATH="${XPATH_ELEMENTS[j++]}" -RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" -SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" -VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" -BASE_IQN="${XPATH_ELEMENTS[j++]:-$BASE_IQN}" -SRC="${XPATH_ELEMENTS[j++]}" -SIZE="${XPATH_ELEMENTS[j++]}" - -DST_HOST=`get_destination_host $ID` - -if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'BRIDGE_LIST' attribute." - exit -1 -fi - -# Check if 'TGTSETUPLUN' is installed -tgt_setup_lun_install "$DST_HOST" "$BASE_PATH" - -set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" - -LV_NAME="lv-one-${ID}" -IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME" -DEV="/dev/$VG_NAME/$LV_NAME" - -LV_SRC=$(echo $SRC|awk -F. '{print $NF}') -DEV_SRC="/dev/$VG_NAME/$LV_SRC" - -CLONE_CMD=$(cat <&1) -MONITOR_STATUS=$? - -if [ "$MONITOR_STATUS" = "0" ]; then - echo "$MONITOR_DATA" | tr ' ' '\n' -else - echo "$MONITOR_DATA" - exit $MONITOR_STATUS -fi diff --git a/src/datastore_mad/remotes/iscsi/rm b/src/datastore_mad/remotes/iscsi/rm deleted file mode 100755 index ff244fa94c..0000000000 --- a/src/datastore_mad/remotes/iscsi/rm +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -# -------------------------------------------------------------------------- # -# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -#--------------------------------------------------------------------------- # - -############################################################################### -# This script is used to remove a VM image (SRC) from the image repository -############################################################################### - -# ------------ Set up the environment to source common tools ------------ -if [ -z "${ONE_LOCATION}" ]; then - LIB_LOCATION=/usr/lib/one -else - LIB_LOCATION=$ONE_LOCATION/lib -fi - -. $LIB_LOCATION/sh/scripts_common.sh - -DRIVER_PATH=$(dirname $0) -source ${DRIVER_PATH}/../libfs.sh -source ${DRIVER_PATH}/iscsi.conf - -# -------- Get rm and datastore arguments from OpenNebula core ------------ - -DRV_ACTION=$1 -ID=$2 - -XPATH="${DRIVER_PATH}/../xpath.rb -b $DRV_ACTION" - -unset i j XPATH_ELEMENTS - -while IFS= read -r -d '' element; do - XPATH_ELEMENTS[i++]="$element" -done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/SOURCE \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST) - -SRC="${XPATH_ELEMENTS[j++]}" -BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" - -DST_HOST=`get_destination_host $ID` - -if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'BRIDGE_LIST' attribute." - exit -1 -fi - -BASE_IQN=`echo $SRC|$CUT -d: -f1` -TARGET=`echo $SRC|$CUT -d: -f2` -LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'` -VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'` -DEV="/dev/$VG_NAME/$LV_NAME" - -IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME" - -RM_COMMAND=$(cat < Use a dynamically loaded scripts directory. Not removing this due +#  to iSCSI addon: https://github.com/OpenNebula/addon-iscsi + # ------------------------------------------------------------------------------ # iSCSI functions diff --git a/src/oca/java/test/oned.conf b/src/oca/java/test/oned.conf index d430843dda..7f201c4f7b 100644 --- a/src/oca/java/test/oned.conf +++ b/src/oca/java/test/oned.conf @@ -390,7 +390,7 @@ VM_MAD = [ name="dummy", executable="one_vmm_dummy", type="xml" ] TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,iscsi,ceph" + arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,ceph" ] TM_MAD_CONF = [ @@ -442,13 +442,6 @@ TM_MAD_CONF = [ shared = "yes" ] -TM_MAD_CONF = [ - name = "iscsi", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - TM_MAD_CONF = [ name = "ceph", ln_target = "NONE", @@ -471,7 +464,7 @@ TM_MAD_CONF = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d dummy,fs,vmfs,iscsi,lvm,ceph" + arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph" ] #******************************************************************************* diff --git a/src/tm_mad/iscsi/clone b/src/tm_mad/iscsi/clone deleted file mode 100755 index 9d82307a43..0000000000 --- a/src/tm_mad/iscsi/clone +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash - -# -------------------------------------------------------------------------- # -# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -#--------------------------------------------------------------------------- # - -# clone fe:SOURCE host:remote_system_ds/disk.i size vmid dsid -# - fe is the front-end hostname -# - SOURCE is the path of the disk image in the form DS_BASE_PATH/disk -# - host is the target host to deploy the VM -# - remote_system_ds is the path for the system datastore in the host -# - vmid is the id of the VM -# - dsid is the target datastore (0 is the system datastore) - -SRC=$1 -DST=$2 - -VMID=$3 -DSID=$4 - -if [ -z "${ONE_LOCATION}" ]; then - TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh -else - TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh -fi - -DRIVER_PATH=$(dirname $0) - - . $TMCOMMON - -source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf - -#------------------------------------------------------------------------------- -# Set src, dst path and dir -#------------------------------------------------------------------------------- - -TARGET=`arg_path $SRC` - -DST_PATH=`arg_path $DST` -DST_HOST=`arg_host $DST` -DST_DIR=`dirname $DST_PATH` - -#------------------------------------------------------------------------------- -# IQN and TARGETs -#------------------------------------------------------------------------------- - -IQN=$SRC -NEW_IQN=$IQN-$VMID - -VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'` -LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'` -SOURCE_DEV="/dev/$VG_NAME/$LV_NAME" - -TARGET_LV_NAME=`echo $LV_NAME-$VMID` -TARGET_DEV="/dev/${VG_NAME}/${TARGET_LV_NAME}" -TARGET_HOST="${TARGET%.$VG_NAME.$LV_NAME}" - -#------------------------------------------------------------------------------- -# Clone script -#------------------------------------------------------------------------------- - -CLONE_CMD=$(cat < vmid dsid -# - host is the target host to deploy the VM -# - remote_system_ds is the path for the system datastore in the host -# - vmid is the id of the VM -# - dsid is the target datastore (0 is the system datastore) - -DST=$1 - -VMID=$2 -DSID=$3 - -if [ -z "${ONE_LOCATION}" ]; then - TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh -else - TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh -fi - -. $TMCOMMON - -DRIVER_PATH=$(dirname $0) - -source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf - -#------------------------------------------------------------------------------- -# Return if deleting a disk, we will delete them when removing the -# remote_system_ds directory for the VM (remotely) -#------------------------------------------------------------------------------- -DST_PATH=`arg_path $DST` -DST_HOST=`arg_host $DST` - -#------------------------------------------------------------------------------- -# Get IQN information -#------------------------------------------------------------------------------- - -DISK_ID=$(echo "$DST_PATH" | $AWK -F. '{print $NF}') - -XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" - -unset i j XPATH_ELEMENTS - -while IFS= read -r -d '' element; do - XPATH_ELEMENTS[i++]="$element" -done < <(onevm show -x $VMID| $XPATH \ - /VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/SOURCE \ - /VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/PERSISTENT) - -IQN="${XPATH_ELEMENTS[j++]}" -PERSISTENT="${XPATH_ELEMENTS[j++]}" - -if [ -z "$PERSISTENT" ]; then - NEW_IQN=$IQN-$VMID -else - NEW_IQN=$IQN -fi - -TARGET=`arg_path $IQN` -VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'` -LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'` -DEV="/dev/$VG_NAME/$LV_NAME" -TARGET_HOST="${TARGET%.$VG_NAME.$LV_NAME}" - -TARGET_LV_NAME=`echo $NEW_IQN|$AWK -F. '{print $(NF)}'` - -#------------------------------------------------------------------------------- -# Remove directory if dst_path is a directory -#------------------------------------------------------------------------------- - -if [ `is_disk $DST_PATH` -eq 0 ]; then - # Directory - log "Deleting $DST_PATH" - ssh_exec_and_log "$DST_HOST" "rm -rf $DST_PATH" "Error deleting $DST_PATH" - exit 0 -fi - -#------------------------------------------------------------------------------- -# Logout from the iSCSI target in the hypervisor -#------------------------------------------------------------------------------- - -LOGOUT_CMD=$(cat < vmid dsid -# -# - hostX is the target host to deploy the VM -# - system_ds is the path for the system datastore in the host -# - vmid is the id of the VM -# - dsid is the target datastore (0 is the system datastore) - -SRC=$1 -DST=$2 - -VMID=$3 -DSID=$4 - -if [ -z "${ONE_LOCATION}" ]; then - TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh -else - TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh -fi - -. $TMCOMMON - -DRIVER_PATH=$(dirname $0) - -source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf - -#------------------------------------------------------------------------------- -# Return if moving a disk, we will move them when moving the whole system_ds -# directory for the VM -#------------------------------------------------------------------------------- -SRC_PATH=`arg_path $SRC` -DST_PATH=`arg_path $DST` - -SRC_HOST=`arg_host $SRC` -DST_HOST=`arg_host $DST` - -DST_DIR=`dirname $DST_PATH` - -if [ `is_disk $SRC_PATH` -eq 0 ]; then - ssh_make_path $DST_HOST $DST_DIR - - log "Moving $SRC to $DST" - - exec_and_log "$SCP -r $SRC $DST" "Could not copy $SRC to $DST" - - ssh_exec_and_log "$SRC_HOST" "rm -rf $SRC_PATH" \ - "Could not remove $SRC_HOST:$SRC_PATH" - - exit 0 -fi - -if [ "$SRC" == "$DST" ]; then - log "Not moving $SRC to $DST, they are the same path" - exit 0 -fi -#------------------------------------------------------------------------------- -# Get image information -#------------------------------------------------------------------------------- - -XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" - -unset i j XPATH_ELEMENTS - -DISK_ID=$(echo "$SRC_PATH" | $AWK -F. '{print $NF}') - -while IFS= read -r -d '' element; do - XPATH_ELEMENTS[i++]="$element" -done < <(onevm show -x $VMID| $XPATH \ - /VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/SOURCE \ - /VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/PERSISTENT) - -IQN="${XPATH_ELEMENTS[j++]}" -PERSISTENT="${XPATH_ELEMENTS[j++]}" - -if [ -z "$PERSISTENT" ]; then - IQN=$IQN-$VMID -fi - -#------------------------------------------------------------------------------- -# Start actions -#------------------------------------------------------------------------------- - -if is_iscsi "$SRC_HOST"; then - log "Logging out of $IQN in $SRC_HOST" - - LOGOUT_CMD=$(cat < Date: Thu, 14 Nov 2013 17:19:51 +0100 Subject: [PATCH 47/57] feature #2455: Do not recreate the vnc tokens dir if it already exists(cherry picked from commit d4cb2599620f0fab732f50be31b001de4b625347) --- src/sunstone/OpenNebulaVNC.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index 92e59c1da5..15bd2c0061 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -267,7 +267,6 @@ class OpenNebulaVNC Dir.glob("#{@token_folder}/*").each do |file| File.delete(file) end - Dir.rmdir(@token_folder) rescue => e @logger.error "Error deleting token folder" @logger.error e.message From cf4e95ab5c96b502ecad8aefcfd925228b699a9c Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 17:31:25 +0100 Subject: [PATCH 48/57] feature #2454: Add ipv6 option to novnc(cherry picked from commit 21ca0b49fc3c29bd7a2b3e9feada22d26092e1b4) --- src/sunstone/OpenNebulaVNC.rb | 6 ++++++ src/sunstone/etc/sunstone-server.conf | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index 15bd2c0061..2026cd0920 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -80,6 +80,8 @@ class OpenNebulaVNC @proxy_path = File.join(SHARE_LOCATION, "websockify/websocketproxy.py") @proxy_port = config[:vnc_proxy_port] + @proxy_ipv6 = config[:vnc_proxy_ipv6] + @wss = config[:vnc_proxy_support_wss] @lock_file = NOVNC_LOCK_FILE @@ -113,6 +115,10 @@ class OpenNebulaVNC proxy_options << " --ssl-only" if @wss == "only" end + if @proxy_ipv6 + proxy_options << " -6" + end + cmd ="python #{@proxy_path} #{proxy_options} #{@proxy_port}" begin diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 26755ed0c2..ad8a4d05d1 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -81,10 +81,12 @@ # supported. # vnc_proxy_cert: Certificate to encrypt wss connections. # vnc_proxy_key: Key for wss connections. Only necessary if not included in cert. +# vnc_proxy_ipv6: Enable ipv6 support for novnc-server :vnc_proxy_port: 29876 :vnc_proxy_support_wss: no :vnc_proxy_cert: :vnc_proxy_key: +:vnc_proxy_ipv6: false # Default language setting From 874c7da3a30d7e86f36956bdcbfa27a2892c43ca Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Nov 2013 17:44:20 +0100 Subject: [PATCH 49/57] bug #2448: In the datastores tab if you select the element 101 the action is applied to element 1(cherry picked from commit d03736ad88726ffe9e23cc50e6cbf93a3b2ffaf0) --- src/sunstone/public/js/plugins/datastores-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index ccb19294fb..feaf167988 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -497,7 +497,7 @@ var datastore_actions = { type: "multiple", call: function(params, success){ var cluster = params.data.extra_param; - var ds = params.data.id[0]; + var ds = params.data.id; if (cluster == -1){ //get cluster name From cb48e1899d015768606adfda8a493edebe2d2bf9 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 14 Nov 2013 18:46:20 +0100 Subject: [PATCH 50/57] feature-2460: Remove iSCSI from Sunstone --- .../public/js/plugins/datastores-tab.js | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 39e4245e61..9081ffa283 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -102,7 +102,6 @@ var create_datastore_tmpl = \ \ \ - \ \ \ \ @@ -191,7 +189,6 @@ var create_datastore_tmpl = \ \ \ - \ \ \ \ @@ -943,9 +940,6 @@ function setupCreateDatastoreDialog(){ case 'fs_lvm': select_fs_lvm(); break; - case 'iscsi': - select_iscsi(); - break; case 'ceph': select_ceph(); break; @@ -1099,25 +1093,6 @@ function select_vmware_vmfs(){ $('select#disk_type').attr('disabled', 'disabled'); } -function select_iscsi(){ - $('select#ds_mad').val('iscsi'); - $('select#ds_mad').attr('disabled', 'disabled'); - $('select#tm_mad').val('iscsi'); - $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); - $('label[for="base_iqn"],input#base_iqn').fadeIn(); - $('label[for="vg_name"],input#vg_name').fadeIn(); - $('select#disk_type').children('option').each(function() { - var value_str = $(this).val(); - $(this).attr('disabled', 'disabled'); - if (value_str == "file" || - value_str == "block") - { - $(this).removeAttr('disabled'); - } - }); -} - function select_ceph(){ $('select#ds_mad').val('ceph'); $('select#ds_mad').attr('disabled', 'disabled'); From 7bcefc9008f9f018b125c07f4c22a6a0477fce83 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Fri, 15 Nov 2013 11:07:22 +0100 Subject: [PATCH 51/57] Bug #2444: fs_lvm does not work with DATASTORE_LOCATION --- src/tm_mad/fs_lvm/clone | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tm_mad/fs_lvm/clone b/src/tm_mad/fs_lvm/clone index 07dd1062ac..6515661dad 100755 --- a/src/tm_mad/fs_lvm/clone +++ b/src/tm_mad/fs_lvm/clone @@ -42,13 +42,17 @@ source ${DRIVER_PATH}/../../datastore/libfs.sh # Set dst path and dir #------------------------------------------------------------------------------- -SRC_HOST=`arg_host $SRC` -SRC_PATH=`arg_path $SRC` - DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` +SRC_ARG_PATH=`arg_path $SRC` + +DST_DS_PATH="$(dirname $(dirname $(dirname $DST_PATH)))" +SRC_DS_PATH="$(dirname $(dirname $SRC_ARG_PATH))" + +SRC_PATH="${DST_DS_PATH}${SRC_ARG_PATH##$SRC_DS_PATH}" + DS_SYS_ID=$(echo $DST_DIR | $AWK -F '/' '{print $(NF-1)}') SIZE=`file_size $SRC_PATH` From 1a2b9238257c6aee1b1557b038d8357932c9cbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 15 Nov 2013 12:58:53 +0100 Subject: [PATCH 52/57] Feature #1796: Add ceph host and secret to kvm deployment files --- include/NebulaUtil.h | 18 +++++++++++ share/etc/oned.conf | 3 ++ src/common/NebulaUtil.cc | 21 +++++++++++++ src/vmm/LibVirtDriverKVM.cc | 61 +++++++++++++++++++++++++++++++------ 4 files changed, 94 insertions(+), 9 deletions(-) diff --git a/include/NebulaUtil.h b/include/NebulaUtil.h index a832f7863e..9b6af30552 100644 --- a/include/NebulaUtil.h +++ b/include/NebulaUtil.h @@ -18,6 +18,7 @@ #define _NEBULA_UTIL_H_ #include +#include namespace one_util { @@ -66,6 +67,23 @@ namespace one_util * @return a new random password */ std::string random_password(); + + /** + * Splits a string, using the given delimiter + * + * @param st string to split + * @param delim delimiter character + * @param clean_empty true to clean empty split parts. + * Example for st "a::b:c" + * clean_empty true will return ["a", "b", "c"] + * clean_empty fase will return ["a", "", "b", "c"] + * + * @return a vector containing the resulting substrings + */ + std::vector split( + const std::string& st, + char delim, + bool clean_empty=true); }; #endif /* _NEBULA_UTIL_H_ */ diff --git a/share/etc/oned.conf b/share/etc/oned.conf index fad9691843..d075be773f 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -700,3 +700,6 @@ IMAGE_RESTRICTED_ATTR = "SOURCE" #INHERIT_IMAGE_ATTR = "SECOND_EXAMPLE" #INHERIT_DATASTORE_ATTR = "COLOR" #INHERIT_VNET_ATTR = "BANDWIDTH_THROTTLING" + +INHERIT_DATASTORE_ATTR = "CEPH_HOST" +INHERIT_DATASTORE_ATTR = "CEPH_SECRET" \ No newline at end of file diff --git a/src/common/NebulaUtil.cc b/src/common/NebulaUtil.cc index e2880c9da9..10fb9714b5 100644 --- a/src/common/NebulaUtil.cc +++ b/src/common/NebulaUtil.cc @@ -217,3 +217,24 @@ string one_util::random_password() return sha1_digest(sstr.str()); } + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +vector one_util::split(const string& st, char delim, bool clean_empty) +{ + vector parts; + string part; + + stringstream ss(st); + + while (getline(ss, part, delim)) + { + if (!(clean_empty && part.empty())) + { + parts.push_back(part); + } + } + + return parts; +} diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 9db9f2bcdc..9ece6427b4 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -59,6 +59,8 @@ int LibVirtDriver::deployment_description_kvm( string disk_io = ""; string source = ""; string clone = ""; + string ceph_host = ""; + string ceph_secret= ""; int disk_id; string default_driver = ""; @@ -311,14 +313,16 @@ int LibVirtDriver::deployment_description_kvm( continue; } - type = disk->vector_value("TYPE"); - target = disk->vector_value("TARGET"); - ro = disk->vector_value("READONLY"); - driver = disk->vector_value("DRIVER"); - cache = disk->vector_value("CACHE"); - disk_io= disk->vector_value("IO"); - source = disk->vector_value("SOURCE"); - clone = disk->vector_value("CLONE"); + type = disk->vector_value("TYPE"); + target = disk->vector_value("TARGET"); + ro = disk->vector_value("READONLY"); + driver = disk->vector_value("DRIVER"); + cache = disk->vector_value("CACHE"); + disk_io = disk->vector_value("IO"); + source = disk->vector_value("SOURCE"); + clone = disk->vector_value("CLONE"); + ceph_host = disk->vector_value("CEPH_HOST"); + ceph_secret = disk->vector_value("CEPH_SECRET"); disk->vector_value_str("DISK_ID", disk_id); @@ -360,7 +364,46 @@ int LibVirtDriver::deployment_description_kvm( file << "-" << vm->get_oid() << "-" << disk_id; } - file << "'/>" << endl; + if ( ceph_host.empty() ) + { + file << "'/>" << endl; + } + else + { + vector::const_iterator it; + vector hosts = one_util::split(ceph_host, ' '); + + file << "'>" << endl; + + for (it = hosts.begin(); it != hosts.end(); it++) + { + vector parts = one_util::split(*it, ':'); + + if (parts.empty()) + { + continue; + } + + file << "\t\t\t\t" << endl; + } + + file << "\t\t\t" << endl; + } + + if ( !ceph_secret.empty() ) + { + file << "\t\t\t" << endl + << "\t\t\t\t" << endl + << "\t\t\t" << endl; + } } else if ( type == "RBD_CDROM" ) { From 8099694f04a381dde9d0e08b954a722ec6574c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 14 Nov 2013 16:58:01 +0100 Subject: [PATCH 53/57] Bug #2278: Reset cpu and memory monitorization to 0 when the VM exits the running state (cherry picked from commit 3ece9dacdf1f412cb0412d56c5367adc3894088d) --- src/lcm/LifeCycleActions.cc | 3 +++ src/lcm/LifeCycleStates.cc | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/lcm/LifeCycleActions.cc b/src/lcm/LifeCycleActions.cc index 88703058aa..bc1a38d50e 100644 --- a/src/lcm/LifeCycleActions.cc +++ b/src/lcm/LifeCycleActions.cc @@ -855,6 +855,9 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_etime(the_time); diff --git a/src/lcm/LifeCycleStates.cc b/src/lcm/LifeCycleStates.cc index 5991d36541..b466f12aa9 100644 --- a/src/lcm/LifeCycleStates.cc +++ b/src/lcm/LifeCycleStates.cc @@ -47,6 +47,9 @@ void LifeCycleManager::save_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_previous_etime(the_time); @@ -85,6 +88,9 @@ void LifeCycleManager::save_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_running_etime(the_time); @@ -115,6 +121,9 @@ void LifeCycleManager::save_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_epilog_stime(the_time); @@ -509,6 +518,9 @@ void LifeCycleManager::shutdown_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_epilog_stime(the_time); @@ -519,6 +531,7 @@ void LifeCycleManager::shutdown_success_action(int vid) vmpool->update_history(vm); + // TODO CARLOS vm->log("LCM", Log::INFO, "New VM state is EPILOG"); //---------------------------------------------------- @@ -533,6 +546,9 @@ void LifeCycleManager::shutdown_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_running_etime(the_time); @@ -559,6 +575,9 @@ void LifeCycleManager::shutdown_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_epilog_stime(the_time); @@ -987,6 +1006,9 @@ void LifeCycleManager::cancel_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_reason(History::USER); @@ -1013,6 +1035,9 @@ void LifeCycleManager::cancel_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_epilog_stime(the_time); @@ -1037,6 +1062,9 @@ void LifeCycleManager::cancel_success_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_running_etime(the_time); @@ -1172,6 +1200,9 @@ void LifeCycleManager::monitor_suspend_action(int vid) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_running_etime(the_time); @@ -1255,6 +1286,9 @@ void LifeCycleManager::failure_action(VirtualMachine * vm) vm->delete_snapshots(); + map empty; + vm->update_info(0, 0, -1, -1, empty); + vmpool->update(vm); vm->set_etime(the_time); From 04c5f008a63b99969cc00f0881280580986c16e8 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 15 Nov 2013 10:42:03 +0100 Subject: [PATCH 54/57] Bug #2278: Removed unneeded comment (cherry picked from commit eb946b47509d672dac69bef87d2bdbeafa90dba8) --- src/lcm/LifeCycleStates.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lcm/LifeCycleStates.cc b/src/lcm/LifeCycleStates.cc index b466f12aa9..2a0d8a49f9 100644 --- a/src/lcm/LifeCycleStates.cc +++ b/src/lcm/LifeCycleStates.cc @@ -531,7 +531,6 @@ void LifeCycleManager::shutdown_success_action(int vid) vmpool->update_history(vm); - // TODO CARLOS vm->log("LCM", Log::INFO, "New VM state is EPILOG"); //---------------------------------------------------- From 96b5cd4276d7300976c9f33554e5f0d4481af884 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Fri, 15 Nov 2013 14:32:03 +0100 Subject: [PATCH 55/57] Bump to version 4.3.85 --- include/Nebula.h | 4 ++-- share/rubygems/generate | 2 +- share/scripts/context-packages/generate.sh | 2 +- src/cloud/common/CloudClient.rb | 2 +- src/oca/java/src/org/opennebula/client/OneSystem.java | 2 +- src/oca/ruby/opennebula.rb | 2 +- src/onedb/fsck.rb | 2 +- src/ozones/Server/templates/index.html | 2 +- src/ozones/Server/templates/login.html | 2 +- src/sunstone/views/index.erb | 2 +- src/sunstone/views/login.erb | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/Nebula.h b/include/Nebula.h index 55c3b07526..facb3a577b 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -357,12 +357,12 @@ public: */ static string version() { - return "OpenNebula 4.3.80"; + return "OpenNebula 4.3.85"; }; static string db_version() { - return "4.3.80"; + return "4.3.85"; } /** diff --git a/share/rubygems/generate b/share/rubygems/generate index 704b61ebb0..421bc56259 100755 --- a/share/rubygems/generate +++ b/share/rubygems/generate @@ -21,7 +21,7 @@ require 'tmpdir' DEFAULTS={ - :version => "4.3.80", + :version => "4.3.85", :date => Time.now.strftime("%Y-%m-%d"), :dependencies => [] } diff --git a/share/scripts/context-packages/generate.sh b/share/scripts/context-packages/generate.sh index 0b3e090080..a3db086dc4 100755 --- a/share/scripts/context-packages/generate.sh +++ b/share/scripts/context-packages/generate.sh @@ -16,7 +16,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -VERSION=${VERSION:-4.3.80} +VERSION=${VERSION:-4.3.85} MAINTAINER=${MAINTAINER:-C12G Labs } LICENSE=${LICENSE:-Apache 2.0} PACKAGE_NAME=${PACKAGE_NAME:-one-context} diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index 36aaa86459..7bf2c88a97 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -50,7 +50,7 @@ end module CloudClient # OpenNebula version - VERSION = '4.3.80' + VERSION = '4.3.85' # ######################################################################### # Default location for the authentication file diff --git a/src/oca/java/src/org/opennebula/client/OneSystem.java b/src/oca/java/src/org/opennebula/client/OneSystem.java index f899167940..712fd3a25a 100644 --- a/src/oca/java/src/org/opennebula/client/OneSystem.java +++ b/src/oca/java/src/org/opennebula/client/OneSystem.java @@ -32,7 +32,7 @@ public class OneSystem private static final String GROUP_QUOTA_INFO = "groupquota.info"; private static final String GROUP_QUOTA_UPDATE = "groupquota.update"; - public static final String VERSION = "4.3.80"; + public static final String VERSION = "4.3.85"; public OneSystem(Client client) { diff --git a/src/oca/ruby/opennebula.rb b/src/oca/ruby/opennebula.rb index 5e9feea709..f2284994a3 100644 --- a/src/oca/ruby/opennebula.rb +++ b/src/oca/ruby/opennebula.rb @@ -54,5 +54,5 @@ require 'opennebula/system' module OpenNebula # OpenNebula version - VERSION = '4.3.80' + VERSION = '4.3.85' end diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index e222fc5c1e..0805b10842 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -20,7 +20,7 @@ require 'ipaddr' require 'set' module OneDBFsck - VERSION = "4.3.80" + VERSION = "4.3.85" def db_version VERSION diff --git a/src/ozones/Server/templates/index.html b/src/ozones/Server/templates/index.html index 91397897a8..6431fab246 100644 --- a/src/ozones/Server/templates/index.html +++ b/src/ozones/Server/templates/index.html @@ -65,7 +65,7 @@
diff --git a/src/ozones/Server/templates/login.html b/src/ozones/Server/templates/login.html index 18b7580f56..c72449c6b8 100644 --- a/src/ozones/Server/templates/login.html +++ b/src/ozones/Server/templates/login.html @@ -49,7 +49,7 @@
diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 41972cffb1..0eb6c4bfe2 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -86,7 +86,7 @@
diff --git a/src/sunstone/views/login.erb b/src/sunstone/views/login.erb index 6a554260f2..78b1d95989 100644 --- a/src/sunstone/views/login.erb +++ b/src/sunstone/views/login.erb @@ -26,7 +26,7 @@ From d793cc6fa45e13ce52644cedcf3a2825e402c9ca Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Fri, 15 Nov 2013 14:36:00 +0100 Subject: [PATCH 56/57] refresh man pages --- share/man/econe-allocate-address.1 | 2 +- share/man/econe-associate-address.1 | 2 +- share/man/econe-attach-volume.1 | 2 +- share/man/econe-create-keypair.1 | 2 +- share/man/econe-create-volume.1 | 2 +- share/man/econe-delete-keypair.1 | 2 +- share/man/econe-delete-volume.1 | 2 +- share/man/econe-describe-addresses.1 | 2 +- share/man/econe-describe-images.1 | 2 +- share/man/econe-describe-instances.1 | 2 +- share/man/econe-describe-keypairs.1 | 2 +- share/man/econe-describe-volumes.1 | 2 +- share/man/econe-detach-volume.1 | 2 +- share/man/econe-disassociate-address.1 | 2 +- share/man/econe-reboot-instances.1 | 2 +- share/man/econe-register.1 | 2 +- share/man/econe-release-address.1 | 2 +- share/man/econe-run-instances.1 | 2 +- share/man/econe-start-instances.1 | 2 +- share/man/econe-stop-instances.1 | 2 +- share/man/econe-terminate-instances.1 | 2 +- share/man/econe-upload.1 | 2 +- share/man/occi-compute.1 | 2 +- share/man/occi-instance-type.1 | 2 +- share/man/occi-network.1 | 2 +- share/man/occi-storage.1 | 2 +- share/man/oneacct.1 | 2 +- share/man/oneacl.1 | 2 +- share/man/onecluster.1 | 2 +- share/man/onedatastore.1 | 2 +- share/man/oneflow-template.1 | 2 +- share/man/oneflow.1 | 2 +- share/man/onegroup.1 | 2 +- share/man/onehost.1 | 2 +- share/man/oneimage.1 | 2 +- share/man/onetemplate.1 | 2 +- share/man/oneuser.1 | 2 +- share/man/onevdc.1 | 2 +- share/man/onevm.1 | 2 +- share/man/onevnet.1 | 2 +- share/man/onezone.1 | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/share/man/econe-allocate-address.1 b/share/man/econe-allocate-address.1 index a7f4ec3fe9..b66695eb7c 100644 --- a/share/man/econe-allocate-address.1 +++ b/share/man/econe-allocate-address.1 @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-associate-address.1 b/share/man/econe-associate-address.1 index 3c4a4f4af0..cf5e288dce 100644 --- a/share/man/econe-associate-address.1 +++ b/share/man/econe-associate-address.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-attach-volume.1 b/share/man/econe-attach-volume.1 index d03c978176..33993d6e08 100644 --- a/share/man/econe-attach-volume.1 +++ b/share/man/econe-attach-volume.1 @@ -45,7 +45,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-create-keypair.1 b/share/man/econe-create-keypair.1 index 5ab1c04788..8a9b5263a2 100644 --- a/share/man/econe-create-keypair.1 +++ b/share/man/econe-create-keypair.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-create-volume.1 b/share/man/econe-create-volume.1 index 3c8ee7d8c8..e364ed8b90 100644 --- a/share/man/econe-create-volume.1 +++ b/share/man/econe-create-volume.1 @@ -40,7 +40,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-delete-keypair.1 b/share/man/econe-delete-keypair.1 index 1a18b9a7e8..9edcd2c719 100644 --- a/share/man/econe-delete-keypair.1 +++ b/share/man/econe-delete-keypair.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-delete-volume.1 b/share/man/econe-delete-volume.1 index abb9f963e4..65433c1f90 100644 --- a/share/man/econe-delete-volume.1 +++ b/share/man/econe-delete-volume.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-describe-addresses.1 b/share/man/econe-describe-addresses.1 index 30f364f914..9c93602bc8 100644 --- a/share/man/econe-describe-addresses.1 +++ b/share/man/econe-describe-addresses.1 @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-describe-images.1 b/share/man/econe-describe-images.1 index 8e1d72d86e..90424ee825 100644 --- a/share/man/econe-describe-images.1 +++ b/share/man/econe-describe-images.1 @@ -36,7 +36,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-describe-instances.1 b/share/man/econe-describe-instances.1 index e55c5ee35e..5038b2b104 100644 --- a/share/man/econe-describe-instances.1 +++ b/share/man/econe-describe-instances.1 @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-describe-keypairs.1 b/share/man/econe-describe-keypairs.1 index 095f41a7d7..3510f0367d 100644 --- a/share/man/econe-describe-keypairs.1 +++ b/share/man/econe-describe-keypairs.1 @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-describe-volumes.1 b/share/man/econe-describe-volumes.1 index 68a3b61cc4..f5fd1fbc9e 100644 --- a/share/man/econe-describe-volumes.1 +++ b/share/man/econe-describe-volumes.1 @@ -39,7 +39,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-detach-volume.1 b/share/man/econe-detach-volume.1 index 3c9da37db2..22ab5d7269 100644 --- a/share/man/econe-detach-volume.1 +++ b/share/man/econe-detach-volume.1 @@ -45,7 +45,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-disassociate-address.1 b/share/man/econe-disassociate-address.1 index 9b343137da..b937a61658 100644 --- a/share/man/econe-disassociate-address.1 +++ b/share/man/econe-disassociate-address.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-reboot-instances.1 b/share/man/econe-reboot-instances.1 index fc9d9d8738..1d51be6937 100644 --- a/share/man/econe-reboot-instances.1 +++ b/share/man/econe-reboot-instances.1 @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-register.1 b/share/man/econe-register.1 index 80062bf9f4..6df3f9c2f4 100644 --- a/share/man/econe-register.1 +++ b/share/man/econe-register.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-release-address.1 b/share/man/econe-release-address.1 index fc242a7db4..478347cd33 100644 --- a/share/man/econe-release-address.1 +++ b/share/man/econe-release-address.1 @@ -42,7 +42,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-run-instances.1 b/share/man/econe-run-instances.1 index 56137cdc8c..49b8265831 100644 --- a/share/man/econe-run-instances.1 +++ b/share/man/econe-run-instances.1 @@ -53,7 +53,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-start-instances.1 b/share/man/econe-start-instances.1 index 303368490d..d94f9beeea 100644 --- a/share/man/econe-start-instances.1 +++ b/share/man/econe-start-instances.1 @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-stop-instances.1 b/share/man/econe-stop-instances.1 index 5acf052348..f1f7b549e2 100644 --- a/share/man/econe-stop-instances.1 +++ b/share/man/econe-stop-instances.1 @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-terminate-instances.1 b/share/man/econe-terminate-instances.1 index bb93403485..2a6084a8e8 100644 --- a/share/man/econe-terminate-instances.1 +++ b/share/man/econe-terminate-instances.1 @@ -45,7 +45,7 @@ instance_id The IDs of instances, comma\-separated .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/econe-upload.1 b/share/man/econe-upload.1 index 9c0855ab00..ce042a73f9 100644 --- a/share/man/econe-upload.1 +++ b/share/man/econe-upload.1 @@ -43,7 +43,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/occi-compute.1 b/share/man/occi-compute.1 index cc062dcd4f..30bf33be05 100644 --- a/share/man/occi-compute.1 +++ b/share/man/occi-compute.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.80" "User Commands" +.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.85" "User Commands" .SH NAME OpenNebula \- OCCI Manage Compute .SH SYNOPSIS diff --git a/share/man/occi-instance-type.1 b/share/man/occi-instance-type.1 index bd05910d5e..abe598da51 100644 --- a/share/man/occi-instance-type.1 +++ b/share/man/occi-instance-type.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.80" "User Commands" +.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.85" "User Commands" .SH NAME OpenNebula \- OCCI Manage Instance .SH SYNOPSIS diff --git a/share/man/occi-network.1 b/share/man/occi-network.1 index 0f5805a76a..8a53b582d2 100644 --- a/share/man/occi-network.1 +++ b/share/man/occi-network.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.80" "User Commands" +.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.85" "User Commands" .SH NAME OpenNebula \- OCCI Manage Network .SH SYNOPSIS diff --git a/share/man/occi-storage.1 b/share/man/occi-storage.1 index c4351eac23..75d863f5ad 100644 --- a/share/man/occi-storage.1 +++ b/share/man/occi-storage.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.80" "User Commands" +.TH OPENNEBULA "1" "November 2013" "OpenNebula 4.3.85" "User Commands" .SH NAME OpenNebula \- OCCI Manage Storage .SH SYNOPSIS diff --git a/share/man/oneacct.1 b/share/man/oneacct.1 index 4579640924..579c355054 100644 --- a/share/man/oneacct.1 +++ b/share/man/oneacct.1 @@ -46,7 +46,7 @@ text String .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneacl.1 b/share/man/oneacl.1 index 699501a975..4278271b3d 100644 --- a/share/man/oneacl.1 +++ b/share/man/oneacl.1 @@ -54,7 +54,7 @@ aclid_list Comma\-separated list of OpenNebula ACL names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onecluster.1 b/share/man/onecluster.1 index 0945f7ad01..a42cc334a2 100644 --- a/share/man/onecluster.1 +++ b/share/man/onecluster.1 @@ -99,7 +99,7 @@ datastoreid OpenNebula DATASTORE name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onedatastore.1 b/share/man/onedatastore.1 index 2746b67d8a..134d938525 100644 --- a/share/man/onedatastore.1 +++ b/share/man/onedatastore.1 @@ -91,7 +91,7 @@ userid OpenNebula USER name or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneflow-template.1 b/share/man/oneflow-template.1 index fa0d8ec66a..2d4a09d8d2 100644 --- a/share/man/oneflow-template.1 +++ b/share/man/oneflow-template.1 @@ -84,7 +84,7 @@ templateid_list Comma\-separated list of OpenNebula SERVICE TEMPLATE names or id .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneflow.1 b/share/man/oneflow.1 index 4cb0858e2e..978da19d4e 100644 --- a/share/man/oneflow.1 +++ b/share/man/oneflow.1 @@ -94,7 +94,7 @@ vm_action Actions supported: shutdown, shutdown\-hard, undeploy, undeploy\-hard, .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onegroup.1 b/share/man/onegroup.1 index 613a3e6d7e..df4760320f 100644 --- a/share/man/onegroup.1 +++ b/share/man/onegroup.1 @@ -74,7 +74,7 @@ groupid_list Comma\-separated list of OpenNebula GROUP names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onehost.1 b/share/man/onehost.1 index 421245eb06..c5c6f8764e 100644 --- a/share/man/onehost.1 +++ b/share/man/onehost.1 @@ -91,7 +91,7 @@ hostid_list Comma\-separated list of OpenNebula HOST names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneimage.1 b/share/man/oneimage.1 index 629d091eda..43462bbdc1 100644 --- a/share/man/oneimage.1 +++ b/share/man/oneimage.1 @@ -161,7 +161,7 @@ type Image type: OS, CDROM, DATABLOCK, KERNEL, RAMDISK, CONTEXT .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onetemplate.1 b/share/man/onetemplate.1 index 7530df210b..d4d73cf8e5 100644 --- a/share/man/onetemplate.1 +++ b/share/man/onetemplate.1 @@ -162,7 +162,7 @@ filterflag a, all all the known VMTEMPLATEs m, mine the VMTEMPLATE belonging to .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneuser.1 b/share/man/oneuser.1 index ae468ca8a0..442eab503c 100644 --- a/share/man/oneuser.1 +++ b/share/man/oneuser.1 @@ -147,7 +147,7 @@ password User password .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevdc.1 b/share/man/onevdc.1 index 204d5b92f0..91036a1fd8 100644 --- a/share/man/onevdc.1 +++ b/share/man/onevdc.1 @@ -63,7 +63,7 @@ vdcid VDC ID .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevm.1 b/share/man/onevm.1 index b4be574fc1..cc590fb801 100644 --- a/share/man/onevm.1 +++ b/share/man/onevm.1 @@ -518,7 +518,7 @@ diskid Integer .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevnet.1 b/share/man/onevnet.1 index 715453fb98..3474aec9f7 100644 --- a/share/man/onevnet.1 +++ b/share/man/onevnet.1 @@ -104,7 +104,7 @@ filterflag a, all all the known VNETs m, mine the VNET belonging to the user in .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onezone.1 b/share/man/onezone.1 index 1f7368d944..981b51a489 100644 --- a/share/man/onezone.1 +++ b/share/man/onezone.1 @@ -53,7 +53,7 @@ zoneid Zone ID .IP "" 0 . .SH "LICENSE" -OpenNebula 4\.3\.80 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs +OpenNebula 4\.3\.85 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 From 456cc4e263e41f232e1bbb34adbb7a1f75cd86b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 15 Nov 2013 15:03:30 +0100 Subject: [PATCH 57/57] Add migrator to 4.3.85 (cherry picked from commit d4572f66a06e3d8af72e473806d205c4a9dbdef5) --- install.sh | 1 + src/onedb/4.3.80_to_4.3.85.rb | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/onedb/4.3.80_to_4.3.85.rb diff --git a/install.sh b/install.sh index 147f41b81c..020578ef6f 100755 --- a/install.sh +++ b/install.sh @@ -1152,6 +1152,7 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/4.0.1_to_4.1.80.rb \ src/onedb/4.1.80_to_4.2.0.rb \ src/onedb/4.2.0_to_4.3.80.rb \ + src/onedb/4.3.80_to_4.3.85.rb \ src/onedb/fsck.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/onedb/4.3.80_to_4.3.85.rb b/src/onedb/4.3.80_to_4.3.85.rb new file mode 100644 index 0000000000..98d3b1bcee --- /dev/null +++ b/src/onedb/4.3.80_to_4.3.85.rb @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +module Migrator + def db_version + "4.3.85" + end + + def one_version + "OpenNebula 4.3.85" + end + + def up + return true + end +end