qemu: Improve errors in qemuDomainBlockResize

Remove the pointless "empty path" check and use a better error message
if the disk was not found.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-08-07 09:47:53 +02:00
parent 8f15f19596
commit 62b4afb27a

View File

@ -10963,12 +10963,6 @@ qemuDomainBlockResize(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1);
if (path[0] == '\0') {
virReportError(VIR_ERR_INVALID_ARG,
"%s", _("empty path"));
return -1;
}
/* We prefer operating on bytes. */
if ((flags & VIR_DOMAIN_BLOCK_RESIZE_BYTES) == 0) {
if (size > ULLONG_MAX / 1024) {
@ -10996,7 +10990,7 @@ qemuDomainBlockResize(virDomainPtr dom,
if (!(disk = virDomainDiskByName(vm->def, path, false))) {
virReportError(VIR_ERR_INVALID_ARG,
_("invalid path: %s"), path);
_("disk '%s' was not found in the domain config"), path);
goto endjob;
}