mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
8f15f19596
commit
62b4afb27a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user