From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2A701239 for ; Mon, 27 Nov 2017 08:21:36 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2017 23:21:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,463,1505804400"; d="scan'208";a="180533965" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 26 Nov 2017 23:21:33 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Nov 2017 23:21:32 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Nov 2017 23:21:32 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Mon, 27 Nov 2017 15:21:30 +0800 From: "Liu, Yong" To: Phil Yang , "dts@dpdk.org" CC: "nd@arm.com" , "Jianbo.Liu@arm.com" , "Herbert.Guan@arm.com" Thread-Topic: [dts] [PATCH] framework/qemu_kvm: Add machine and pflash option support Thread-Index: AQHTY3WMjgemnw3W9E6cc5HjU1OSX6Mn156w Date: Mon, 27 Nov 2017 07:21:30 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62F1EE22@SHSMSX103.ccr.corp.intel.com> References: <1511343401-6459-1-git-send-email-phil.yang@arm.com> In-Reply-To: <1511343401-6459-1-git-send-email-phil.yang@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmVlZDVhNjYtOWNlNy00NjEzLTk4MGYtZWJmNTRlZGZiOGJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJicTVIYjBwM29ETVJUUkx6WVpaSHVVaWxpOXVsNmxMS0dHQnB6QVpWWUlKUW5sSFk2dlUzNzNaTG56KzFKV3dTIn0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] framework/qemu_kvm: Add machine and pflash option support X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2017 07:21:37 -0000 Hi Phil, Overall I'm fine with your patch. Just two comments as below. 1. I can't find code for the fix which mentioned in commit log line 3. 2. Since you are adding some options for virtual machine, please add some d= escriptions in doc/dts_gsg/virtualization.rst and reference configuration f= ile. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Phil Yang > Sent: Wednesday, November 22, 2017 5:37 PM > To: dts@dpdk.org > Cc: nd@arm.com; Jianbo.Liu@arm.com; Herbert.Guan@arm.com; > phil.yang@arm.com > Subject: [dts] [PATCH] framework/qemu_kvm: Add machine and pflash option > support >=20 > 1. Add machine and pflash option support; > 2. Set default machine type 'virt' for Aarch64; > 3. Fix Aarch64 vhost vm case failure when using the default "-net nic > model". > since the default nic type in vm is "virtio". > 4. Add opt_format, opt_if, opt_index, opt_media for disk option. >=20 > Signed-off-by: Phil Yang > --- > conf/vhost_sample.cfg | 10 ++++++++++ > framework/qemu_kvm.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 55 insertions(+) >=20 > diff --git a/conf/vhost_sample.cfg b/conf/vhost_sample.cfg > index 8bdc20e..ab71936 100644 > --- a/conf/vhost_sample.cfg > +++ b/conf/vhost_sample.cfg > @@ -2,6 +2,9 @@ > # name > # name: vm0 > # > +# machine > +# machine: [virt | ...] > +# > # enable_kvm > # enable: [yes | no] > # > @@ -18,6 +21,13 @@ > # > # disk > # file: /path/to/image/test.img > +# opt_format: raw > +# opt_if: virtio > +# opt_index: 0 > +# opt_media: disk > +# > +# pflash > +# file: /path/to/image/pflash0.img > # > # char > # opt_path: define the file path to vhost-net socket file > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py > index 79095bd..42acd69 100644 > --- a/framework/qemu_kvm.py > +++ b/framework/qemu_kvm.py > @@ -98,12 +98,17 @@ class QEMUKvm(VirtBase): > # internal variable to track whether default nic has been added > self.__default_nic =3D False >=20 > + # arch info for multi-paltform init > + self.arch =3D self.host_session.send_expect('uname -m', '# ') > + > # set some default values for vm, > # if there is not the values of the specified options > self.set_vm_default() >=20 > def set_vm_default(self): > self.set_vm_name(self.vm_name) > + if self.arch =3D=3D 'aarch64': > + self.set_vm_machine('virt') > self.set_vm_enable_kvm() > self.set_vm_pid_file() > self.set_vm_qga() > @@ -249,6 +254,25 @@ class QEMUKvm(VirtBase): > enable_kvm_boot_line =3D '-enable-kvm' > self.__add_boot_line(enable_kvm_boot_line) >=20 > + def set_vm_machine(self, machine): > + """ > + Set VM boot option to specify the option 'machine'. > + """ > + index =3D self.find_option_index('machine') > + if index: > + self.params[index] =3D {'machine': [{'machine': '%s' % > machine}]} > + else: > + self.params.append({'machine': [{'machine': '%s' % machine}]= }) > + > + def add_vm_machine(self, **options): > + """ > + 'machine': 'virt' > + """ > + if 'machine' in options.keys() and \ > + options['machine']: > + machine_boot_line =3D '-machine %s' % options['machine'] > + self.__add_boot_line(machine_boot_line) > + > def set_vm_pid_file(self): > """ > Set VM pidfile option for manage qemu process > @@ -329,11 +353,32 @@ class QEMUKvm(VirtBase): > def add_vm_disk(self, **options): > """ > file: /home/image/test.img > + opt_format: raw > + opt_if: virtio > + opt_index: 0 > + opt_media: disk > """ > + separator =3D ',' > if 'file' in options.keys(): > disk_boot_line =3D '-drive file=3D%s' % options['file'] > + if 'opt_format' in options.keys(): > + disk_boot_line +=3D separator + 'format=3D%s' % > options['opt_format'] > + if 'opt_if' in options.keys(): > + disk_boot_line +=3D separator + 'if=3D%s' % options['opt= _if'] > + if 'opt_index' in options.keys(): > + disk_boot_line +=3D separator + 'index=3D%s' % > options['opt_index'] > + if 'opt_media' in options.keys(): > + disk_boot_line +=3D separator + 'media=3D%s' % > options['opt_media'] > self.__add_boot_line(disk_boot_line) >=20 > + def add_vm_pflash(self, **options): > + """ > + file: /home/image/flash0.img > + """ > + if 'file' in options.keys(): > + pflash_boot_line =3D '-pflash %s' % options['file'] > + self.__add_boot_line(pflash_boot_line) > + > def add_vm_login(self, **options): > """ > user: login username of virtual machine > -- > 2.7.4