if (!tioc) {
return -EIO;
}
+ ret = 0;
object_unref(OBJECT(client->ioc));
client->ioc = QIO_CHANNEL(tioc);
break;
"Option 0x%" PRIx32
"not permitted before TLS",
option);
- if (ret < 0) {
- return ret;
- }
/* Let the client keep trying, unless they asked to
* quit. In this mode, we've already sent an error, so
* we can't ack the abort. */
switch (option) {
case NBD_OPT_LIST:
ret = nbd_negotiate_handle_list(client, length, errp);
- if (ret < 0) {
- return ret;
- }
break;
case NBD_OPT_ABORT:
assert(option == NBD_OPT_GO);
return 0;
}
- if (ret) {
- return ret;
- }
break;
case NBD_OPT_STARTTLS:
option, errp,
"TLS not configured");
}
- if (ret < 0) {
- return ret;
- }
break;
default:
if (nbd_drop(client->ioc, length, errp) < 0) {
"Unsupported option 0x%"
PRIx32 " (%s)", option,
nbd_opt_lookup(option));
- if (ret < 0) {
- return ret;
- }
break;
}
} else {
return -EINVAL;
}
}
+ if (ret < 0) {
+ return ret;
+ }
}
}