All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot
@ 2017-03-24 20:38 Alistair Francis
  2017-03-24 20:38 ` [PATCH v2 2/2] runqemu: Add a background command option Alistair Francis
  2017-03-31 17:07 ` [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
  0 siblings, 2 replies; 7+ messages in thread
From: Alistair Francis @ 2017-03-24 20:38 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang, ross.burton

When booting QEMU with slirp networking we want to use QEMUs TFTP server
to make the images in deploy accessible to the guest.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 23c9efb..f76d976 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -832,7 +832,7 @@ class BaseConfig(object):
         self.kernel_cmdline_script += ' ip=dhcp'
         # Port mapping
         hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
-        qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
+        qb_slirp_opt_default = "-netdev user,id=net0%s,tftp=%s" % (hostfwd, self.get('DEPLOY_DIR_IMAGE'))
         qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
         # Figure out the port
         ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
-- 
2.9.3



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

* [PATCH v2 2/2] runqemu: Add a background command option
  2017-03-24 20:38 [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
@ 2017-03-24 20:38 ` Alistair Francis
  2017-04-01  7:19   ` Richard Purdie
  2017-03-31 17:07 ` [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
  1 sibling, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2017-03-24 20:38 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang, ross.burton

This allows callers to specify commands that should be run in the background
while running QEMU. This can be specified by assigning the commands to the
'QB_BACKGROUND_COMMAND' varialbe in the machine conf.

This is useful for starting automated debugging instances, automated
testing instances (using QMP) or other servers/clients that QEMU can
connect to.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index f76d976..b5cc56a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1118,6 +1118,13 @@ class BaseConfig(object):
                 kernel_opts += " -dtb %s" % self.dtb
         else:
             kernel_opts = ""
+        background_cmd = self.get('QB_BACKGROUND_COMMAND')
+
+        if background_cmd:
+            logger.info('Running in the background %s' % background_cmd)
+            if subprocess.call(background_cmd + ' &', shell=True) != 0:
+                raise Exception('Failed to run %s' % cmd)
+
         cmd = "%s %s" % (self.qemu_opt, kernel_opts)
         logger.info('Running %s' % cmd)
         if subprocess.call(cmd, shell=True) != 0:
-- 
2.9.3



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

* Re: [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot
  2017-03-24 20:38 [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
  2017-03-24 20:38 ` [PATCH v2 2/2] runqemu: Add a background command option Alistair Francis
@ 2017-03-31 17:07 ` Alistair Francis
  2017-04-07 16:59   ` Alistair Francis
  1 sibling, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2017-03-31 17:07 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core

On Fri, Mar 24, 2017 at 1:38 PM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> When booting QEMU with slirp networking we want to use QEMUs TFTP server
> to make the images in deploy accessible to the guest.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>

Ping?

> ---
>  scripts/runqemu | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 23c9efb..f76d976 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -832,7 +832,7 @@ class BaseConfig(object):
>          self.kernel_cmdline_script += ' ip=dhcp'
>          # Port mapping
>          hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
> -        qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
> +        qb_slirp_opt_default = "-netdev user,id=net0%s,tftp=%s" % (hostfwd, self.get('DEPLOY_DIR_IMAGE'))
>          qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
>          # Figure out the port
>          ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
> --
> 2.9.3
>


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

* Re: [PATCH v2 2/2] runqemu: Add a background command option
  2017-03-24 20:38 ` [PATCH v2 2/2] runqemu: Add a background command option Alistair Francis
@ 2017-04-01  7:19   ` Richard Purdie
  2017-04-03 17:47     ` Alistair Francis
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-04-01  7:19 UTC (permalink / raw)
  To: Alistair Francis, openembedded-core, liezhi.yang, ross.burton

On Fri, 2017-03-24 at 13:38 -0700, Alistair Francis wrote:
> This allows callers to specify commands that should be run in the
> background
> while running QEMU. This can be specified by assigning the commands
> to the
> 'QB_BACKGROUND_COMMAND' varialbe in the machine conf.
> 
> This is useful for starting automated debugging instances, automated
> testing instances (using QMP) or other servers/clients that QEMU can
> connect to.
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>  scripts/runqemu | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/runqemu b/scripts/runqemu
> index f76d976..b5cc56a 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -1118,6 +1118,13 @@ class BaseConfig(object):
>                  kernel_opts += " -dtb %s" % self.dtb
>          else:
>              kernel_opts = ""
> +        background_cmd = self.get('QB_BACKGROUND_COMMAND')
> +
> +        if background_cmd:
> +            logger.info('Running in the background %s' %
> background_cmd)
> +            if subprocess.call(background_cmd + ' &', shell=True) !=
> 0:
> +                raise Exception('Failed to run %s' % cmd)
> +

I have to admit I'm rather unsure about this. What cleans up this
process when runqemu finishes?

We tend to run into a lot of issues around cleanup and a subprocess
using "&" doesn't sound too attractive given the general issues we run
into.

Cheers,

Richard


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

* Re: [PATCH v2 2/2] runqemu: Add a background command option
  2017-04-01  7:19   ` Richard Purdie
@ 2017-04-03 17:47     ` Alistair Francis
  0 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2017-04-03 17:47 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

On Sat, Apr 1, 2017 at 12:19 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Fri, 2017-03-24 at 13:38 -0700, Alistair Francis wrote:
>> This allows callers to specify commands that should be run in the
>> background
>> while running QEMU. This can be specified by assigning the commands
>> to the
>> 'QB_BACKGROUND_COMMAND' varialbe in the machine conf.
>>
>> This is useful for starting automated debugging instances, automated
>> testing instances (using QMP) or other servers/clients that QEMU can
>> connect to.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>  scripts/runqemu | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index f76d976..b5cc56a 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -1118,6 +1118,13 @@ class BaseConfig(object):
>>                  kernel_opts += " -dtb %s" % self.dtb
>>          else:
>>              kernel_opts = ""
>> +        background_cmd = self.get('QB_BACKGROUND_COMMAND')
>> +
>> +        if background_cmd:
>> +            logger.info('Running in the background %s' %
>> background_cmd)
>> +            if subprocess.call(background_cmd + ' &', shell=True) !=
>> 0:
>> +                raise Exception('Failed to run %s' % cmd)
>> +
>
> I have to admit I'm rather unsure about this. What cleans up this
> process when runqemu finishes?

True, there is nothing cleaning up after the process. The assumption
is that whatever is being run is tied to QEMU somehow and exits when
QEMU exits.

>
> We tend to run into a lot of issues around cleanup and a subprocess
> using "&" doesn't sound too attractive given the general issues we run
> into.

Do you have another option that you would prefer? I'm happy to change
it to something else.

Would it be better if we kept track of the PID and killed the process
before exit?

Thanks,

Alistair

>
> Cheers,
>
> Richard
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot
  2017-03-31 17:07 ` [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
@ 2017-04-07 16:59   ` Alistair Francis
  2017-04-18 21:08     ` Alistair Francis
  0 siblings, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2017-04-07 16:59 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core

On Fri, Mar 31, 2017 at 10:07 AM, Alistair Francis <alistair23@gmail.com> wrote:
> On Fri, Mar 24, 2017 at 1:38 PM, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> When booting QEMU with slirp networking we want to use QEMUs TFTP server
>> to make the images in deploy accessible to the guest.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>
> Ping?

Ping^2

I received comments on the second patch, but nothing on this one.

Thanks,

Alistair

>
>> ---
>>  scripts/runqemu | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index 23c9efb..f76d976 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -832,7 +832,7 @@ class BaseConfig(object):
>>          self.kernel_cmdline_script += ' ip=dhcp'
>>          # Port mapping
>>          hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
>> -        qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
>> +        qb_slirp_opt_default = "-netdev user,id=net0%s,tftp=%s" % (hostfwd, self.get('DEPLOY_DIR_IMAGE'))
>>          qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
>>          # Figure out the port
>>          ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
>> --
>> 2.9.3
>>


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

* Re: [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot
  2017-04-07 16:59   ` Alistair Francis
@ 2017-04-18 21:08     ` Alistair Francis
  0 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2017-04-18 21:08 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core

On Fri, Apr 7, 2017 at 9:59 AM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> On Fri, Mar 31, 2017 at 10:07 AM, Alistair Francis <alistair23@gmail.com> wrote:
>> On Fri, Mar 24, 2017 at 1:38 PM, Alistair Francis
>> <alistair.francis@xilinx.com> wrote:
>>> When booting QEMU with slirp networking we want to use QEMUs TFTP server
>>> to make the images in deploy accessible to the guest.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>>
>> Ping?
>
> Ping^2
>
> I received comments on the second patch, but nothing on this one.

Ping^3

>
> Thanks,
>
> Alistair
>
>>
>>> ---
>>>  scripts/runqemu | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/runqemu b/scripts/runqemu
>>> index 23c9efb..f76d976 100755
>>> --- a/scripts/runqemu
>>> +++ b/scripts/runqemu
>>> @@ -832,7 +832,7 @@ class BaseConfig(object):
>>>          self.kernel_cmdline_script += ' ip=dhcp'
>>>          # Port mapping
>>>          hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
>>> -        qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
>>> +        qb_slirp_opt_default = "-netdev user,id=net0%s,tftp=%s" % (hostfwd, self.get('DEPLOY_DIR_IMAGE'))
>>>          qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
>>>          # Figure out the port
>>>          ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
>>> --
>>> 2.9.3
>>>


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

end of thread, other threads:[~2017-04-18 21:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 20:38 [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
2017-03-24 20:38 ` [PATCH v2 2/2] runqemu: Add a background command option Alistair Francis
2017-04-01  7:19   ` Richard Purdie
2017-04-03 17:47     ` Alistair Francis
2017-03-31 17:07 ` [PATCH v2 1/2] runqemu: Automatically add a TFTP directory for slirp boot Alistair Francis
2017-04-07 16:59   ` Alistair Francis
2017-04-18 21:08     ` Alistair Francis

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.