diff --git a/templates/default/new-vm-sync b/templates/default/new-vm-sync index ad6d86cb..b4a1d97f 100644 --- a/templates/default/new-vm-sync +++ b/templates/default/new-vm-sync @@ -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", diff --git a/upgrade-db/Migrations.hs b/upgrade-db/Migrations.hs index cedf74c4..b44f08f7 100644 --- a/upgrade-db/Migrations.hs +++ b/upgrade-db/Migrations.hs @@ -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 @@ -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 diff --git a/upgrade-db/Migrations/M_37.hs b/upgrade-db/Migrations/M_37.hs new file mode 100644 index 00000000..26e7a8e5 --- /dev/null +++ b/upgrade-db/Migrations/M_37.hs @@ -0,0 +1 @@ +-- Migration 37 does not exist in stable-8 diff --git a/upgrade-db/Migrations/M_38.hs b/upgrade-db/Migrations/M_38.hs new file mode 100644 index 00000000..3314477e --- /dev/null +++ b/upgrade-db/Migrations/M_38.hs @@ -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 . +-- + +{-# 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" diff --git a/upgrade-db/Upgrade.hs b/upgrade-db/Upgrade.hs index aaf30fb4..996913e1 100644 --- a/upgrade-db/Upgrade.hs +++ b/upgrade-db/Upgrade.hs @@ -40,7 +40,7 @@ import qualified Data.Text as T -- MODIFY THIS WHEN FORMAT CHANGES latestVersion :: Int -latestVersion = 37 +latestVersion = 39 ---------------------------------- dbdRunning :: IO Bool