search for: valid_port

Displaying 3 results from an estimated 3 matches for "valid_port".

2020 Feb 11
2
[PATCH v2] lib: add support for disks with 4096 bytes sector size
...ffort", - drv->copyonread ? " copyonread" : ""); + drv->copyonread ? " copyonread" : "", + drv->blocksize ? " blocksize=" : "", + drv->blocksize ? s_blocksize : ""); } /** @@ -618,6 +628,17 @@ valid_port (int port) return 1; } +/** + * Check the block size is reasonable. It can't be other then 512 or 4096. + */ +static int +valid_blocksize (int blocksize) +{ + if (blocksize == 512 || blocksize == 4096) + return 1; + return 0; +} + static int parse_one_server (guestfs_h *g, const c...
2020 Feb 10
1
[PATCH] lib: allow to specify physical/logical block size for disks
...ffort", - drv->copyonread ? " copyonread" : ""); + drv->copyonread ? " copyonread" : "", + drv->blocksize ? " blocksize=" : "", + drv->blocksize ? s_blocksize : ""); } /** @@ -618,6 +628,17 @@ valid_port (int port) return 1; } +/** + * Check the block size is reasonable. It can't be other then 0, 512 or 4096. + */ +static int +valid_blocksize (int blocksize) +{ + if (blocksize == 0 || blocksize == 512 || blocksize == 4096) + return 1; + return 0; +} + static int parse_one_server (...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...be ‘raw’")); return NULL; } } else { @@ -653,14 +653,14 @@ parse_one_server (guestfs_h *g, const char *server, struct drive_server *ret) if (match2 (g, server, re_hostname_port, &hostname, &port_str)) { if (sscanf (port_str, "%d", &port) != 1 || !valid_port (port)) { - error (g, _("invalid port number '%s'"), port_str); + error (g, _("invalid port number ‘%s’"), port_str); free (hostname); free (port_str); return -1; } free (port_str); if (!VALID_HOSTNAME (hostname)) { - er...