[meta-arm,1/2] arm-autonomy, xenguest: Fail if Dom0 is not properly initialized

Submitted by Diego Sueiro on June 17, 2020, 6:02 a.m. | Patch ID: 173638

Details

Message ID 1592373744-85392-1-git-send-email-diego.sueiro@arm.com
State New
Headers show

Commit Message

Diego Sueiro June 17, 2020, 6:02 a.m.
During the xenguest initialization and when invoking the
xenguest-manager tool, abort the execution if Dom0 was not properly
initialized on top of Xen and with the proper kernel configurations.

Change-Id: I307c03e58a266a943968df1bc5ba39951912d2cb
Issue-Id: SCM-996
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 .../recipes-extended/xenguest/files/xenguest-init      |  3 +++
 .../recipes-extended/xenguest/files/xenguest-manager   | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
index 9563d2f..cd249cf 100755
--- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
+++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
@@ -12,6 +12,9 @@  fi
 
 source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
 
+# Make sure we properly initialized the Dom0
+/usr/bin/xenguest-manager check-xen || exit $?
+
 # Create guest list
 guestlist=$(/usr/bin/xenguest-manager list)
 
diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
index 99975a2..6a10d35 100755
--- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
+++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
@@ -566,6 +566,24 @@  case ${cmd} in
         usage
         exit 0
         ;;
+
+esac
+
+# Check if we have a valid Dom0 booted with Xen
+ERROR_MSG=$(xl info 2>&1)
+if [ $? -ne 0 ]; then
+    echo "ERROR: Xen environment is not valid!!!" | tee -a ${LOGFILE}
+    echo "ERROR: Check if Xen has booted and the kernel configuration." \
+        | tee -a ${LOGFILE}
+    echo "ERROR: Output from 'xl info' command:" | tee -a ${LOGFILE}
+    echo "$ERROR_MSG" | tee -a ${LOGFILE}
+    exit 1
+fi
+
+case ${cmd} in
+    check-xen)
+        exit 0
+        ;;
     create)
         guestfile="${arg1}"
         guestname="${arg2}"

Comments

Bertrand Marquis June 17, 2020, 8:03 a.m.
> On 17 Jun 2020, at 07:02, Diego Sueiro via lists.yoctoproject.org <diego.sueiro=arm.com@lists.yoctoproject.org> wrote:
> 
> During the xenguest initialization and when invoking the
> xenguest-manager tool, abort the execution if Dom0 was not properly
> initialized on top of Xen and with the proper kernel configurations.
> 
> Change-Id: I307c03e58a266a943968df1bc5ba39951912d2cb
> Issue-Id: SCM-996
> Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

> ---
> .../recipes-extended/xenguest/files/xenguest-init      |  3 +++
> .../recipes-extended/xenguest/files/xenguest-manager   | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+)
> 
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> index 9563d2f..cd249cf 100755
> --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> @@ -12,6 +12,9 @@ fi
> 
> source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
> 
> +# Make sure we properly initialized the Dom0
> +/usr/bin/xenguest-manager check-xen || exit $?
> +
> # Create guest list
> guestlist=$(/usr/bin/xenguest-manager list)
> 
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> index 99975a2..6a10d35 100755
> --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> @@ -566,6 +566,24 @@ case ${cmd} in
>         usage
>         exit 0
>         ;;
> +
> +esac
> +
> +# Check if we have a valid Dom0 booted with Xen
> +ERROR_MSG=$(xl info 2>&1)
> +if [ $? -ne 0 ]; then
> +    echo "ERROR: Xen environment is not valid!!!" | tee -a ${LOGFILE}
> +    echo "ERROR: Check if Xen has booted and the kernel configuration." \
> +        | tee -a ${LOGFILE}
> +    echo "ERROR: Output from 'xl info' command:" | tee -a ${LOGFILE}
> +    echo "$ERROR_MSG" | tee -a ${LOGFILE}
> +    exit 1
> +fi
> +
> +case ${cmd} in
> +    check-xen)
> +        exit 0
> +        ;;
>     create)
>         guestfile="${arg1}"
>         guestname="${arg2}"
> -- 
> 2.7.4
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#684): https://lists.yoctoproject.org/g/meta-arm/message/684
Mute This Topic: https://lists.yoctoproject.org/mt/74932438/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Jon Mason June 18, 2020, 10:19 p.m.
On Wed, Jun 17, 2020 at 07:02:23AM +0100, Diego Sueiro wrote:
> During the xenguest initialization and when invoking the
> xenguest-manager tool, abort the execution if Dom0 was not properly
> initialized on top of Xen and with the proper kernel configurations.
> 
> Change-Id: I307c03e58a266a943968df1bc5ba39951912d2cb
> Issue-Id: SCM-996
> Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>

