[libvirt] [PATCH v2 07/10] qemu: Refactor qemuSetUnprivSGIO return values
Peter Krempa
pkrempa at redhat.com
Tue Jul 7 13:11:24 UTC 2015
On Mon, Jul 06, 2015 at 13:08:35 -0400, John Ferlan wrote:
> Set to ret = -1 and prove otherwise, like usual
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
> src/qemu/qemu_conf.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> index 80b8926..5ebf2cc 100644
> --- a/src/qemu/qemu_conf.c
> +++ b/src/qemu/qemu_conf.c
> @@ -1448,7 +1448,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
> char *sysfs_path = NULL;
> const char *path = NULL;
> int val = -1;
> - int ret = 0;
> + int ret = -1;
>
> /* "sgio" is only valid for block disk; cdrom
> * and floopy disk can have empty source.
> @@ -1467,24 +1467,19 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
> if (!qemuIsSharedHostdev(hostdev))
> return 0;
>
> - if (hostdev->source.subsys.u.scsi.sgio) {
> + if (hostdev->source.subsys.u.scsi.sgio)
> virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> _("'sgio' is not supported for SCSI "
> "generic device yet "));
> - ret = -1;
> goto cleanup;
> - }
Wrong removal of the braces.
>
> return 0;
> } else {
> return 0;
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150707/2743ff5b/attachment-0001.sig>
More information about the libvir-list
mailing list