All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts
@ 2023-02-24 15:31 Clément Péron
  2023-02-24 15:31 ` [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device Clément Péron
  2023-03-05 21:04 ` [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Alexandre Belloni
  0 siblings, 2 replies; 6+ messages in thread
From: Clément Péron @ 2023-02-24 15:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Clément Péron, Brenda Streiff

Split out the QEMU guest agent into a separate package. The agent is
intended to be installed within a QEMU VM guest where a user is likely
to not want to have the rest of the QEMU installation within it.

Additionally, an initscript, udev rules file, and systemd unit file are
added to the package so that the guest agent can start automatically;
the former two come from Debian's packaging for qemu-guest-agent.

Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
---

This is a resend of the patch from Brenda Streiff where I changed
the:
SYSTEMD_SERVICE:${PN}-guest-agent = "${PN}-guest-agent.service"
in
SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"

 meta/recipes-devtools/qemu/qemu.inc | 35 ++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 92828e8f2d..cb443769f2 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -9,7 +9,7 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
 RDEPENDS:${PN}-ptest = "bash"
 
 require qemu-targets.inc
-inherit pkgconfig ptest
+inherit pkgconfig ptest update-rc.d systemd
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
@@ -30,6 +30,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch \
            file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
            file://0001-configure-Fix-check-tcg-not-executing-any-tests.patch \
+           file://qemu-guest-agent.init \
+           file://qemu-guest-agent.udev \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
@@ -130,6 +132,20 @@ do_configure[cleandirs] += "${B}"
 do_install () {
 	export STRIP=""
 	oe_runmake 'DESTDIR=${D}' install
+
+	# If we built the guest agent, also install startup/udev rules
+	if [ -e "${D}${bindir}/qemu-ga" ]; then
+		install -d ${D}${sysconfdir}/init.d/
+		install -m 0755 ${WORKDIR}/qemu-guest-agent.init ${D}${sysconfdir}/init.d/qemu-guest-agent
+		sed -i 's:@bindir@:${bindir}:' ${D}${sysconfdir}/init.d/qemu-guest-agent
+
+		install -d ${D}${sysconfdir}/udev/rules.d/
+		install -m 0644 ${WORKDIR}/qemu-guest-agent.udev ${D}${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules
+
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system
+		sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service
+	fi
 }
 
 # The following fragment will create a wrapper for qemu-mips user emulation
@@ -208,3 +224,20 @@ PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
 INSANE_SKIP:${PN} = "arch"
 
 FILES:${PN} += "${datadir}/icons"
+
+# Put the guest agent in a separate package
+PACKAGES =+ "${PN}-guest-agent"
+SUMMARY:${PN}-guest-agent = "QEMU guest agent"
+FILES:${PN}-guest-agent += " \
+    ${bindir}/qemu-ga \
+    ${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules \
+    ${sysconfdir}/init.d/qemu-guest-agent \
+    ${systemd_unitdir}/system/qemu-guest-agent.service \
+"
+
+INITSCRIPT_PACKAGES = "${PN}-guest-agent"
+INITSCRIPT_NAME:${PN}-guest-agent = "qemu-guest-agent"
+INITSCRIPT_PARAMS:${PN}-guest-agent = "defaults"
+
+SYSTEMD_PACKAGES = "${PN}-guest-agent"
+SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device
  2023-02-24 15:31 [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Clément Péron
@ 2023-02-24 15:31 ` Clément Péron
  2023-03-06  6:30   ` [OE-core] " Alexander Kanavin
  2023-03-05 21:04 ` [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Alexandre Belloni
  1 sibling, 1 reply; 6+ messages in thread
From: Clément Péron @ 2023-02-24 15:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Clément Péron, Brenda Streiff

Add support to the runqemu script for a new option, 'guestagent', that
enables the virtio serial port for host-to-guest communication.

Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 scripts/runqemu | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index def11ea911..e71a1e8828 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -82,6 +82,7 @@ of the following environment variables (in any order):
     kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
     publicvnc - enable a VNC server open to all hosts
     audio - enable audio
+    guestagent - enable guest agent communication
     [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
   tcpserial=<port> - specify tcp serial port number
   qemuparams=<xyz> - specify custom parameters to QEMU
@@ -216,6 +217,8 @@ class BaseConfig(object):
         self.cleaned = False
         # Files to cleanup after run
         self.cleanup_files = []
+        self.guest_agent = False
+        self.guest_agent_sockpath = '/tmp/qga.sock'
 
     def acquire_taplock(self, error=True):
         logger.debug("Acquiring lockfile %s..." % self.taplock)
@@ -526,6 +529,10 @@ class BaseConfig(object):
             elif arg == 'publicvnc':
                 self.publicvnc = True
                 self.qemu_opt_script += ' -vnc :0'
+            elif arg == 'guestagent':
+                self.guest_agent = True
+            elif arg.startswith('guestagent-sockpath='):
+                self.guest_agent_sockpath = '%s' % arg[len('guestagent-sockpath='):]
             elif arg.startswith('tcpserial='):
                 self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
             elif arg.startswith('qemuparams='):
@@ -1366,6 +1373,12 @@ class BaseConfig(object):
             raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
         self.qemu_system = qemu_system
 
+    def setup_guest_agent(self):
+        if self.guest_agent == True:
+            self.qemu_opt += ' -chardev socket,path=' + self.guest_agent_sockpath + ',server,nowait,id=qga0 '
+            self.qemu_opt += ' -device virtio-serial '
+            self.qemu_opt += ' -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 '
+
     def setup_vga(self):
         if self.nographic == True:
             if self.sdl == True:
@@ -1496,6 +1509,7 @@ class BaseConfig(object):
         if self.snapshot:
             self.qemu_opt += " -snapshot"
 
+        self.setup_guest_agent()
         self.setup_serial()
         self.setup_vga()
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts
  2023-02-24 15:31 [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Clément Péron
  2023-02-24 15:31 ` [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device Clément Péron
@ 2023-03-05 21:04 ` Alexandre Belloni
  2023-03-05 21:48   ` Richard Purdie
  1 sibling, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2023-03-05 21:04 UTC (permalink / raw)
  To: Clément Péron; +Cc: openembedded-core, Brenda Streiff

Hello,

This doesn't apply on master, can you rebase?

On 24/02/2023 16:31:56+0100, Cl�ment P�ron wrote:
> Split out the QEMU guest agent into a separate package. The agent is
> intended to be installed within a QEMU VM guest where a user is likely
> to not want to have the rest of the QEMU installation within it.
> 
> Additionally, an initscript, udev rules file, and systemd unit file are
> added to the package so that the guest agent can start automatically;
> the former two come from Debian's packaging for qemu-guest-agent.
> 
> Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
> Signed-off-by: Cl�ment P�ron <peron.clem@gmail.com>
> ---
> 
> This is a resend of the patch from Brenda Streiff where I changed
> the:
> SYSTEMD_SERVICE:${PN}-guest-agent = "${PN}-guest-agent.service"
> in
> SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"
> 
>  meta/recipes-devtools/qemu/qemu.inc | 35 ++++++++++++++++++++++++++++-
>  1 file changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index 92828e8f2d..cb443769f2 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -9,7 +9,7 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
>  RDEPENDS:${PN}-ptest = "bash"
>  
>  require qemu-targets.inc
> -inherit pkgconfig ptest
> +inherit pkgconfig ptest update-rc.d systemd
>  
>  LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
>                      file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
> @@ -30,6 +30,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
>             file://0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch \
>             file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
>             file://0001-configure-Fix-check-tcg-not-executing-any-tests.patch \
> +           file://qemu-guest-agent.init \
> +           file://qemu-guest-agent.udev \
>             "
>  UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
>  
> @@ -130,6 +132,20 @@ do_configure[cleandirs] += "${B}"
>  do_install () {
>  	export STRIP=""
>  	oe_runmake 'DESTDIR=${D}' install
> +
> +	# If we built the guest agent, also install startup/udev rules
> +	if [ -e "${D}${bindir}/qemu-ga" ]; then
> +		install -d ${D}${sysconfdir}/init.d/
> +		install -m 0755 ${WORKDIR}/qemu-guest-agent.init ${D}${sysconfdir}/init.d/qemu-guest-agent
> +		sed -i 's:@bindir@:${bindir}:' ${D}${sysconfdir}/init.d/qemu-guest-agent
> +
> +		install -d ${D}${sysconfdir}/udev/rules.d/
> +		install -m 0644 ${WORKDIR}/qemu-guest-agent.udev ${D}${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules
> +
> +		install -d ${D}${systemd_unitdir}/system/
> +		install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system
> +		sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service
> +	fi
>  }
>  
>  # The following fragment will create a wrapper for qemu-mips user emulation
> @@ -208,3 +224,20 @@ PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
>  INSANE_SKIP:${PN} = "arch"
>  
>  FILES:${PN} += "${datadir}/icons"
> +
> +# Put the guest agent in a separate package
> +PACKAGES =+ "${PN}-guest-agent"
> +SUMMARY:${PN}-guest-agent = "QEMU guest agent"
> +FILES:${PN}-guest-agent += " \
> +    ${bindir}/qemu-ga \
> +    ${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules \
> +    ${sysconfdir}/init.d/qemu-guest-agent \
> +    ${systemd_unitdir}/system/qemu-guest-agent.service \
> +"
> +
> +INITSCRIPT_PACKAGES = "${PN}-guest-agent"
> +INITSCRIPT_NAME:${PN}-guest-agent = "qemu-guest-agent"
> +INITSCRIPT_PARAMS:${PN}-guest-agent = "defaults"
> +
> +SYSTEMD_PACKAGES = "${PN}-guest-agent"
> +SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#178050): https://lists.openembedded.org/g/openembedded-core/message/178050
> Mute This Topic: https://lists.openembedded.org/mt/97410706/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts
  2023-03-05 21:04 ` [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Alexandre Belloni
@ 2023-03-05 21:48   ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2023-03-05 21:48 UTC (permalink / raw)
  To: alexandre.belloni, Clément Péron
  Cc: openembedded-core, Brenda Streiff

On Sun, 2023-03-05 at 22:04 +0100, Alexandre Belloni via
lists.openembedded.org wrote:
> Hello,
> 
> This doesn't apply on master, can you rebase?
> 
> On 24/02/2023 16:31:56+0100, Clément Péron wrote:
> > Split out the QEMU guest agent into a separate package. The agent is
> > intended to be installed within a QEMU VM guest where a user is likely
> > to not want to have the rest of the QEMU installation within it.
> > 
> > Additionally, an initscript, udev rules file, and systemd unit file are
> > added to the package so that the guest agent can start automatically;
> > the former two come from Debian's packaging for qemu-guest-agent.
> > 
> > Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
> > Signed-off-by: Clément Péron <peron.clem@gmail.com>
> > ---
> > 
> > This is a resend of the patch from Brenda Streiff where I changed
> > the:
> > SYSTEMD_SERVICE:${PN}-guest-agent = "${PN}-guest-agent.service"
> > in
> > SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"
> > 
> >  meta/recipes-devtools/qemu/qemu.inc | 35 ++++++++++++++++++++++++++++-
> >  1 file changed, 34 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> > index 92828e8f2d..cb443769f2 100644
> > --- a/meta/recipes-devtools/qemu/qemu.inc
> > +++ b/meta/recipes-devtools/qemu/qemu.inc
> > @@ -9,7 +9,7 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
> >  RDEPENDS:${PN}-ptest = "bash"
> >  
> >  require qemu-targets.inc
> > -inherit pkgconfig ptest
> > +inherit pkgconfig ptest update-rc.d systemd
> >  
> >  LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
> >                      file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
> > @@ -30,6 +30,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
> >             file://0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch \
> >             file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
> >             file://0001-configure-Fix-check-tcg-not-executing-any-tests.patch \
> > +           file://qemu-guest-agent.init \
> > +           file://qemu-guest-agent.udev \


These files are missing too...

I was a little worried about the licensing, we need to ensure that is
handled correctly.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device
  2023-02-24 15:31 ` [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device Clément Péron
@ 2023-03-06  6:30   ` Alexander Kanavin
  2023-03-08  9:32     ` Clément Péron
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2023-03-06  6:30 UTC (permalink / raw)
  To: Clément Péron; +Cc: openembedded-core, Brenda Streiff

Can you please explain the use case? Who would want to enable the
option, and what could they do when there's a running qemu?

This kind of information needs to go to the commit message, so we can
document those things for the users.

Alex

On Sun, 5 Mar 2023 at 21:10, Clément Péron <peron.clem@gmail.com> wrote:
>
> Add support to the runqemu script for a new option, 'guestagent', that
> enables the virtio serial port for host-to-guest communication.
>
> Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
> Signed-off-by: Clément Péron <peron.clem@gmail.com>
> ---
>  scripts/runqemu | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index def11ea911..e71a1e8828 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -82,6 +82,7 @@ of the following environment variables (in any order):
>      kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
>      publicvnc - enable a VNC server open to all hosts
>      audio - enable audio
> +    guestagent - enable guest agent communication
>      [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
>    tcpserial=<port> - specify tcp serial port number
>    qemuparams=<xyz> - specify custom parameters to QEMU
> @@ -216,6 +217,8 @@ class BaseConfig(object):
>          self.cleaned = False
>          # Files to cleanup after run
>          self.cleanup_files = []
> +        self.guest_agent = False
> +        self.guest_agent_sockpath = '/tmp/qga.sock'
>
>      def acquire_taplock(self, error=True):
>          logger.debug("Acquiring lockfile %s..." % self.taplock)
> @@ -526,6 +529,10 @@ class BaseConfig(object):
>              elif arg == 'publicvnc':
>                  self.publicvnc = True
>                  self.qemu_opt_script += ' -vnc :0'
> +            elif arg == 'guestagent':
> +                self.guest_agent = True
> +            elif arg.startswith('guestagent-sockpath='):
> +                self.guest_agent_sockpath = '%s' % arg[len('guestagent-sockpath='):]
>              elif arg.startswith('tcpserial='):
>                  self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
>              elif arg.startswith('qemuparams='):
> @@ -1366,6 +1373,12 @@ class BaseConfig(object):
>              raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
>          self.qemu_system = qemu_system
>
> +    def setup_guest_agent(self):
> +        if self.guest_agent == True:
> +            self.qemu_opt += ' -chardev socket,path=' + self.guest_agent_sockpath + ',server,nowait,id=qga0 '
> +            self.qemu_opt += ' -device virtio-serial '
> +            self.qemu_opt += ' -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 '
> +
>      def setup_vga(self):
>          if self.nographic == True:
>              if self.sdl == True:
> @@ -1496,6 +1509,7 @@ class BaseConfig(object):
>          if self.snapshot:
>              self.qemu_opt += " -snapshot"
>
> +        self.setup_guest_agent()
>          self.setup_serial()
>          self.setup_vga()
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#178051): https://lists.openembedded.org/g/openembedded-core/message/178051
> Mute This Topic: https://lists.openembedded.org/mt/97410707/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device
  2023-03-06  6:30   ` [OE-core] " Alexander Kanavin
@ 2023-03-08  9:32     ` Clément Péron
  0 siblings, 0 replies; 6+ messages in thread
From: Clément Péron @ 2023-03-08  9:32 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Brenda Streiff

Hi Alexander,

On Mon, 6 Mar 2023 at 07:30, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> Can you please explain the use case? Who would want to enable the
> option, and what could they do when there's a running qemu?


Guest agent communication is useful to retrieve some information about
a running VM.

In my case, I use it to get the IP address of a VM configured using
macvtap which is not able to directly talk to the host over IP.

BR,
Clement

>
> This kind of information needs to go to the commit message, so we can
> document those things for the users.
>
> Alex
>
> On Sun, 5 Mar 2023 at 21:10, Clément Péron <peron.clem@gmail.com> wrote:
> >
> > Add support to the runqemu script for a new option, 'guestagent', that
> > enables the virtio serial port for host-to-guest communication.
> >
> > Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
> > Signed-off-by: Clément Péron <peron.clem@gmail.com>
> > ---
> >  scripts/runqemu | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/scripts/runqemu b/scripts/runqemu
> > index def11ea911..e71a1e8828 100755
> > --- a/scripts/runqemu
> > +++ b/scripts/runqemu
> > @@ -82,6 +82,7 @@ of the following environment variables (in any order):
> >      kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
> >      publicvnc - enable a VNC server open to all hosts
> >      audio - enable audio
> > +    guestagent - enable guest agent communication
> >      [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
> >    tcpserial=<port> - specify tcp serial port number
> >    qemuparams=<xyz> - specify custom parameters to QEMU
> > @@ -216,6 +217,8 @@ class BaseConfig(object):
> >          self.cleaned = False
> >          # Files to cleanup after run
> >          self.cleanup_files = []
> > +        self.guest_agent = False
> > +        self.guest_agent_sockpath = '/tmp/qga.sock'
> >
> >      def acquire_taplock(self, error=True):
> >          logger.debug("Acquiring lockfile %s..." % self.taplock)
> > @@ -526,6 +529,10 @@ class BaseConfig(object):
> >              elif arg == 'publicvnc':
> >                  self.publicvnc = True
> >                  self.qemu_opt_script += ' -vnc :0'
> > +            elif arg == 'guestagent':
> > +                self.guest_agent = True
> > +            elif arg.startswith('guestagent-sockpath='):
> > +                self.guest_agent_sockpath = '%s' % arg[len('guestagent-sockpath='):]
> >              elif arg.startswith('tcpserial='):
> >                  self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
> >              elif arg.startswith('qemuparams='):
> > @@ -1366,6 +1373,12 @@ class BaseConfig(object):
> >              raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
> >          self.qemu_system = qemu_system
> >
> > +    def setup_guest_agent(self):
> > +        if self.guest_agent == True:
> > +            self.qemu_opt += ' -chardev socket,path=' + self.guest_agent_sockpath + ',server,nowait,id=qga0 '
> > +            self.qemu_opt += ' -device virtio-serial '
> > +            self.qemu_opt += ' -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 '
> > +
> >      def setup_vga(self):
> >          if self.nographic == True:
> >              if self.sdl == True:
> > @@ -1496,6 +1509,7 @@ class BaseConfig(object):
> >          if self.snapshot:
> >              self.qemu_opt += " -snapshot"
> >
> > +        self.setup_guest_agent()
> >          self.setup_serial()
> >          self.setup_vga()
> >
> > --
> > 2.34.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#178051): https://lists.openembedded.org/g/openembedded-core/message/178051
> > Mute This Topic: https://lists.openembedded.org/mt/97410707/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-08  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 15:31 [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Clément Péron
2023-02-24 15:31 ` [PATCH v2 2/2] runqemu: add an option to enable guest-agent virtio device Clément Péron
2023-03-06  6:30   ` [OE-core] " Alexander Kanavin
2023-03-08  9:32     ` Clément Péron
2023-03-05 21:04 ` [OE-core] [PATCH v2 1/2] qemu: split out qemu-guest-agent, add startup scripts Alexandre Belloni
2023-03-05 21:48   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.