Series pulled in to the master branch.

Thanks,
Jon

> ---
>  .../recipes-extended/xenguest/files/xenguest-init      |  3 +++
>  .../recipes-extended/xenguest/files/xenguest-manager   | 18 ++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> index 9563d2f..cd249cf 100755
> --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> @@ -12,6 +12,9 @@ fi
>  
>  source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
>  
> +# Make sure we properly initialized the Dom0
> +/usr/bin/xenguest-manager check-xen || exit $?
> +
>  # Create guest list
>  guestlist=$(/usr/bin/xenguest-manager list)
>  
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> index 99975a2..6a10d35 100755
> --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> @@ -566,6 +566,24 @@ case ${cmd} in
>          usage
>          exit 0
>          ;;
> +
> +esac
> +
> +# Check if we have a valid Dom0 booted with Xen
> +ERROR_MSG=$(xl info 2>&1)
> +if [ $? -ne 0 ]; then
> +    echo "ERROR: Xen environment is not valid!!!" | tee -a ${LOGFILE}
> +    echo "ERROR: Check if Xen has booted and the kernel configuration." \
> +        | tee -a ${LOGFILE}
> +    echo "ERROR: Output from 'xl info' command:" | tee -a ${LOGFILE}
> +    echo "$ERROR_MSG" | tee -a ${LOGFILE}
> +    exit 1
> +fi
> +
> +case ${cmd} in
> +    check-xen)
> +        exit 0
> +        ;;
>      create)
>          guestfile="${arg1}"
>          guestname="${arg2}"
> -- 
> 2.7.4
> 

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#710): https://lists.yoctoproject.org/g/meta-arm/message/710
Mute This Topic: https://lists.yoctoproject.org/mt/74932438/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Diego Sueiro June 19, 2020, 5:10 a.m.
On Thu, Jun 18, 2020 at 11:19 PM, Jon Mason wrote:

>
> On Wed, Jun 17, 2020 at 07:02:23AM +0100, Diego Sueiro wrote:
> > During the xenguest initialization and when invoking the
> > xenguest-manager tool, abort the execution if Dom0 was not properly
> > initialized on top of Xen and with the proper kernel configurations.
> > 
> > Change-Id: I307c03e58a266a943968df1bc5ba39951912d2cb
> > Issue-Id: SCM-996
> > Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
> 
> Series pulled in to the master branch.

Thanks. Can you please backport it to dunfell?

