From nobody Sun Apr 19 12:42:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1776274420; cv=none; d=zohomail.com; s=zohoarc; b=CJ2t6NrftHjdHFAqzEr6H6Br7Q6HNiX/f1t3ZTisANa9bqGAyMh2WSXlMg8f3qNUqR/3ut6Cg0ZQuNW9XDmTaNRSw4SNxnNckzZtjmKcwT7LQn7lVXxktjtl6jnEx0zdPY4Q18XezxA8x+nGyCAskuDMpw8DQRsYLmTeGDi/LVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776274420; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=sCfqn6p5joilF5p1lFfDVeVHi5ZrSTrqCuLb5IOl7IY=; b=L5l3XX1PCz0HFQ8zq1Mzsgfu3dRrG7a8CCDCmAvleK3UoRzdTXHhqWz+H5/NjXBp5pPcMLlRO0Q1yjOIvxcxRkZ9Ns/m95vWdsZsfWKUbSQOrmXr8ckt9usJn5g4es/n82046wqevGll/Mib3zrG42u/b1HsV6AkZt+jX3lO/t8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1776274420963819.3366604484571; Wed, 15 Apr 2026 10:33:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8FCE63F2FA; Wed, 15 Apr 2026 13:33:39 -0400 (EDT) Received: from [172.19.199.3] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id D01CC418C5; Wed, 15 Apr 2026 13:31:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id CBFD83F2EF; Wed, 15 Apr 2026 13:31:08 -0400 (EDT) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D45D63F2FA for ; Wed, 15 Apr 2026 13:31:06 -0400 (EDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-66bd4e0560fso8983666a12.0 for ; Wed, 15 Apr 2026 10:31:06 -0700 (PDT) Received: from tulp.my.domain (2001-1c02-1a15-3000-ee82-4536-a8f2-9e22.cable.dynamic.v6.ziggo.nl. [2001:1c02:1a15:3000:ee82:4536:a8f2:9e22]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ba17392e952sm79820266b.15.2026.04.15.10.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 10:31:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776274265; x=1776879065; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sCfqn6p5joilF5p1lFfDVeVHi5ZrSTrqCuLb5IOl7IY=; b=dqXFJY4QlKI6/vh71PeXitLF0n4bWYrDQGxeAtKyHThOdyTTyPZRZp0jtN776PO8og yHbCYVaK8DOOE0h3FciCtRYlrjVDL5UN20pYDGx7rXlk3Ox/LFe0xSsX3/1c6Ew01Uis NxX4SzD54Emazf4S61EKaz5jo89Mz73QH5vf4XSy97icR9Ca1+rIGUIH6DpgPAF2GKA5 JrBjXCc+ic28uGQWogB/4uXi4KJBSGNt+TM+jgVcDqjhhoufCvAcPBWE7Ygv9qdJ/eGL MbtUdNpBM76G4DiK5kvtoFU3hLYrGpbFgKakzYNkXxqgWkXTA/XmtMh8+mYbrAHgNptP p2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776274265; x=1776879065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sCfqn6p5joilF5p1lFfDVeVHi5ZrSTrqCuLb5IOl7IY=; b=J9d9G6ZUvT8u5ze2c9Sv5mGE0g18lhXNwnMqDPF7h9fkuxBT9wUYgO1iIfG7H9ubSE wGFRH2LBAHKz8XDg454E2aCVD9ej/abaN2M0wHZF7U9JFGTeFlv0I78ntppmKijUJXpZ OCKp12I9OKH2alIc175Zjbz1DchpRfxHGNdT1r3TdsUQdDun55HvEkzOC8LSOsST+wV2 Jebojfte8uTeBn+3/Ks1hby2UzjVQw7AwufoNOcC9GnqecrPhwp1BjPqS1xq/u0qvNg9 XvsynXXoXlF800Sb2u+U3GhuJT6WL7uFrPWZVbewovuCk54+BNAVcInffCJA9Nt4M3Q8 +pIQ== X-Gm-Message-State: AOJu0Yyoj+STj2BpfdssE4nqbQhCIr4xEJiDEzOVwR3Sqva8d7Pu2chS svNnfxyNXHz63/JxACoIK59WeoXjEGMM2i7uKSKcTAQDUw8UY+wZ5G33OWFOsVo0 X-Gm-Gg: AeBDiev66UKLuHdWz0qk+T00oyDlQXWVxNQgh82pDk4cZ4F8zQg6UWmfFED8fQFJ4up v2ZH98cBf9TNGhQ2p0IkLyxuUWdJDhurPLDVzqpD4J/MvbCXNeqdcp89t+/sRsSnFlS33lqvLu7 aV91pf8drAvlvzCGmdGDPSY7CxbEPd2XBzALfeLblS0xzb99D3iybbyoqJ8hz1ZEAIWqXRUBqso SluX2FlRqEEIOjqzMiakSd6t0O46gnllr8gl9wvROnaJRS/WupckJ3zrP+u+3PPE41f/0ejwNSB mqAPAtbLsaHL6v6dMdah9dghr9UQl9ipJ2uf6EqTsU6iCMNlXtxKIyO7Pfpi0Wui0JhBiECGnea tu6pMYX5U5WX7EBjumS0dDF+x57C5uxD/M7uJQo24IuhqORB8/EJ6NPdACo3qRjwyo6Y1lF03Uz gVfinG3LbkkvsEU9D+Qg8mFmeDHa//yMFoenobP5A34TbV2TLbQm8ouZ/NprREmzaYHq/ELAU/m nsBHL8eP+hhz+xfPNLH/xGOXVIZFBjoewxwnY4BxFUsj2n/ X-Received: by 2002:a17:906:6a25:b0:b9b:6b86:66cb with SMTP id a640c23a62f3a-ba2670fec50mr30911766b.2.1776274264754; Wed, 15 Apr 2026 10:31:04 -0700 (PDT) From: Roman Bogorodskiy To: devel@lists.libvirt.org Subject: [PATCH v2] bhyve: add blkiotune support Date: Wed, 15 Apr 2026 19:28:15 +0200 Message-ID: <20260415172815.93977-1-bogorodskiy@gmail.com> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VHC46ZLKTTRWIKVDYWFQHEZMP7XEHDCS X-Message-ID-Hash: VHC46ZLKTTRWIKVDYWFQHEZMP7XEHDCS X-MailFrom: bogorodskiy@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Roman Bogorodskiy X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1776274421400158501 Content-Type: text/plain; charset="utf-8" FreeBSD supports resource limiting with the rctl(4) framework. It supports various resource types, including I/O resources. It allows to limit resources for users, processes, login classes, and jails. To apply blkiotune limits set limits for the bhyve process. I/O related resources supported by rctl(4) are: readbps filesystem reads, in bytes per second writebps filesystem writes, in bytes per second readiops filesystem reads, in operations per second writeiops filesystem writes, in operations per second Thus, the actual commands look like: rctl -a process:$bhyvepid:writebps:throttle=3D10000000 rctl -a process:$bhyvepid:readbps:throttle=3D10000000 rctl -a process:$bhyvepid:writeiops:throttle=3D20000 rctl -a process:$bhyvepid:readiops:throttle=3D20000 This is different from the current blkiotune modeling in libvirt as it requires specific device to apply limits to. To adapt this model to per-domain I/O limits, update domain schema to specify "*" as a device name. The rctl(8) may be not available or not enabled, so add a capability check for that. Per process rules get removed when the process disappears, so no special clean up is necessary. Signed-off-by: Roman Bogorodskiy Reviewed-by: Peter Krempa --- Changes since v1: - Documented the "*" device name value in formatdomain.rst = = = = =20 - Extended bhyve driver validation to allow only "*" devices = = = = =20 and do no allow specifying device weight, added tests = = = = =20 for these cases = = = = =20 - Updated the RCTL macro to execute the rctl(8) command right = = = = =20 away instead of building an array of rules and looping = = = = =20 through it once again = = = = =20 - Minor formatting fixes docs/formatdomain.rst | 13 ++++-- src/bhyve/bhyve_capabilities.c | 23 ++++++++++ src/bhyve/bhyve_capabilities.h | 1 + src/bhyve/bhyve_domain.c | 20 +++++++++ src/bhyve/bhyve_process.c | 45 +++++++++++++++++++ src/conf/schemas/domaincommon.rng | 5 ++- ...bhyvexml2argv-blkiotune-invalid-device.xml | 32 +++++++++++++ ...yvexml2argv-blkiotune-multiple-devices.xml | 39 ++++++++++++++++ .../x86_64/bhyvexml2argv-blkiotune-weight.xml | 33 ++++++++++++++ .../x86_64/bhyvexml2argv-blkiotune.args | 10 +++++ .../x86_64/bhyvexml2argv-blkiotune.ldargs | 4 ++ .../x86_64/bhyvexml2argv-blkiotune.xml | 32 +++++++++++++ tests/bhyvexml2argvtest.c | 4 ++ .../x86_64/bhyvexml2xmlout-blkiotune.xml | 42 +++++++++++++++++ tests/bhyvexml2xmltest.c | 4 ++ 15 files changed, 302 insertions(+), 5 deletions(-) create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-= invalid-device.xml create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-= multiple-devices.xml create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-= weight.xml create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.= args create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.= ldargs create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.= xml create mode 100644 tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-blkiot= une.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1a4bd4c6e9..6c4e067072 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1367,10 +1367,15 @@ Block I/O Tuning associated with each guest disk device (contrast this to the element of a disk definition (See `Hard drives, floppy disks, CDROMs`_) which can applies to an individual disk). Each ``device`` element has - two mandatory sub-elements, ``path`` describing the absolute path of the - device, and ``weight`` giving the relative weight of that device, in the - range [100, 1000]. After kernel 2.6.39, the value could be in the range= [10, - 1000]. :since:`Since 0.9.8` + a mandatory ``path`` sub-element describing the absolute path of the + device. + + A special value ``*`` can be used to throttle all domain + devices. :since:`Since 12.3.0, bhyve` + + An optional ``weight`` sub-element specifies the relative + weight of the device, in the range [100, 1000]. After kernel 2.6.39, + the value could be in the range [10, 1000]. :since:`Since 0.9.8` Additionally, the following optional sub-elements can be used: =20 ``read_bytes_sec`` diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c3fb88fe9f..1fe0a3ad77 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -24,6 +24,7 @@ #include #include #include +#include #include =20 #include "viralloc.h" @@ -334,6 +335,27 @@ bhyveProbeCapsVNCPassword(unsigned int *caps, char *bi= nary) } =20 =20 +static void +bhyveProbeCapsRctl(unsigned int *caps) +{ + bool racct_enable; + size_t racct_enable_len; + g_autofree char *rctl =3D NULL; + + if (!(rctl =3D virFindFileInPath("rctl"))) + return; + + racct_enable_len =3D sizeof(racct_enable); + if (sysctlbyname("kern.racct.enable", &racct_enable, + &racct_enable_len, NULL, 0) < 0) + return; + + if (racct_enable) + *caps |=3D BHYVE_CAP_RCTL; + + return; +} + int virBhyveProbeCaps(unsigned int *caps) { @@ -356,6 +378,7 @@ virBhyveProbeCaps(unsigned int *caps) if ((ret =3D bhyveProbeCapsVNCPassword(caps, binary))) goto out; =20 + bhyveProbeCapsRctl(caps); =20 out: VIR_FREE(binary); diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h index 31fd9ab86a..0302b68e22 100644 --- a/src/bhyve/bhyve_capabilities.h +++ b/src/bhyve/bhyve_capabilities.h @@ -57,6 +57,7 @@ typedef enum { BHYVE_CAP_NVME =3D 1 << 11, BHYVE_CAP_ACPI =3D 1 << 12, BHYVE_CAP_NUMA =3D 1 << 13, + BHYVE_CAP_RCTL =3D 1 << 14, } virBhyveCapsFlags; =20 int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps); diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 4594d7673f..7bce6a4bc0 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -464,6 +464,26 @@ bhyveDomainDefValidate(const virDomainDef *def, } } =20 + if (def->blkio.ndevices > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Per device I/O tuning is not supported")); + return -1; + } else if (def->blkio.ndevices =3D=3D 1) { + virBlkioDevice *device =3D &def->blkio.devices[0]; + + if (STRNEQ(device->path, "*")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Per device I/O tuning is not supported")); + return -1; + } + + if (device->weight !=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only \"*\" is supported as a device path for= I/O tuning")); + return -1; + } + } + if (!def->os.loader) return 0; =20 diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 1d436da609..3eb807b9fe 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -34,6 +34,7 @@ =20 #include "bhyve_device.h" #include "bhyve_driver.h" +#include "bhyve_capabilities.h" #include "bhyve_command.h" #include "bhyve_firmware.h" #include "bhyve_monitor.h" @@ -132,6 +133,47 @@ bhyveProcessStopHook(struct _bhyveConn *driver, VIR_HOOK_SUBOP_END, NULL, xml, NULL); } =20 +static int +bhyveSetResourceLimits(struct _bhyveConn *driver, virDomainObj *vm) +{ + virBlkioDevice *device; + + if (vm->def->blkio.ndevices !=3D 1) + return 0; + + if ((bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_RCTL) =3D=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Cannot set resource limits: RACCT/RCTL is either= not supported or not enabled")); + return -1; + } + + device =3D &vm->def->blkio.devices[0]; + +#define BHYVE_APPLY_RCTL_RULE(field, type, format) \ + do { \ + if ((field)) { \ + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; \ + g_autofree char *rule =3D NULL; \ + g_autoptr(virCommand) cmd =3D virCommandNew("rctl"); \ + virBufferAsprintf(&buf, "process:%d:" type ":throttle=3D" form= at, \ + vm->pid, (field)); \ + rule =3D virBufferContentAndReset(&buf); \ + virCommandAddArgList(cmd, "-a", rule, NULL); \ + if (virCommandRun(cmd, NULL) < 0) \ + return -1; \ + } \ + } while (0) + + BHYVE_APPLY_RCTL_RULE(device->riops, "readiops", "%u"); + BHYVE_APPLY_RCTL_RULE(device->wiops, "writeiops", "%u"); + BHYVE_APPLY_RCTL_RULE(device->rbps, "readbps", "%llu"); + BHYVE_APPLY_RCTL_RULE(device->wbps, "writebps", "%llu"); + +#undef BHYVE_APPLY_RCTL_RULE + + return 0; +} + static int virBhyveProcessStartImpl(struct _bhyveConn *driver, virDomainObj *vm, @@ -258,6 +300,9 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver, BHYVE_STATE_DIR) < 0) goto cleanup; =20 + if (bhyveSetResourceLimits(driver, vm) < 0) + goto cleanup; + if (bhyveProcessStartHook(driver, vm, VIR_HOOK_BHYVE_OP_STARTED) < 0) goto cleanup; =20 diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index db1dcd3bb7..c7f442a4c1 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -1049,7 +1049,10 @@ - + + + * + diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-invalid= -device.xml b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-invali= d-device.xml new file mode 100644 index 0000000000..68d6871e0c --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-invalid-device= .xml @@ -0,0 +1,32 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + /dev/sda + 10000 + 10000 + 20000 + 20000 + + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-multipl= e-devices.xml b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-mult= iple-devices.xml new file mode 100644 index 0000000000..a6b689ad9a --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-multiple-devic= es.xml @@ -0,0 +1,39 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + * + 10000 + 10000 + 20000 + 20000 + + + /dev/hda + 10000 + 10000 + 20000 + 20000 + + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-weight.= xml b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-weight.xml new file mode 100644 index 0000000000..f7603828e0 --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune-weight.xml @@ -0,0 +1,33 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + * + 100 + 10000 + 10000 + 20000 + 20000 + + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.args b/= tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.args new file mode 100644 index 0000000000..507e0be668 --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.args @@ -0,0 +1,10 @@ +bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=3D52:54:00:b9:94:02 \ +bhyve diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.ldargs = b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.ldargs new file mode 100644 index 0000000000..5905f4b3e6 --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.ldargs @@ -0,0 +1,4 @@ +bhyveload \ +-m 214 \ +-d /tmp/freebsd.img \ +bhyve diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.xml b/t= ests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.xml new file mode 100644 index 0000000000..956d96cf18 --- /dev/null +++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-blkiotune.xml @@ -0,0 +1,32 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + * + 10000 + 10000 + 20000 + 20000 + + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index b7749fec6f..71c67ba2a2 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -289,6 +289,10 @@ mymain(void) DO_TEST_FAILURE("slirp-ip"); DO_TEST("virtio-scsi"); DO_TEST("vcpupin"); + DO_TEST("blkiotune"); + DO_TEST_FAILURE("blkiotune-invalid-device"); + DO_TEST_FAILURE("blkiotune-multiple-devices"); + DO_TEST_FAILURE("blkiotune-weight"); =20 /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); diff --git a/tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-blkiotune.xml= b/tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-blkiotune.xml new file mode 100644 index 0000000000..4170303a6e --- /dev/null +++ b/tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-blkiotune.xml @@ -0,0 +1,42 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 219136 + + + * + 20000 + 20000 + 10000 + 10000 + + + 1 + + hvm + + + + destroy + restart + destroy + + + + + +
+ + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index 950aaea672..9fa8a9765d 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -133,6 +133,10 @@ mymain(void) DO_TEST_DIFFERENT("slirp"); DO_TEST_DIFFERENT("virtio-scsi"); DO_TEST_DIFFERENT("numa"); + DO_TEST_DIFFERENT("blkiotune"); + DO_TEST_FAILURE("blkiotune-invalid-device"); + DO_TEST_FAILURE("blkiotune-weight"); + DO_TEST_FAILURE("blkiotune-multiple-devices"); =20 /* Address allocation tests */ DO_TEST_DIFFERENT("addr-single-sata-disk"); --=20 2.52.0