--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/novnc/novnc.license Tue Jan 20 14:02:18 2015 -0800
@@ -0,0 +1,928 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
+
+--------------------------------------------------------------------------------
+
+Copyright (c) 2012, Joel Martin
+Copyright (C) 2013, Samuel Mannehed for Cendio AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the <organization> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+
+Copyright (c) 2012, Joel Martin
+Copyright (C) 2013, Samuel Mannehed for Cendio AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Ported from Flashlight VNC ActionScript implementation:
+ http://www.wizhelp.com/flashlight-vnc/
+
+Full attribution follows:
+
+-------------------------------------------------------------------------
+
+This DES class has been extracted from package Acme.Crypto for use in VNC.
+The unnecessary odd parity code has been removed.
+
+These changes are:
+ Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+
+This software 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.
+
+
+DesCipher - the DES encryption method
+
+The meat of this code is by Dave Zimmerman <[email protected]>, and is:
+
+Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.
+
+Permission to use, copy, modify, and distribute this software
+and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and
+without fee is hereby granted, provided that this copyright notice is kept
+intact.
+
+WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
+OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE
+FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+
+THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
+CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
+PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
+NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
+SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
+SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
+PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET WORKSHOP
+SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
+HIGH RISK ACTIVITIES.
+
+
+The rest is:
+
+Copyright (C) 1996 by Jef Poskanzer <[email protected]>. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Visit the ACME Labs Java page for up-to-date versions of this and other
+fine Java utilities: http://www.acme.com/java/
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 Matt McInerney
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE
+BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE
+CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other
+pre-existing works, such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary or artistic work, or
+phonogram or performance and includes cinematographic adaptations or any other
+form in which the Work may be recast, transformed, or adapted including in any
+form recognizably derived from the original, except that a work that
+constitutes a Collection will not be considered an Adaptation for the purpose
+of this License. For the avoidance of doubt, where the Work is a musical work,
+performance or phonogram, the synchronization of the Work in timed-relation
+with a moving image ("synching") will be considered an Adaptation for the
+purpose of this License.
+"Collection" means a collection of literary or artistic works, such as
+encyclopedias and anthologies, or performances, phonograms or broadcasts, or
+other works or subject matter other than works listed in Section 1(f) below,
+which, by reason of the selection and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in its entirety in
+unmodified form along with one or more other contributions, each constituting
+separate and independent works in themselves, which together are assembled into
+a collective whole. A work that constitutes a Collection will not be considered
+an Adaptation (as defined below) for the purposes of this License.
+"Creative Commons Compatible License" means a license that is listed at
+http://creativecommons.org/compatiblelicenses that has been approved by
+Creative Commons as being essentially equivalent to this License, including, at
+a minimum, because that license: (i) contains terms that have the same purpose,
+meaning and effect as the License Elements of this License; and, (ii)
+explicitly permits the relicensing of adaptations of works made available under
+that license under this License or a Creative Commons jurisdiction license with
+the same License Elements as this License.
+"Distribute" means to make available to the public the original and copies of
+the Work or Adaptation, as appropriate, through sale or other transfer of
+ownership.
+"License Elements" means the following high-level license attributes as
+selected by Licensor and indicated in the title of this License: Attribution,
+ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s)
+the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the
+individual, individuals, entity or entities who created the Work or if no
+individual or entity can be identified, the publisher; and in addition (i) in
+the case of a performance the actors, singers, musicians, dancers, and other
+persons who act, sing, deliver, declaim, play in, interpret or otherwise
+perform literary or artistic works or expressions of folklore; (ii) in the case
+of a phonogram the producer being the person or legal entity who first fixes
+the sounds of a performance or other sounds; and, (iii) in the case of
+broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this
+License including without limitation any production in the literary, scientific
+and artistic domain, whatever may be the mode or form of its expression
+including digital form, such as a book, pamphlet and other writing; a lecture,
+address, sermon or other work of the same nature; a dramatic or
+dramatico-musical work; a choreographic work or entertainment in dumb show; a
+musical composition with or without words; a cinematographic work to which are
+assimilated works expressed by a process analogous to cinematography; a work of
+drawing, painting, architecture, sculpture, engraving or lithography; a
+photographic work to which are assimilated works expressed by a process
+analogous to photography; a work of applied art; an illustration, map, plan,
+sketch or three-dimensional work relative to geography, topography,
+architecture or science; a performance; a broadcast; a phonogram; a compilation
+of data to the extent it is protected as a copyrightable work; or a work
+performed by a variety or circus performer to the extent it is not otherwise
+considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who
+has not previously violated the terms of this License with respect to the Work,
+or who has received express permission from the Licensor to exercise rights
+under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to
+communicate to the public those public recitations, by any means or process,
+including by wire or wireless means or public digital performances; to make
+available to the public Works in such a way that members of the public may
+access these Works from a place and at a place individually chosen by them; to
+perform the Work to the public by any means or process and the communication to
+the public of the performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any means including
+signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without
+limitation by sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a protected performance
+or phonogram in digital form or other electronic medium.
+
+2. Fair Dealing Rights.
+
+Nothing in this License is intended to reduce, limit,
+or restrict any uses free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the copyright protection
+under copyright law or other applicable laws.
+
+3. License Grant.
+
+Subject to the terms and conditions of this License, Licensor
+hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the
+duration of the applicable copyright) license to exercise the rights in the
+Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections,
+and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation,
+including any translation in any medium, takes reasonable steps to clearly
+label, demarcate or otherwise identify that changes were made to the original
+Work. For example, a translation could be marked "The original work was
+translated from English to Spanish," or a modification could indicate "The
+original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in
+Collections; and,
+to Distribute and Publicly Perform Adaptations.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the
+right to collect royalties through any statutory or compulsory licensing scheme
+cannot be waived, the Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right
+to collect royalties through any statutory or compulsory licensing scheme can
+be waived, the Licensor waives the exclusive right to collect such royalties
+for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties,
+whether individually or, in the event that the Licensor is a member of a
+collecting society that administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or
+hereafter devised. The above rights include the right to make such
+modifications as are technically necessary to exercise the rights in other
+media and formats. Subject to Section 8(f), all rights not expressly granted by
+Licensor are hereby reserved.
+
+4. Restrictions.
+
+The license granted in Section 3 above is expressly made
+subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this
+License. You must include a copy of, or the Uniform Resource Identifier (URI)
+for, this License with every copy of the Work You Distribute or Publicly
+Perform. You may not offer or impose any terms on the Work that restrict the
+terms of this License or the ability of the recipient of the Work to exercise
+the rights granted to that recipient under the terms of the License. You may
+not sublicense the Work. You must keep intact all notices that refer to this
+License and to the disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or Publicly Perform the
+Work, You may not impose any effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You to exercise the rights
+granted to that recipient under the terms of the License. This Section 4(a)
+applies to the Work as incorporated in a Collection, but this does not require
+the Collection apart from the Work itself to be made subject to the terms of
+this License. If You create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the Collection any credit as
+required by Section 4(c), as requested. If You create an Adaptation, upon
+notice from any Licensor You must, to the extent practicable, remove from the
+Adaptation any credit as required by Section 4(c), as requested.
+You may Distribute or Publicly Perform an Adaptation only under the terms of:
+(i) this License; (ii) a later version of this License with the same License
+Elements as this License; (iii) a Creative Commons jurisdiction license (either
+this or a later license version) that contains the same License Elements as
+this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons
+Compatible License. If you license the Adaptation under one of the licenses
+mentioned in (iv), you must comply with the terms of that license. If you
+license the Adaptation under the terms of any of the licenses mentioned in (i),
+(ii) or (iii) (the "Applicable License"), you must comply with the terms of the
+Applicable License generally and the following provisions: (I) You must include
+a copy of, or the URI for, the Applicable License with every copy of each
+Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose
+any terms on the Adaptation that restrict the terms of the Applicable License
+or the ability of the recipient of the Adaptation to exercise the rights
+granted to that recipient under the terms of the Applicable License; (III) You
+must keep intact all notices that refer to the Applicable License and to the
+disclaimer of warranties with every copy of the Work as included in the
+Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or
+Publicly Perform the Adaptation, You may not impose any effective technological
+measures on the Adaptation that restrict the ability of a recipient of the
+Adaptation from You to exercise the rights granted to that recipient under the
+terms of the Applicable License. This Section 4(b) applies to the Adaptation as
+incorporated in a Collection, but this does not require the Collection apart
+from the Adaptation itself to be made subject to the terms of the Applicable
+License.
+If You Distribute, or Publicly Perform the Work or any Adaptations or
+Collections, You must, unless a request has been made pursuant to Section 4(a),
+keep intact all copyright notices for the Work and provide, reasonable to the
+medium or means You are utilizing: (i) the name of the Original Author (or
+pseudonym, if applicable) if supplied, and/or if the Original Author and/or
+Licensor designate another party or parties (e.g., a sponsor institute,
+publishing entity, journal) for attribution ("Attribution Parties") in
+Licensor's copyright notice, terms of service or by other reasonable means, the
+name of such party or parties; (ii) the title of the Work if supplied; (iii) to
+the extent reasonably practicable, the URI, if any, that Licensor specifies to
+be associated with the Work, unless such URI does not refer to the copyright
+notice or licensing information for the Work; and (iv) , consistent with
+Ssection 3(b), in the case of an Adaptation, a credit identifying the use of
+the Work in the Adaptation (e.g., "French translation of the Work by Original
+Author," or "Screenplay based on original Work by Original Author"). The credit
+required by this Section 4(c) may be implemented in any reasonable manner;
+provided, however, that in the case of a Adaptation or Collection, at a minimum
+such credit will appear, if a credit for all contributing authors of the
+Adaptation or Collection appears, then as part of these credits and in a manner
+at least as prominent as the credits for the other contributing authors. For
+the avoidance of doubt, You may only use the credit required by this Section
+for the purpose of attribution in the manner set out above and, by exercising
+Your rights under this License, You may not implicitly or explicitly assert or
+imply any connection with, sponsorship or endorsement by the Original Author,
+Licensor and/or Attribution Parties, as appropriate, of You or Your use of the
+Work, without the separate, express prior written permission of the Original
+Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise
+permitted by applicable law, if You Reproduce, Distribute or Publicly Perform
+the Work either by itself or as part of any Adaptations or Collections, You
+must not distort, mutilate, modify or take other derogatory action in relation
+to the Work which would be prejudicial to the Original Author's honor or
+reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which
+any exercise of the right granted in Section 3(b) of this License (the right to
+make Adaptations) would be deemed to be a distortion, mutilation, modification
+or other derogatory action prejudicial to the Original Author's honor and
+reputation, the Licensor will waive or not assert, as appropriate, this
+Section, to the fullest extent permitted by the applicable national law, to
+enable You to reasonably exercise Your right under Section 3(b) of this License
+(right to make Adaptations) but not otherwise.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS
+THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
+CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A
+PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS,
+ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH
+EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability.
+
+EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN
+NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL,
+INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS
+LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon
+any breach by You of the terms of this License. Individuals or entities who
+have received Adaptations or Collections from You under this License, however,
+will not have their licenses terminated provided such individuals or entities
+remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8
+will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is
+perpetual (for the duration of the applicable copyright in the Work).
+Notwithstanding the above, Licensor reserves the right to release the Work
+under different license terms or to stop distributing the Work at any time;
+provided, however that any such election will not serve to withdraw this
+License (or any other license that has been, or is required to be, granted
+under the terms of this License), and this License will continue in full force
+and effect unless terminated as stated above.
+
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the
+Licensor offers to the recipient a license to the Work on the same terms and
+conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to
+the recipient a license to the original Work on the same terms and conditions
+as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this License, and without further action by the parties to this
+agreement, such provision shall be reformed to the minimum extent necessary to
+make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach
+consented to unless such waiver or consent shall be in writing and signed by
+the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect
+to the Work licensed here. There are no understandings, agreements or
+representations with respect to the Work not specified here. Licensor shall not
+be bound by any additional provisions that may appear in any communication from
+You. This License may not be modified without the mutual written agreement of
+the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License
+were drafted utilizing the terminology of the Berne Convention for the
+Protection of Literary and Artistic Works (as amended on September 28, 1979),
+the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO
+Performances and Phonograms Treaty of 1996 and the Universal Copyright
+Convention (as revised on July 24, 1971). These rights and subject matter take
+effect in the relevant jurisdiction in which the License terms are sought to be
+enforced according to the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law. If the standard suite
+of rights granted under applicable copyright law includes additional rights not
+granted under this License, such additional rights are deemed to be included in
+the License; this License is not intended to restrict the license of any rights
+under applicable law.
+
+--------------------------------------------------------------------------------
+
+Copyright (c) 2011 by Erik Moller
+All rights reserved.
+
+This software is provided 'as-is', without any express
+or implied warranty. In no event will the authors be
+held liable for any damages arising from the use of
+this software.
+
+Permission is granted to anyone to use this software
+for any purpose, including commercial applications,
+and to alter it and redistribute it freely, subject to
+the following restrictions:
+
+1. The origin of this software must not be
+ misrepresented; you must not claim that you
+ wrote the original software. If you use this
+ software in a product, an acknowledgment in
+ the product documentation would be appreciated
+ but is not required.
+
+2. Altered source versions must be plainly marked
+ as such, and must not be misrepresented as
+ being the original software.
+
+3. This notice may not be removed or altered from
+ any source distribution.
+
--- a/components/openstack/nova/files/solariszones/driver.py Mon Jan 19 20:04:39 2015 -0800
+++ b/components/openstack/nova/files/solariszones/driver.py Tue Jan 20 14:02:18 2015 -0800
@@ -119,6 +119,10 @@
}
MAX_CONSOLE_BYTES = 102400
+VNC_CONSOLE_BASE_FMRI = 'svc:/application/openstack/nova/zone-vnc-console'
+# Required in order to create a zone VNC console SMF service instance
+VNC_SERVER_PATH = '/usr/bin/vncserver'
+XTERM_PATH = '/usr/bin/xterm'
def lookup_resource_property(zone, resource, prop, filter=None):
@@ -831,9 +835,9 @@
driver_type = connection_info['driver_volume_type']
if driver_type == 'local':
LOG.warning(_("Detected 'local' zvol driver volume type "
- "from volume service, which should not be "
- "used as a boot device for 'solaris' branded "
- "zones."))
+ "from volume service, which should not be "
+ "used as a boot device for 'solaris' "
+ "branded zones."))
delete_boot_volume = True
elif driver_type == 'iscsi':
# Check for a potential loopback iSCSI situation
@@ -850,18 +854,18 @@
# iSCSI LUN is on the same host as the instance.
if target_host in [connector['ip'], connector['host']]:
LOG.warning(_("iSCSI connection info from volume "
- "service indicates that the target is a "
- "local volume, which should not be used "
- "as a boot device for 'solaris' branded "
- "zones."))
+ "service indicates that the target is a "
+ "local volume, which should not be used "
+ "as a boot device for 'solaris' branded "
+ "zones."))
delete_boot_volume = True
# Assuming that fibre_channel is non-local
elif driver_type != 'fibre_channel':
# Some other connection type that we don't understand
# Let zone use some local fallback instead.
LOG.warning(_("Unsupported volume driver type '%s' "
- "can not be used as a boot device for "
- "'solaris' branded zones."))
+ "can not be used as a boot device for "
+ "'solaris' branded zones."))
delete_boot_volume = True
if delete_boot_volume:
@@ -1114,6 +1118,154 @@
"zonemgr(3RAD): %s") % (name, reason))
raise
+ def _create_vnc_console_service(self, instance):
+ """Create a VNC console SMF service for a Solaris Zone"""
+ # Basic environment checks first: vncserver and xterm
+ if not os.path.exists(VNC_SERVER_PATH):
+ LOG.warning(_("Zone VNC console SMF service not available on this "
+ "compute node. %s is missing. Run 'pkg install "
+ "x11/server/xvnc'") % VNC_SERVER_PATH)
+ raise exception.ConsoleTypeUnavailable(console_type='vnc')
+
+ if not os.path.exists(XTERM_PATH):
+ LOG.warning(_("Zone VNC console SMF service not available on this "
+ "compute node. %s is missing. Run 'pkg install "
+ "terminal/xterm'") % XTERM_PATH)
+ raise exception.ConsoleTypeUnavailable(console_type='vnc')
+
+ name = instance['name']
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ out, err = utils.execute('/usr/sbin/svccfg', '-s',
+ VNC_CONSOLE_BASE_FMRI, 'add', name)
+ except processutils.ProcessExecutionError as err:
+ if self._has_vnc_console_service(instance):
+ LOG.debug(_("Ignoring attempt to create existing zone VNC "
+ "console SMF service for instance '%s'") % name)
+ return
+ else:
+ LOG.error(_("Unable to create zone VNC console SMF service "
+ "'{0}': {1}").format(
+ VNC_CONSOLE_BASE_FMRI + ':' + name, err))
+ raise
+
+ def _delete_vnc_console_service(self, instance):
+ """Delete a VNC console SMF service for a Solaris Zone"""
+ name = instance['name']
+ self._disable_vnc_console_service(instance)
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ out, err = utils.execute('/usr/sbin/svccfg', '-s',
+ VNC_CONSOLE_BASE_FMRI, 'delete', name)
+ except processutils.ProcessExecutionError as err:
+ if not self._has_vnc_console_service(instance):
+ LOG.debug(_("Ignoring attempt to delete a non-existent zone "
+ "VNC console SMF service for instance '%s'")
+ % name)
+ return
+ else:
+ LOG.error(_("Unable to delete zone VNC console SMF service "
+ "'%s': %s")
+ % (VNC_CONSOLE_BASE_FMRI + ':' + name, err))
+ raise
+
+ def _enable_vnc_console_service(self, instance):
+ """Enable a zone VNC console SMF service"""
+ name = instance['name']
+
+ console_fmri = VNC_CONSOLE_BASE_FMRI + ':' + name
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ out, err = utils.execute('/usr/sbin/svcadm', 'enable',
+ console_fmri)
+ except processutils.ProcessExecutionError as err:
+ if not self._has_vnc_console_service(instance):
+ LOG.error(_("Ignoring attempt to enable a non-existent zone "
+ "VNC console SMF service for instance '%s'")
+ % name)
+ LOG.error(_("Unable to start zone VNC console SMF service "
+ "'%s': %s") % (console_fmri, err))
+ raise
+
+ # Allow some time for the console service to come online.
+ greenthread.sleep(2)
+ while True:
+ try:
+ out, err = utils.execute('/usr/bin/svcs', '-H', '-o', 'state',
+ console_fmri)
+ state = out.strip()
+ if state == 'online':
+ break
+ elif state in ['maintenance', 'offline']:
+ LOG.error(_("Zone VNC console SMF service '%s' is in the "
+ "'%s' state. Run 'svcs -x %s' for details.")
+ % (console_fmri, state, console_fmri))
+ raise exception.ConsoleNotFoundForInstance(
+ instance_uuid=instance['uuid'])
+ # Wait for service state to transition to (hopefully) online
+ # state or offline/maintenance states.
+ greenthread.sleep(2)
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Error querying state of zone VNC console SMF "
+ "service '%s': %s") % (console_fmri, err))
+ raise
+
+ def _disable_vnc_console_service(self, instance):
+ """Disable a zone VNC console SMF service"""
+ name = instance['name']
+ if not self._has_vnc_console_service(instance):
+ LOG.debug(_("Ignoring attempt to disable a non-existent zone VNC "
+ "console SMF service for instance '%s'") % name)
+ return
+ console_fmri = VNC_CONSOLE_BASE_FMRI + ':' + name
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ out, err = utils.execute('/usr/sbin/svcadm', 'disable',
+ console_fmri)
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Unable to disable zone VNC console SMF service "
+ "'%s': %s") % (console_fmri, err))
+ # The console service sets a SMF instance property for the port
+ # on which the VNC service is listening. The service needs to be
+ # refreshed to reset the property value
+ try:
+ out, err = utils.execute('/usr/sbin/svccfg', '-s', console_fmri,
+ 'refresh')
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Unable to refresh zone VNC console SMF service "
+ "'%s': %s") % (console_fmri, err))
+
+ def _get_vnc_console_service_state(self, instance):
+ """Returns state of the instance zone VNC console SMF service"""
+ name = instance['name']
+ if not self._has_vnc_console_service(instance):
+ LOG.warning(_("Console state requested for a non-existent zone "
+ "VNC console SMF service for instance '%s'")
+ % name)
+ return None
+ console_fmri = VNC_CONSOLE_BASE_FMRI + ':' + name
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ state, err = utils.execute('/usr/sbin/svcs', '-H', '-o', 'state',
+ console_fmri)
+ return state.strip()
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Console state request failed for zone VNC console "
+ "SMF service for instance '%s': %s") % (name, err))
+ raise
+
+ def _has_vnc_console_service(self, instance):
+ """Returns True if the instance has a zone VNC console SMF service"""
+ name = instance['name']
+ console_fmri = VNC_CONSOLE_BASE_FMRI + ':' + name
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ utils.execute('/usr/bin/svcs', '-H', '-o', 'state',
+ console_fmri)
+ return True
+ except processutils.ProcessExecutionError as err:
+ return False
+
def _install(self, instance, image, extra_specs, sc_dir):
"""Install a new Solaris Zone root file system."""
name = instance['name']
@@ -1290,6 +1442,16 @@
"""
# TODO(Vek): Need to pass context in for access to auth_token
+ try:
+ # These methods log if problems occur so no need to double log
+ # here. Just catch any stray exceptions and allow destroy to
+ # proceed.
+ if self._has_vnc_console_service(instance):
+ self._disable_vnc_console_service(instance)
+ self._delete_vnc_console_service(instance)
+ except Exception:
+ pass
+
name = instance['name']
zone = self._get_zone_by_name(name)
# If instance cannot be found, just return.
@@ -1395,7 +1557,46 @@
def get_vnc_console(self, instance):
# TODO(Vek): Need to pass context in for access to auth_token
- raise NotImplementedError()
+
+ # Do not provide console access prematurely. Zone console access is
+ # exclusive and zones that are still installing require their console.
+ # Grabbing the zone console will break installation.
+ name = instance['name']
+ if instance['vm_state'] == vm_states.BUILDING:
+ LOG.info(_("VNC console not available until zone '%s' has "
+ "completed installation. Try again later.") % name)
+ raise exception.InstanceNotReady(instance_id=instance['uuid'])
+
+ if not self._has_vnc_console_service(instance):
+ LOG.debug(_("Creating zone VNC console SMF service for "
+ "instance '%s'") % name)
+ self._create_vnc_console_service(instance)
+
+ self._enable_vnc_console_service(instance)
+ console_fmri = VNC_CONSOLE_BASE_FMRI + ':' + name
+
+ # The console service sets an SMF instance property for the port
+ # on which the VNC service is listening. The service needs to be
+ # refreshed to reflect the current property value
+ # TODO(npower): investigate using RAD instead of CLI invocation
+ try:
+ out, err = utils.execute('/usr/sbin/svccfg', '-s', console_fmri,
+ 'refresh')
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Unable to refresh zone VNC console SMF service "
+ "'%s': %s" % (console_fmri, err)))
+ raise
+
+ try:
+ out, err = utils.execute('/usr/bin/svcprop', '-p', 'vnc/port',
+ console_fmri)
+ port = out.strip()
+ return {'host': '127.0.0.1', 'port': port,
+ 'internal_access_path': None}
+ except processutils.ProcessExecutionError as err:
+ LOG.error(_("Unable to read VNC console port from zone VNC "
+ "console SMF service '%s': %s"
+ % (console_fmri, err)))
def get_spice_console(self, instance):
# TODO(Vek): Need to pass context in for access to auth_token
@@ -2294,7 +2495,7 @@
def add_to_aggregate(self, context, aggregate, host, **kwargs):
"""Add a compute host to an aggregate."""
- #NOTE(jogo) Currently only used for XenAPI-Pool
+ # NOTE(jogo) Currently only used for XenAPI-Pool
raise NotImplementedError()
def remove_from_aggregate(self, context, aggregate, host, **kwargs):