From nobody Sun Feb 8 07:57:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1494509276983512.2034880877831; Thu, 11 May 2017 06:27:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55CFE80F90; Thu, 11 May 2017 13:27:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BB3988B36; Thu, 11 May 2017 13:27:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AA4E75EC68; Thu, 11 May 2017 13:27:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4BDRkWp025518 for ; Thu, 11 May 2017 09:27:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id F05C88AC5D; Thu, 11 May 2017 13:27:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7A7F8D551 for ; Thu, 11 May 2017 13:27:45 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1BC304E4C6 for ; Thu, 11 May 2017 13:27:44 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4BDIg74010334 for ; Thu, 11 May 2017 09:27:43 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ac3jyb865-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 11 May 2017 09:27:43 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 May 2017 07:27:40 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 May 2017 07:27:39 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4BDQsMh10355084 for ; Thu, 11 May 2017 06:27:35 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C698CBE042 for ; Thu, 11 May 2017 07:27:35 -0600 (MDT) Received: from alifm-ThinkPad-W540.endicott.ibm.com (unknown [9.60.75.194]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS id 90BEFBE03B for ; Thu, 11 May 2017 07:27:35 -0600 (MDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 55CFE80F90 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 55CFE80F90 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1BC304E4C6 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=alifm@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1BC304E4C6 From: Farhan Ali To: libvir-list@redhat.com Date: Thu, 11 May 2017 09:27:31 -0400 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 17051113-0016-0000-0000-000006B84C70 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007046; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000210; SDB=6.00859146; UDB=6.00425777; IPR=6.00638621; BA=6.00005345; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015411; XFM=3.00000015; UTC=2017-05-11 13:27:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051113-0017-0000-0000-000039985326 Message-Id: <61dd82dfe4271d95e147e54b0e597764ec1b74ea.1494442869.git.alifm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-11_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705110075 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 11 May 2017 13:27:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 11 May 2017 13:27:44 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'alifm@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -2.7 (BAYES_50, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 2/3] qemu : Add loadparm to qemu command line string X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 11 May 2017 13:27:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Introduce a new QEMU capability for loadparm and if the capability is supported by QEMU then append the loadparm value to "-machine" string of qemu command line. Signed-off-by: Farhan Ali Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 3 +++ src/qemu/qemu_command.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 71951e6..4034638 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -366,6 +366,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-named-block-nodes", "cpu-cache", "qemu-xhci", + + "loadparm", /* 255 */ ); =20 =20 @@ -3130,6 +3132,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCaps= CommandLine[] =3D { { "drive", "throttling.bps-total-max-length", QEMU_CAPS_DRIVE_IOTUNE_M= AX_LENGTH }, { "drive", "throttling.group", QEMU_CAPS_DRIVE_IOTUNE_GROUP }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, + { "machine", "loadparm", QEMU_CAPS_LOADPARM }, }; =20 static int diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 06a43ab..5464006 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -404,6 +404,9 @@ typedef enum { QEMU_CAPS_CPU_CACHE, /* -cpu supports host-cache-info and l3-cache pro= perties */ QEMU_CAPS_DEVICE_QEMU_XHCI, /* -device qemu-xhci */ =20 + /* 255 */ + QEMU_CAPS_LOADPARM, /* -machine loadparm */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 813a851..6608cf2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7208,6 +7208,41 @@ qemuAppendKeyWrapMachineParms(virBuffer *buf, virQEM= UCapsPtr qemuCaps, return true; } =20 +static void +qemuAppendLoadparmMachineParm(virBuffer *buf, + const virDomainDef *def, + virQEMUCapsPtr qemuCaps) +{ + size_t i =3D 0; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX) || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_LOADPARM)) + return; + + for (i =3D 0; i < def->ndisks; i++) { + virDomainDiskDefPtr disk =3D def->disks[i]; + + if (disk->info.bootIndex =3D=3D 1) { + if (disk->info.loadparm) + virBufferAsprintf(buf, ",loadparm=3D%s", disk->info.loadpa= rm); + + return; + } + } + + /* Network boot device*/ + for (i =3D 0; i < def->nnets; i++) { + virDomainNetDefPtr net =3D def->nets[i]; + + if (net->info.bootIndex =3D=3D 1) { + if (net->info.loadparm) + virBufferAsprintf(buf, ",loadparm=3D%s", net->info.loadpar= m); + + return; + } + } +} + static int qemuBuildNameCommandLine(virCommandPtr cmd, virQEMUDriverConfigPtr cfg, @@ -7297,6 +7332,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-machine"); virBufferAdd(&buf, def->os.machine, -1); =20 + qemuAppendLoadparmMachineParm(&buf, def, qemuCaps); + if (def->virtType =3D=3D VIR_DOMAIN_VIRT_QEMU) virBufferAddLit(&buf, ",accel=3Dtcg"); else if (def->virtType =3D=3D VIR_DOMAIN_VIRT_KVM) --=20 1.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list