Compare commits

..

2 Commits

Author SHA1 Message Date
3f9cd01867 exit() on fatal errors after initialization in qemu_driver again to not leave hung VMs
All checks were successful
Test / test_add_osd (push) Has been skipped
Test / test_cas (push) Has been skipped
Test / test_change_pg_count (push) Has been skipped
Test / test_change_pg_count_ec (push) Has been skipped
Test / test_change_pg_count_online (push) Has been skipped
Test / test_change_pg_minsize (push) Has been skipped
Test / test_change_pg_size (push) Has been skipped
Test / test_create_nomaxid (push) Has been skipped
Test / test_modify_pool (push) Has been skipped
Test / test_etcd_fail (push) Has been skipped
Test / test_etcd_fail_antietcd (push) Has been skipped
Test / test_etcd_fail_https (push) Has been skipped
Test / test_etcd_fail_https_antietcd (push) Has been skipped
Test / test_snapshot_https (push) Has been skipped
Test / test_img_online_resize (push) Has been skipped
Test / test_no_uring (push) Has been skipped
Test / test_interrupted_rebalance (push) Has been skipped
Test / test_interrupted_rebalance_imm (push) Has been skipped
Test / test_interrupted_rebalance_ec (push) Has been skipped
Test / test_interrupted_rebalance_ec_imm (push) Has been skipped
Test / test_dump_load (push) Has been skipped
Test / test_dump_load_32k (push) Has been skipped
Test / test_old_dump_load (push) Has been skipped
Test / test_dump_load_old_32k (push) Has been skipped
Test / test_old_interrupted_rebalance (push) Has been skipped
Test / test_old_interrupted_rebalance_imm (push) Has been skipped
Test / test_old_interrupted_rebalance_ec (push) Has been skipped
Test / test_old_interrupted_rebalance_ec_imm (push) Has been skipped
Test / test_create_halfhost (push) Has been skipped
Test / test_failure_domain (push) Has been skipped
2026-11-04 01:13:50 +03:00
a7a6d5f38e Add tests to readme-ru 2026-11-01 22:03:16 +03:00
4 changed files with 24 additions and 1 deletions

View File

@@ -75,6 +75,9 @@ Vitastor поддерживает QEMU-драйвер, протоколы UBLK,
- [NFS](docs/usage/nfs.ru.md) кластерная файловая система и псевдо-ФС прокси
- [Безопасность](docs/usage/security.ru.md)
- [Администрирование](docs/usage/admin.ru.md)
- Тесты
- [Хаос тест хранилища](docs/tests/blockstore-chaos.ru.md)
- [Хаос тест PG](docs/tests/pg-chaos.ru.md)
- Производительность
- [Понимание сути производительности](docs/performance/understanding.ru.md)
- [Теоретический максимум](docs/performance/theoretical.ru.md)

View File

@@ -622,6 +622,11 @@ end_free:
close(fd);
}
static void vitastor_err_exit(void *opaque, int retval, const char *errstr)
{
exit(1);
}
static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, Error **errp)
{
VitastorRPC task;
@@ -659,7 +664,9 @@ static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, E
strarray_push_kv(&opt, "rdma_gid_index", qdict_get_try_str(options, "rdma-gid-index"));
strarray_push_kv(&opt, "rdma_mtu", qdict_get_try_str(options, "rdma-mtu"));
strarray_push_kv(&opt, "client_writeback_allowed", (flags & BDRV_O_NOCACHE) ? "0" : "1");
#if defined VITASTOR_C_API_VERSION && VITASTOR_C_API_VERSION >= 6
strarray_push_kv(&opt, "client_exit_on_error", "0");
#endif
strarray_push_kv(&opt, "__version_check_buffer", version_buffer);
client->proxy = vitastor_c_create_uring_json(opt.items, opt.len);
client->auto_loop = 0;
@@ -716,6 +723,7 @@ static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, E
#endif
BDRV_POLL_WHILE(bs, !task.complete);
}
#if defined VITASTOR_C_API_VERSION && VITASTOR_C_API_VERSION >= 6
if ((ret = vitastor_c_is_failed(client->proxy, &errstr)))
{
error_setg(errp, errstr);
@@ -723,6 +731,8 @@ static int vitastor_file_open(BlockDriverState *bs, QDict *options, int flags, E
vitastor_close(bs);
return -ret;
}
vitastor_c_on_fatal_error(client->proxy, vitastor_err_exit, NULL);
#endif
client->image = image;
if (client->image)
{

View File

@@ -251,6 +251,14 @@ int vitastor_c_is_failed(vitastor_c *client, char **errstr)
return 0;
}
void vitastor_c_on_fatal_error(vitastor_c *client, VitastorErrorHandler cb, void *opaque)
{
client->cli->set_on_fatal_error_hook([=](int retval, const std::string & error)
{
cb(opaque, retval, error.c_str());
});
}
void vitastor_c_on_ready(vitastor_c *client, VitastorIOHandler cb, void *opaque)
{
client->cli->on_ready([=]()

View File

@@ -7,7 +7,7 @@
#define VITASTOR_QEMU_PROXY_H
// C API wrapper version
#define VITASTOR_C_API_VERSION 5
#define VITASTOR_C_API_VERSION 6
#ifndef POOL_ID_BITS
#define POOL_ID_BITS 16
@@ -33,6 +33,7 @@ typedef struct vitastor_c vitastor_c;
typedef void VitastorReadHandler(void *opaque, long retval, uint64_t version);
typedef void VitastorIOHandler(void *opaque, long retval);
typedef void VitastorErrorHandler(void *opaque, int retval, const char *errstr);
typedef void VitastorReadBitmapHandler(void *opaque, long retval, uint8_t *bitmap);
// QEMU
@@ -54,6 +55,7 @@ void* vitastor_c_get_internal_client(vitastor_c *client);
void vitastor_c_destroy(vitastor_c *client);
int vitastor_c_is_ready(vitastor_c *client);
int vitastor_c_is_failed(vitastor_c *client, char **errstr);
void vitastor_c_on_fatal_error(vitastor_c *client, VitastorErrorHandler cb, void *opaque);
void vitastor_c_on_ready(vitastor_c *client, VitastorIOHandler cb, void *opaque);
int vitastor_c_uring_register_eventfd(vitastor_c *client);
void vitastor_c_uring_wait_ready(vitastor_c *client);