ssh.c (fcb7e040f5c69ca1f0678f991ab5354488a9e192) ssh.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1)
1/*
2 * Secure Shell (ssh) backend for QEMU.
3 *
4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1239 unchanged lines hidden (view full) ---

1248
1249 qemu_co_mutex_lock(&s->lock);
1250 ret = ssh_flush(s, bs);
1251 qemu_co_mutex_unlock(&s->lock);
1252
1253 return ret;
1254}
1255
1/*
2 * Secure Shell (ssh) backend for QEMU.
3 *
4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1239 unchanged lines hidden (view full) ---

1248
1249 qemu_co_mutex_lock(&s->lock);
1250 ret = ssh_flush(s, bs);
1251 qemu_co_mutex_unlock(&s->lock);
1252
1253 return ret;
1254}
1255
1256static int64_t ssh_getlength(BlockDriverState *bs)
1256static int64_t coroutine_fn ssh_co_getlength(BlockDriverState *bs)
1257{
1258 BDRVSSHState *s = bs->opaque;
1259 int64_t length;
1260
1261 /* Note we cannot make a libssh call here. */
1262 length = (int64_t) s->attrs->size;
1263 trace_ssh_getlength(length);
1264

--- 94 unchanged lines hidden (view full) ---

1359 .bdrv_parse_filename = ssh_parse_filename,
1360 .bdrv_file_open = ssh_file_open,
1361 .bdrv_co_create = ssh_co_create,
1362 .bdrv_co_create_opts = ssh_co_create_opts,
1363 .bdrv_close = ssh_close,
1364 .bdrv_has_zero_init = ssh_has_zero_init,
1365 .bdrv_co_readv = ssh_co_readv,
1366 .bdrv_co_writev = ssh_co_writev,
1257{
1258 BDRVSSHState *s = bs->opaque;
1259 int64_t length;
1260
1261 /* Note we cannot make a libssh call here. */
1262 length = (int64_t) s->attrs->size;
1263 trace_ssh_getlength(length);
1264

--- 94 unchanged lines hidden (view full) ---

1359 .bdrv_parse_filename = ssh_parse_filename,
1360 .bdrv_file_open = ssh_file_open,
1361 .bdrv_co_create = ssh_co_create,
1362 .bdrv_co_create_opts = ssh_co_create_opts,
1363 .bdrv_close = ssh_close,
1364 .bdrv_has_zero_init = ssh_has_zero_init,
1365 .bdrv_co_readv = ssh_co_readv,
1366 .bdrv_co_writev = ssh_co_writev,
1367 .bdrv_getlength = ssh_getlength,
1367 .bdrv_co_getlength = ssh_co_getlength,
1368 .bdrv_co_truncate = ssh_co_truncate,
1369 .bdrv_co_flush_to_disk = ssh_co_flush,
1370 .bdrv_refresh_filename = ssh_refresh_filename,
1371 .bdrv_dirname = ssh_bdrv_dirname,
1372 .create_opts = &ssh_create_opts,
1373 .strong_runtime_opts = ssh_strong_runtime_opts,
1374};
1375

--- 18 unchanged lines hidden ---
1368 .bdrv_co_truncate = ssh_co_truncate,
1369 .bdrv_co_flush_to_disk = ssh_co_flush,
1370 .bdrv_refresh_filename = ssh_refresh_filename,
1371 .bdrv_dirname = ssh_bdrv_dirname,
1372 .create_opts = &ssh_create_opts,
1373 .strong_runtime_opts = ssh_strong_runtime_opts,
1374};
1375

--- 18 unchanged lines hidden ---