Skip to content

Commit

Permalink
Merge pull request #124 from jandryuk/stable-8-syncvm-flask
Browse files Browse the repository at this point in the history
STABLE-8: OXT-1384: Syncvm Flask label
  • Loading branch information
eric-ch authored Jul 30, 2018
2 parents 8f3fea9 + 1879d7c commit db93ba3
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
4 changes: 1 addition & 3 deletions templates/default/new-vm-sync
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"display": "none",
"cmdline": "root=\/dev\/xvda1 xencons=hvc0",
"kernel-extract": "\/boot\/bzImage",
"extra-xenvm": {
"0": "flask-label=system_u:system_r:syncvm_t"
},
"flask-label": "system_u:system_r:syncvm_t",
"nic": {
"0": {
"id": "0",
Expand Down
2 changes: 2 additions & 0 deletions upgrade-db/Migrations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import qualified Migrations.M_33
import qualified Migrations.M_34
import qualified Migrations.M_35
import qualified Migrations.M_36
import qualified Migrations.M_38

migrations :: [Migration]
migrations = [ Migrations.M_1.migration
Expand Down Expand Up @@ -95,6 +96,7 @@ migrations = [ Migrations.M_1.migration
, Migrations.M_34.migration
, Migrations.M_35.migration
, Migrations.M_36.migration
, Migrations.M_38.migration
]

getMigrationFromVer :: Int -> Migration
Expand Down
1 change: 1 addition & 0 deletions upgrade-db/Migrations/M_37.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- Migration 37 does not exist in stable-8
41 changes: 41 additions & 0 deletions upgrade-db/Migrations/M_38.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--
-- Copyright (c) 2012 Citrix Systems, Inc.
-- Copyright (c) 2018 Jason Andryuk
--
-- 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 2 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 <https://www.gnu.org/licenses/>.
--

{-# LANGUAGE PatternGuards #-}

module Migrations.M_38 (migration) where

import UpgradeEngine

migration = Migration {
sourceVersion = 37 -- skipping 38 not in stable-8
, targetVersion = 39
, actions = act
}

act :: IO ()
act = updateSyncvm

updateSyncvm = xformVmJSON xform where
xform tree = case jsGet "/type" tree of
Just s | jsUnboxString s == "syncvm" -> modify tree
_ -> tree
where
modify = jsSet "/config/flask-label"
(jsBoxString "system_u:system_r:syncvm_t") .
jsRm "/config/extra-xenvm/0"
2 changes: 1 addition & 1 deletion upgrade-db/Upgrade.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import qualified Data.Text as T

-- MODIFY THIS WHEN FORMAT CHANGES
latestVersion :: Int
latestVersion = 37
latestVersion = 39
----------------------------------

dbdRunning :: IO Bool
Expand Down

0 comments on commit db93ba3

Please sign in to comment.