> 
> Thanks,
> Jon
> 
> > ---
> >  .../recipes-extended/xenguest/files/xenguest-init      |  3 +++
> >  .../recipes-extended/xenguest/files/xenguest-manager   | 18
> ++++++++++++++++++
> >  2 files changed, 21 insertions(+)
> > 
> > diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > index 9563d2f..cd249cf 100755
> > --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > @@ -12,6 +12,9 @@ fi
> >  
> >  source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
> >  
> > +# Make sure we properly initialized the Dom0
> > +/usr/bin/xenguest-manager check-xen || exit $?
> > +
> >  # Create guest list
> >  guestlist=$(/usr/bin/xenguest-manager list)
> >  
> > diff --git
> a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > index 99975a2..6a10d35 100755
> > --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > @@ -566,6 +566,24 @@ case ${cmd} in
> >          usage
> >          exit 0
> >          ;;
> > +
> > +esac
> > +
> > +# Check if we have a valid Dom0 booted with Xen
> > +ERROR_MSG=$(xl info 2>&1)
> > +if [ $? -ne 0 ]; then
> > +    echo "ERROR: Xen environment is not valid!!!" | tee -a ${LOGFILE}
> > +    echo "ERROR: Check if Xen has booted and the kernel configuration." \
> > +        | tee -a ${LOGFILE}
> > +    echo "ERROR: Output from 'xl info' command:" | tee -a ${LOGFILE}
> > +    echo "$ERROR_MSG" | tee -a ${LOGFILE}
> > +    exit 1
> > +fi
> > +
> > +case ${cmd} in
> > +    check-xen)
> > +        exit 0
> > +        ;;
> >      create)
> >          guestfile="${arg1}"
> >          guestname="${arg2}"
> > -- 
> > 2.7.4
> > 
> 
> > 
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#720): https://lists.yoctoproject.org/g/meta-arm/message/720
Mute This Topic: https://lists.yoctoproject.org/mt/74932438/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Jon Mason June 22, 2020, 1:40 p.m.
On Thu, Jun 18, 2020 at 10:10:33PM -0700, Diego Sueiro wrote:
> On Thu, Jun 18, 2020 at 11:19 PM, Jon Mason wrote:
> 
> >
> > On Wed, Jun 17, 2020 at 07:02:23AM +0100, Diego Sueiro wrote:
> > > During the xenguest initialization and when invoking the
> > > xenguest-manager tool, abort the execution if Dom0 was not properly
> > > initialized on top of Xen and with the proper kernel configurations.
> > > 
> > > Change-Id: I307c03e58a266a943968df1bc5ba39951912d2cb
> > > Issue-Id: SCM-996
> > > Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
> > 
> > Series pulled in to the master branch.
> 
> Thanks. Can you please backport it to dunfell?

Done

> 
> > 
> > Thanks,
> > Jon
> > 
> > > ---
> > >  .../recipes-extended/xenguest/files/xenguest-init      |  3 +++
> > >  .../recipes-extended/xenguest/files/xenguest-manager   | 18
> > ++++++++++++++++++
> > >  2 files changed, 21 insertions(+)
> > > 
> > > diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > > index 9563d2f..cd249cf 100755
> > > --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > > +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-init
> > > @@ -12,6 +12,9 @@ fi
> > >
> > >  source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
> > >
> > > +# Make sure we properly initialized the Dom0
> > > +/usr/bin/xenguest-manager check-xen || exit $?
> > > +
> > >  # Create guest list
> > >  guestlist=$(/usr/bin/xenguest-manager list)
> > >
> > > diff --git
> > a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > > index 99975a2..6a10d35 100755
> > > --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > > +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> > > @@ -566,6 +566,24 @@ case ${cmd} in
> > >          usage
> > >          exit 0
> > >          ;;
> > > +
> > > +esac
> > > +
> > > +# Check if we have a valid Dom0 booted with Xen
> > > +ERROR_MSG=$(xl info 2>&1)
> > > +if [ $? -ne 0 ]; then
> > > +    echo "ERROR: Xen environment is not valid!!!" | tee -a ${LOGFILE}
> > > +    echo "ERROR: Check if Xen has booted and the kernel configuration." \
> > > +        | tee -a ${LOGFILE}
> > > +    echo "ERROR: Output from 'xl info' command:" | tee -a ${LOGFILE}
> > > +    echo "$ERROR_MSG" | tee -a ${LOGFILE}
> > > +    exit 1
> > > +fi
> > > +
> > > +case ${cmd} in
> > > +    check-xen)
> > > +        exit 0
> > > +        ;;
> > >      create)
> > >          guestfile="${arg1}"
> > >          guestname="${arg2}"
> > > -- 
> > > 2.7.4
> > > 
> > 
> > > 
> > 
> >

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#729): https://lists.yoctoproject.org/g/meta-arm/message/729
Mute This Topic: https://lists.yoctoproject.org/mt/74932438/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-