From nobody Mon Apr 29 13:10:40 2024 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 1494624707951290.34729303253266; Fri, 12 May 2017 14:31:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 909AE804E9; Fri, 12 May 2017 21:31:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6F357BCCF; Fri, 12 May 2017 21:31:42 +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 4D386180BAF1; Fri, 12 May 2017 21:31:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4CLVa5f010872 for ; Fri, 12 May 2017 17:31:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id B30EAB9304; Fri, 12 May 2017 21:31:36 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABA0A5C896 for ; Fri, 12 May 2017 21:31:34 +0000 (UTC) Received: from ascension.private.dragonsdawn.net (home.dragonsdawn.net [50.199.12.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA5ED85376 for ; Fri, 12 May 2017 21:31:33 +0000 (UTC) Received: from hurricane.ee.washington.edu (localhost [::1]) by ascension.private.dragonsdawn.net with ESMTP; Fri, 12 May 2017 14:27:34 -0700 id 0000000000020077.00000000591628C6.00003CB3 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 909AE804E9 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=dragonsdawn.net 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 909AE804E9 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA5ED85376 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=dragonsdawn.net Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=gordon@dragonsdawn.net DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA5ED85376 From: Gordon Messmer To: libvir-list@redhat.com Date: Fri, 12 May 2017 14:27:27 -0700 Message-Id: <20170512212727.25462-1-gordon@dragonsdawn.net> X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 May 2017 21:31:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 May 2017 21:31:34 +0000 (UTC) for IP:'50.199.12.33' DOMAIN:'home.dragonsdawn.net' HELO:'ascension.private.dragonsdawn.net' FROM:'gordon@dragonsdawn.net' RCPT:'' X-RedHat-Spam-Score: 1.999 * (BAYES_80, RP_MATCHES_RCVD) 50.199.12.33 home.dragonsdawn.net 50.199.12.33 home.dragonsdawn.net X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Gordon Messmer Subject: [libvirt] [PATCH] virsh: add --io when attaching disks to guests 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 12 May 2017 21:31:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" virt-install and virt-manager both default to explicitly setting "io=3D'native'" in the disk "driver" tag. virsh, however, does not and also does not provide an option to specify that setting at all. As a result, disks use a different IO mechanism (the default, "threads") when attached post-setup using virsh. Adding this option allows users to keep disk performance consistent for disks attached at install, and those attached afterward. Reviewed-by: John Ferlan --- tools/virsh-domain.c | 14 +++++++++++--- tools/virsh.pod | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 0d19d0e..5c42021 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -267,6 +267,10 @@ static const vshCmdOptDef opts_attach_disk[] =3D { .type =3D VSH_OT_STRING, .help =3D N_("cache mode of disk device") }, + {.name =3D "io", + .type =3D VSH_OT_STRING, + .help =3D N_("io policy of disk device") + }, {.name =3D "type", .type =3D VSH_OT_STRING, .help =3D N_("target device type") @@ -504,8 +508,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) virDomainPtr dom =3D NULL; const char *source =3D NULL, *target =3D NULL, *driver =3D NULL, *subdriver =3D NULL, *type =3D NULL, *mode =3D NULL, - *iothread =3D NULL, *cache =3D NULL, *serial =3D NULL, - *straddr =3D NULL, *wwn =3D NULL, *targetbus =3D NULL; + *iothread =3D NULL, *cache =3D NULL, *io =3D NULL, + *serial =3D NULL, *straddr =3D NULL, *wwn =3D NULL, + *targetbus =3D NULL; struct DiskAddress diskAddr; bool isFile =3D false, functionReturn =3D false; int ret; @@ -537,6 +542,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0 || vshCommandOptStringReq(ctl, cmd, "iothread", &iothread) < 0 || vshCommandOptStringReq(ctl, cmd, "cache", &cache) < 0 || + vshCommandOptStringReq(ctl, cmd, "io", &io) < 0 || vshCommandOptStringReq(ctl, cmd, "serial", &serial) < 0 || vshCommandOptStringReq(ctl, cmd, "wwn", &wwn) < 0 || vshCommandOptStringReq(ctl, cmd, "address", &straddr) < 0 || @@ -579,7 +585,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) virBufferAddLit(&buf, ">\n"); virBufferAdjustIndent(&buf, 2); =20 - if (driver || subdriver || iothread || cache) { + if (driver || subdriver || iothread || cache || io) { virBufferAddLit(&buf, "\n"); } diff --git a/tools/virsh.pod b/tools/virsh.pod index 727acf6..f46fb4a 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2838,7 +2838,7 @@ expected. =3Ditem B I I I [[[I<--live>] [I<--co= nfig>] | [I<--current>]] | [I<--persistent>]] [I<--targetbus bus>] [I<--driver driver>] [I<--subdriver subdriver>] [I<--iothread iothread>] -[I<--cache cache>] [I<--type type>] +[I<--cache cache>] [I<--io io>] [I<--type type>] [I<--mode mode>] [I<--sourcetype sourcetype>] [I<--serial serial>] [I<--wwn wwn>] [I<--rawio>] [I<--address address>] [I<--multifunction>] [I<--print-= xml>] =20 @@ -2865,6 +2865,7 @@ I can specify the two specific mode I= or I. I can indicate the type of source (block|file) I can be one of "default", "none", "writethrough", "writeback", "directsync" or "unsafe". +I controls specific policies on I/O; qemu guests support "threads" and= "native". I is the number within the range of domain IOThreads to which this disk may be attached (QEMU only). I is the serial of disk device. I is the wwn of disk device. --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list