* [dts] [PATCH] qemu-kvm: Add support to provide Kernel Image explicitly to boot VM
@ 2019-06-27 8:32 pvukkisala
2019-07-03 6:07 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: pvukkisala @ 2019-06-27 8:32 UTC (permalink / raw)
To: dts; +Cc: avijay, fmasood, Phanendra Vukkisala
From: Phanendra Vukkisala <pvukkisala@marvell.com>
Enables option to boot VM with Kernel Image which is not part of VM image.
Enables provding kernel boot parameters from configs
Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
conf/sriov_kvm.cfg | 10 ++++++++++
framework/qemu_kvm.py | 26 ++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/conf/sriov_kvm.cfg b/conf/sriov_kvm.cfg
index a7ba884..8106e04 100644
--- a/conf/sriov_kvm.cfg
+++ b/conf/sriov_kvm.cfg
@@ -98,6 +98,16 @@
# note:
# By default VM will start with the daemonize status.
# Not support starting it on the stdin now.
+#
+#kernel
+# kernel_img: <path of kernel image>
+# note: adding kernel_img use this kernel and following argument to as
+# kernel boot command args
+# console: ttyS0
+# baudrate: 115200
+# root: /dev/sda2 rw rootwait
+# note: along with root path, can provide any other extra parameters
+#
# vm configuration for pmd sriov case
diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 80a39c8..8408795 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -483,6 +483,32 @@ class QEMUKvm(VirtBase):
elif options['type'] in ['tap', 'bridge']:
self.net_type = 'bridge'
+ def add_vm_kernel(self, **options):
+ """
+ Add Kernel Image explicitly
+ kernel_img: path to kernel Image
+ console: console details in kernel boot args
+ baudrate: console access baudrate in kernel boot args
+ root: root partition details in kernel boot args
+ """
+ print options
+ if 'kernel_img' in options.keys() and options['kernel_img']:
+ kernel_boot_line = '-kernel %s' % options['kernel_img']
+ else:
+ return False
+ self.__add_boot_line(kernel_boot_line)
+ kernel_args = ""
+ if 'console' in options.keys() and options['console']:
+ kernel_args = "console=%s" %options['console']
+ if 'baudrate' in options.keys() and options['baudrate']:
+ kernel_args += "," + options['baudrate']
+ if 'root' in options.keys() and options['root']:
+ kernel_args += " root=%s" %options['root']
+ if kernel_args:
+ append_boot_line = '--append \"%s\"' %kernel_args
+ self.__add_boot_line(append_boot_line)
+
+
def __add_vm_net_nic(self, **options):
"""
type: nic
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH] qemu-kvm: Add support to provide Kernel Image explicitly to boot VM
2019-06-27 8:32 [dts] [PATCH] qemu-kvm: Add support to provide Kernel Image explicitly to boot VM pvukkisala
@ 2019-07-03 6:07 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-07-03 6:07 UTC (permalink / raw)
To: pvukkisala, dts; +Cc: avijay, fmasood
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of
> pvukkisala@marvell.com
> Sent: Thursday, June 27, 2019 4:33 PM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] qemu-kvm: Add support to provide Kernel Image
> explicitly to boot VM
>
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
>
> Enables option to boot VM with Kernel Image which is not part of VM image.
> Enables provding kernel boot parameters from configs
>
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
> conf/sriov_kvm.cfg | 10 ++++++++++
> framework/qemu_kvm.py | 26 ++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/conf/sriov_kvm.cfg b/conf/sriov_kvm.cfg index a7ba884..8106e04
> 100644
> --- a/conf/sriov_kvm.cfg
> +++ b/conf/sriov_kvm.cfg
> @@ -98,6 +98,16 @@
> # note:
> # By default VM will start with the daemonize status.
> # Not support starting it on the stdin now.
> +#
> +#kernel
> +# kernel_img: <path of kernel image>
> +# note: adding kernel_img use this kernel and following argument to
> as
> +# kernel boot command args
> +# console: ttyS0
> +# baudrate: 115200
> +# root: /dev/sda2 rw rootwait
> +# note: along with root path, can provide any other extra parameters
> +#
>
>
> # vm configuration for pmd sriov case
> diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index
> 80a39c8..8408795 100644
> --- a/framework/qemu_kvm.py
> +++ b/framework/qemu_kvm.py
> @@ -483,6 +483,32 @@ class QEMUKvm(VirtBase):
> elif options['type'] in ['tap', 'bridge']:
> self.net_type = 'bridge'
>
> + def add_vm_kernel(self, **options):
> + """
> + Add Kernel Image explicitly
> + kernel_img: path to kernel Image
> + console: console details in kernel boot args
> + baudrate: console access baudrate in kernel boot args
> + root: root partition details in kernel boot args
> + """
> + print options
> + if 'kernel_img' in options.keys() and options['kernel_img']:
> + kernel_boot_line = '-kernel %s' % options['kernel_img']
> + else:
> + return False
> + self.__add_boot_line(kernel_boot_line)
> + kernel_args = ""
> + if 'console' in options.keys() and options['console']:
> + kernel_args = "console=%s" %options['console']
> + if 'baudrate' in options.keys() and options['baudrate']:
> + kernel_args += "," + options['baudrate']
> + if 'root' in options.keys() and options['root']:
> + kernel_args += " root=%s" %options['root']
> + if kernel_args:
> + append_boot_line = '--append \"%s\"' %kernel_args
> + self.__add_boot_line(append_boot_line)
> +
> +
> def __add_vm_net_nic(self, **options):
> """
> type: nic
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-03 6:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 8:32 [dts] [PATCH] qemu-kvm: Add support to provide Kernel Image explicitly to boot VM pvukkisala
2019-07-03 6:07 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).