Help - Troubleshoot libvirt
by Eduardo Kiassucumuca
Good morning I'm Eduardo, a computer science student and I'm doing a final course work focused on virtualization. The work consists of creating virtual machines on a server and allowing ssh access to the virtual machines that are on the server containing qemu/kvm/libvirt. The problem is that I can't access the virtual machines from an external network but I can access them inside the server. I would like to know what would be the best way since we want to have a single public ip and be able to have a reverse proxy to access the virtual machines, I would like to know from your experience what you recommend?
2 years, 7 months
[PATCH 0/2] docs: Adapt XSL/CSS to docutils-0.17 and later
by Peter Krempa
The breakage will be visible only when you build with newer docutils
such as is in fedora rawhide.
Alternatively you can install one locally for your user via 'pip install
docutils --force' and then build the tree via:
export PYTHONPATH=~/.local/lib/python3.10/site-packages/
ninja
Peter Krempa (2):
docs/css: Simplify selector for heading of 'knowledge-base' and
'documentation' pages
docs: Adapt to semantic tag usage of docutils-0.17 and later
docs/css/libvirt.css | 13 +++++++++++--
docs/page.xsl | 6 ++++++
2 files changed, 17 insertions(+), 2 deletions(-)
--
2.35.1
2 years, 7 months
[PATCH] docs: man: Add description of 'calc_mode' and 'vcpu.<num>.megabytes_per_second' dirtyrate mode
by Peter Krempa
Commit 42d36b65a31 added new fields to the API docs but didn't add the
virsh man page equivalent.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2073867
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/manpages/virsh.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 588445028b..d7753c4970 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2505,6 +2505,10 @@ not available for statistical purposes.
calculation.
* ``dirtyrate.megabytes_per_second`` - the calculated memory dirty
rate in MiB/s.
+* ``dirtyrate.calc_mode`` - the calculation mode used last measurement
+ (``page-sampling``/``dirty-bitmap``/``dirty-ring``)
+* ``dirtyrate.vcpu.<num>.megabytes_per_second`` - the calculated memory dirty
+ rate for a virtual cpu in MiB/s
Selecting a specific statistics groups doesn't guarantee that the
--
2.35.1
2 years, 7 months
[PATCH v3] conf: Move validation checks from virDomainDiskDefIotuneParse into domain_validate.c
by Moteen Shah
Move validation from virDomainDiskDefIotuneParse into the validation callback
Signed-off-by: Moteen Shah <codeguy.moteen(a)gmail.com>
---
src/conf/domain_conf.c | 40 --------------------------------------
src/conf/domain_validate.c | 37 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 40 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5dd269b283..bd2884088c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8790,46 +8790,6 @@ virDomainDiskDefIotuneParse(virDomainDiskDef *def,
def->blkdeviotune.group_name =
virXPathString("string(./iotune/group_name)", ctxt);
- if ((def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.read_bytes_sec) ||
- (def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.write_bytes_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.read_iops_sec) ||
- (def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.write_iops_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.read_bytes_sec_max) ||
- (def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.write_bytes_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.read_iops_sec_max) ||
- (def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.write_iops_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
return 0;
}
#undef PARSE_IOTUNE
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index d6869e8fd8..68190fc3e2 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -651,6 +651,43 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
}
+ /* Validate IotuneParse */
+ if ((disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.read_bytes_sec) ||
+ (disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.write_bytes_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.read_iops_sec) ||
+ (disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.write_iops_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.read_bytes_sec_max) ||
+ (disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.write_bytes_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec_max cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.read_iops_sec_max) ||
+ (disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.write_iops_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec_max cannot be set at the same time"));
+ return -1;
+ }
+
/* Reject disks with a bus type that is not compatible with the
* given address type. The function considers only buses that are
* handled in common code. For other bus types it's not possible
--
2.35.1
2 years, 7 months
[libvirt RFC] virFile: new VIR_FILE_WRAPPER_BIG_PIPE to improve performance
by Claudio Fontana
the first user is the qemu driver,
virsh save/resume would slow to a crawl with a default pipe size (64k).
This improves the situation by 400%.
Going through io_helper still seems to incur in some penalty (~15%-ish)
compared with direct qemu migration to a nc socket to a file.
Signed-off-by: Claudio Fontana <cfontana(a)suse.de>
---
src/qemu/qemu_driver.c | 6 +++---
src/qemu/qemu_saveimage.c | 11 ++++++-----
src/util/virfile.c | 12 ++++++++++++
src/util/virfile.h | 1 +
4 files changed, 22 insertions(+), 8 deletions(-)
Hello, I initially thought this to be a qemu performance issue,
so you can find the discussion about this in qemu-devel:
"Re: bad virsh save /dev/null performance (600 MiB/s max)"
https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg03142.html
RFC since need to validate idea, and it is only lightly tested:
save - about 400% benefit in throughput, getting around 20 Gbps to /dev/null,
and around 13 Gbps to a ramdisk.
By comparison, direct qemu migration to a nc socket is around 24Gbps.
restore - not tested, _should_ also benefit in the "bypass_cache" case
coredump - not tested, _should_ also benefit like for save
Thanks for your comments and review,
Claudio
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c1b3bd8536..be248c1e92 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3044,7 +3044,7 @@ doCoreDump(virQEMUDriver *driver,
virFileWrapperFd *wrapperFd = NULL;
int directFlag = 0;
bool needUnlink = false;
- unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING;
+ unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING | VIR_FILE_WRAPPER_BIG_PIPE;
const char *memory_dump_format = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(virCommand) compressor = NULL;
@@ -3059,7 +3059,7 @@ doCoreDump(virQEMUDriver *driver,
/* Create an empty file with appropriate ownership. */
if (dump_flags & VIR_DUMP_BYPASS_CACHE) {
- flags |= VIR_FILE_WRAPPER_BYPASS_CACHE;
+ wrapperFlags |= VIR_FILE_WRAPPER_BYPASS_CACHE;
directFlag = virFileDirectFdFlag();
if (directFlag < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
@@ -3072,7 +3072,7 @@ doCoreDump(virQEMUDriver *driver,
&needUnlink)) < 0)
goto cleanup;
- if (!(wrapperFd = virFileWrapperFdNew(&fd, path, flags)))
+ if (!(wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags)))
goto cleanup;
if (dump_flags & VIR_DUMP_MEMORY_ONLY) {
diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c
index c0139041eb..1b522a1542 100644
--- a/src/qemu/qemu_saveimage.c
+++ b/src/qemu/qemu_saveimage.c
@@ -267,7 +267,7 @@ qemuSaveImageCreate(virQEMUDriver *driver,
int fd = -1;
int directFlag = 0;
virFileWrapperFd *wrapperFd = NULL;
- unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING;
+ unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING | VIR_FILE_WRAPPER_BIG_PIPE;
/* Obtain the file handle. */
if ((flags & VIR_DOMAIN_SAVE_BYPASS_CACHE)) {
@@ -463,10 +463,11 @@ qemuSaveImageOpen(virQEMUDriver *driver,
if ((fd = qemuDomainOpenFile(cfg, NULL, path, oflags, NULL)) < 0)
return -1;
- if (bypass_cache &&
- !(*wrapperFd = virFileWrapperFdNew(&fd, path,
- VIR_FILE_WRAPPER_BYPASS_CACHE)))
- return -1;
+ if (bypass_cache) {
+ unsigned int wrapperFlags = VIR_FILE_WRAPPER_BYPASS_CACHE | VIR_FILE_WRAPPER_BIG_PIPE;
+ if (!(*wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags)))
+ return -1;
+ }
data = g_new0(virQEMUSaveData, 1);
diff --git a/src/util/virfile.c b/src/util/virfile.c
index a04f888e06..fdacd17890 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -282,6 +282,18 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags)
ret->cmd = virCommandNewArgList(iohelper_path, name, NULL);
+ if (flags & VIR_FILE_WRAPPER_BIG_PIPE) {
+ /*
+ * virsh save/resume would slow to a crawl with a default pipe size (usually 64k).
+ * This improves the situation by 400%, although going through io_helper still incurs
+ * in a performance penalty compared with a direct qemu migration to a socket.
+ */
+ int pipe_sz, rv = virFileReadValueInt(&pipe_sz, "/proc/sys/fs/pipe-max-size");
+ if (rv != 0) {
+ pipe_sz = 1024 * 1024; /* common default for pipe-max-size */
+ }
+ fcntl(pipefd[output ? 0 : 1], F_SETPIPE_SZ, pipe_sz);
+ }
if (output) {
virCommandSetInputFD(ret->cmd, pipefd[0]);
virCommandSetOutputFD(ret->cmd, fd);
diff --git a/src/util/virfile.h b/src/util/virfile.h
index b04386f6e6..8383c4b069 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -107,6 +107,7 @@ int virFileDirectFdFlag(void);
typedef enum {
VIR_FILE_WRAPPER_BYPASS_CACHE = (1 << 0),
VIR_FILE_WRAPPER_NON_BLOCKING = (1 << 1),
+ VIR_FILE_WRAPPER_BIG_PIPE = (1 << 2),
} virFileWrapperFdFlags;
virFileWrapperFd *virFileWrapperFdNew(int *fd,
--
2.26.2
2 years, 7 months
[PATCH] processMonitorEOFEvent:fix delet Domain object about the new VM in processMonitorEOFEvent()
by Yi Wang
From: 王鹏钧10288409 <10288409@zte.intra(a)LIN-184C297BAE7.zte.com.cn>
Virsh shutdown is executed firstly, virsh destroy is executed later,
and VM is recreated again. In this process, due to will delet Domain
object about the new VM in processMonitorEOFEvent(), which
virDomainObjListRemove is called to remove objlist, the new VM
cannot be found through virsh list command and qemu process is still
running. Therefore, add virDomainObjListFindByName function checks
to avoid delet Domain object about the new VM in objlist.
This process chart of problem is as follows
shutdown | destroy | create
============================+==================+===================
qemuMonitorIO | |
qemuProcessHandleMonitorEOF | |
| virDomainDestroy |
| qemuProcessStop |
| | qemuDomainCreateXML
| | qemuProcessInit
processMonitorEOFEvent | |
qemuDomainRemoveInactive | |
| | qemuProcessLaunch
Signed-off-by: Wang PengJun <wang.pengjun1(a)zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
src/qemu/qemu_driver.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8c0e36e9b2..c16e9a9795 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4024,6 +4024,7 @@ processMonitorEOFEvent(virQEMUDriver *driver,
const char *auditReason = "shutdown";
unsigned int stopFlags = 0;
virObjectEvent *event = NULL;
+ virDomainObj *obj;
if (qemuProcessBeginStopJob(driver, vm, VIR_JOB_DESTROY, true) < 0)
return;
@@ -4055,8 +4056,17 @@ processMonitorEOFEvent(virQEMUDriver *driver,
virObjectEventStateQueue(driver->domainEventState, event);
endjob:
- qemuDomainRemoveInactive(driver, vm);
- qemuDomainObjEndJob(vm);
+ virObjectUnlock(vm);
+ obj = virDomainObjListFindByName(driver->domains, vm->def->name);
+ if (vm == obj) {
+ qemuDomainRemoveInactive(driver, vm);
+ qemuDomainObjEndJob(vm);
+ }
+ virDomainObjEndAPI(&obj);
+ if (vm != NULL) {
+ virObjectLock(vm);
+ qemuDomainObjEndJob(vm);
+ }
}
--
2.27.0
2 years, 7 months
Issue in WinRM on Linux
by Nishit Sharma
Hi All,
I am trying to create and launch a *windows10 guest VM* using
libvirt-vagrant over Linux/KVM.
The Windows box I am using is "*peru/windows-10-enterprise-x64-eval*". The
Windows guest is created and allocated IP in 192.168.xxx.xxx range. Did
WinRM configurations on Windows Guest OS. On Linux messages "*DEBUG
winrmshell: [WinRM] opening remote shell on http://IP:5985/wsman
<http://IP:5985/wsman>*" were seen around 20 times ( default winrm tries
20) and after that VM was disconnected with message
Error: An error of type WinRM::WinRMHTTPTransportError happened, message is
Unable to parse authorization header. Headers: {"Mime-Version"=>"1.0",
"Date"=>"Wed, 06 Apr 2022 13:40:44 GMT",
"Content-Type"=>"text/html;charset=utf-8", "Content-Length"=>"277",
"X-iboss-Error"=>"ERR_CONNECT_FAIL 110", "X-Cache"=>"MISS from
bgproxy06-int.prxy.ice.xxx.com", "Connection"=>"keep-alive"}
Body: <!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0;url=
http://7rx80271.ibosscloud.com/ibreports/ibp/bp.html?bu=http://10.xxx.xxx...
"/>
</head>
<body>
</body>
</html>
(503).
Error: Exiting with code 1
I tried accessing WinRM service on Windows guest using
http://localhost:5985/wsman but got an error *HTTP 405 page is not working
currently* but when I tried http://localhost:5985/WS-Man result was *HTTP
Error 404. The requested resource is not found.*
*Question is:*
*1. Do libvirt support winrm to connect with Windows guest?*
*2. The request to open a remote shell should be http://IP:5985/WS-Man
<http://IP:5985/WS-Man> rather than http://IP:5985/wsman
<http://IP:5985/wsman>?*
*Waiting for a swift reply.*
*Regards*
*Nishit*
2 years, 7 months
[PATCH v3] conf: Move validation checks from virDomainDiskDefIotuneParse into domain_validate.c
by Moteen Shah
Move validation from virDomainDiskDefIotuneParse into the validation callback
Signed-off-by: Moteen Shah <codeguy.moteen(a)gmail.com>
---
src/conf/domain_conf.c | 40 --------------------------------------
src/conf/domain_validate.c | 37 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 40 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5dd269b283..bd2884088c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8790,46 +8790,6 @@ virDomainDiskDefIotuneParse(virDomainDiskDef *def,
def->blkdeviotune.group_name =
virXPathString("string(./iotune/group_name)", ctxt);
- if ((def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.read_bytes_sec) ||
- (def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.write_bytes_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.read_iops_sec) ||
- (def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.write_iops_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.read_bytes_sec_max) ||
- (def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.write_bytes_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.read_iops_sec_max) ||
- (def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.write_iops_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
return 0;
}
#undef PARSE_IOTUNE
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index d6869e8fd8..68190fc3e2 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -651,6 +651,43 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
}
+ /* Validate IotuneParse */
+ if ((disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.read_bytes_sec) ||
+ (disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.write_bytes_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.read_iops_sec) ||
+ (disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.write_iops_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.read_bytes_sec_max) ||
+ (disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.write_bytes_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec_max cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.read_iops_sec_max) ||
+ (disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.write_iops_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec_max cannot be set at the same time"));
+ return -1;
+ }
+
/* Reject disks with a bus type that is not compatible with the
* given address type. The function considers only buses that are
* handled in common code. For other bus types it's not possible
--
2.35.1
2 years, 7 months
[CI] libvirt-gitlab-executor project is now part of the libvirt namespace
by Erik Skultety
This is just a small announcement that the $subj project which was created in
order to provision customized VMs as throwaway worker nodes for our functional
test suite utilizing GitLab's custom executor feature was transferred to the
libvirt's GitLab namespace.
Anything that relates to both infrastructure and executing the functional test
suite in a customized environment should go to this project.
Regards,
Erik
2 years, 7 months
[PATCH v2] conf: Move validation checks from virDomainDiskDefIotuneParse into domain_validate.c
by Moteen Shah
From: Moteen Shah <moteenshah.02(a)gmail.com>
Move validation from virDomainDiskDefIotuneParse into the validation callback
Signed-off-by: Moteen Shah <moteenshah.02(a)gmail.com>
---
src/conf/domain_conf.c | 40 -------------------------------------
src/conf/domain_validate.c | 41 ++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 40 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5dd269b283..bd2884088c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8790,46 +8790,6 @@ virDomainDiskDefIotuneParse(virDomainDiskDef *def,
def->blkdeviotune.group_name =
virXPathString("string(./iotune/group_name)", ctxt);
- if ((def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.read_bytes_sec) ||
- (def->blkdeviotune.total_bytes_sec &&
- def->blkdeviotune.write_bytes_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.read_iops_sec) ||
- (def->blkdeviotune.total_iops_sec &&
- def->blkdeviotune.write_iops_sec)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.read_bytes_sec_max) ||
- (def->blkdeviotune.total_bytes_sec_max &&
- def->blkdeviotune.write_bytes_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write bytes_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
- if ((def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.read_iops_sec_max) ||
- (def->blkdeviotune.total_iops_sec_max &&
- def->blkdeviotune.write_iops_sec_max)) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("total and read/write iops_sec_max "
- "cannot be set at the same time"));
- return -1;
- }
-
return 0;
}
#undef PARSE_IOTUNE
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index d6869e8fd8..71dc74abc8 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -651,6 +651,47 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
}
+ /* Validate IotuneParse */
+ if ((disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.read_bytes_sec) ||
+ (disk->blkdeviotune.total_bytes_sec &&
+ disk->blkdeviotune.write_bytes_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec "
+ "cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.read_iops_sec) ||
+ (disk->blkdeviotune.total_iops_sec &&
+ disk->blkdeviotune.write_iops_sec)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec "
+ "cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.read_bytes_sec_max) ||
+ (disk->blkdeviotune.total_bytes_sec_max &&
+ disk->blkdeviotune.write_bytes_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write bytes_sec_max "
+ "cannot be set at the same time"));
+ return -1;
+ }
+
+ if ((disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.read_iops_sec_max) ||
+ (disk->blkdeviotune.total_iops_sec_max &&
+ disk->blkdeviotune.write_iops_sec_max)) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("total and read/write iops_sec_max "
+ "cannot be set at the same time"));
+ return -1;
+ }
+
/* Reject disks with a bus type that is not compatible with the
* given address type. The function considers only buses that are
* handled in common code. For other bus types it's not possible
--
2.35.1
2 years, 7 months