Displaying 20 results from an estimated 21 matches for "truncate_size".
2019 Apr 27
0
[nbdkit PATCH 2/4] truncate: Fix corruption when plugin changes per-connection size
...truncate.c
@@ -1,5 +1,5 @@
/* nbdkit
- * Copyright (C) 2018 Red Hat Inc.
+ * Copyright (C) 2018-2019 Red Hat Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -54,15 +54,6 @@
static int64_t truncate_size = -1;
static unsigned round_up = 0, round_down = 0;
-/* The real size of the underlying plugin. */
-static uint64_t real_size;
-
-/* The calculated size after applying the parameters. */
-static uint64_t size;
-
-/* This lock protects the real_size and size fields. */
-static pthread_mutex_t lock...
2019 May 17
1
[nbdkit PATCH] truncate: Detect large image overflow with round-up
...c
+++ b/filters/truncate/truncate.c
@@ -38,6 +38,7 @@
#include <string.h>
#include <limits.h>
#include <errno.h>
+#include <inttypes.h>
#include <nbdkit-filter.h>
@@ -172,8 +173,14 @@ truncate_prepare (struct nbdkit_next_ops *next_ops, void *nxdata,
*/
if (truncate_size >= 0)
h->size = truncate_size;
- if (round_up > 0)
+ if (round_up > 0) {
+ if (ROUND_UP (h->size, round_up) > INT64_MAX) {
+ nbdkit_error ("cannot round size %" PRId64 " up to next boundary of %u",
+ h->size, round_up);
+...
2018 Sep 17
2
[PATCH nbdkit v2] common: Introduce round up, down; and divide round
Since we're using ({ .. }) gcc/clang extension, let's rewrite the
rounding.h change too.
Rich.
2019 Apr 27
8
[nbdkit PATCH 0/4] Fix truncate handling of real_size
While working on adding assertions to pthread_mutex_lock calls, I
noticed that the truncate filter's use of mutex didn't really protect
us, and isn't really necessary. Cleaning that up also spotted a couple
of other potential cleanups.
Eric Blake (4):
filters: Drop useless .open callbacks
truncate: Fix corruption when plugin changes per-connection size
truncate: Test for safe
2018 Sep 17
1
Re: [PATCH nbdkit v2] common: Introduce round up, down; and divide round up functions.
...t;
> #include "ispowerof2.h"
> #include "iszero.h"
> +#include "rounding.h"
>
> #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
>
> @@ -157,9 +158,9 @@ truncate_get_size (struct nbdkit_next_ops *next_ops, void *nxdata,
> if (truncate_size >= 0)
> size = truncate_size;
> if (round_up > 0)
> - size = (size + round_up - 1) & ~(round_up - 1);
> + size = ROUND_UP (size, round_up);
> if (round_down > 0)
> - size &= ~(round_down - 1);
> + size = ROUND_DOWN (size, round_down);...
2018 Sep 17
0
[PATCH nbdkit v2] common: Introduce round up, down; and divide round up functions.
...+ b/filters/truncate/truncate.c
@@ -46,6 +46,7 @@
#include "ispowerof2.h"
#include "iszero.h"
+#include "rounding.h"
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
@@ -157,9 +158,9 @@ truncate_get_size (struct nbdkit_next_ops *next_ops, void *nxdata,
if (truncate_size >= 0)
size = truncate_size;
if (round_up > 0)
- size = (size + round_up - 1) & ~(round_up - 1);
+ size = ROUND_UP (size, round_up);
if (round_down > 0)
- size &= ~(round_down - 1);
+ size = ROUND_DOWN (size, round_down);
ret = size;
pthread_mutex_unlo...
2018 Sep 17
0
[PATCH nbdkit v3 2/3] common: Introduce round up, down; and divide round up functions.
...+ b/filters/truncate/truncate.c
@@ -46,6 +46,7 @@
#include "ispowerof2.h"
#include "iszero.h"
+#include "rounding.h"
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
@@ -157,9 +158,9 @@ truncate_get_size (struct nbdkit_next_ops *next_ops, void *nxdata,
if (truncate_size >= 0)
size = truncate_size;
if (round_up > 0)
- size = (size + round_up - 1) & ~(round_up - 1);
+ size = ROUND_UP (size, round_up);
if (round_down > 0)
- size &= ~(round_down - 1);
+ size = ROUND_DOWN (size, round_down);
ret = size;
pthread_mutex_unlo...
2015 Jun 23
2
[PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...InitScratchFS, Always, TestResultTrue (
+ let size = 1024 * 1024 in
[["mkdir"; "/copyff2"];
["fill"; "0"; string_of_int size; "/copyff2/src"];
["touch"; "/copyff2/dest"];
["truncate_size"; "/copyff2/dest"; string_of_int size];
- ["copy_file_to_file"; "/copyff2/src"; "/copyff2/dest"; ""; ""; ""; "true"];
- ["is_zero"; "/copyff2/dest"]]), []
+ ["copy_f...
2009 Nov 10
0
ANNOUNCE: libguestfs 1.0.78 released
...wordpress.com/2009/10/29/virt-win-reg-get-at-the-windows-registry-in-your-windows-guests/
http://rwmj.wordpress.com/2009/10/28/libhivex-windows-registry-hive-extractor-library/
- OCaml bindings for virt-inspector
- RELAX NG schema for virt-inspector
- New APIs: utimens, vfs_type, truncate, truncate_size, lchown,
lstatlist, lxattrlist, readlinklist, case_sensitive_path, find0,
mkfs_b, mke2journal, and more ...
- New program: OCaml viewer
http://rwmj.wordpress.com/2009/09/29/graphical-virt-df/
- Allow stdout to be redirected when running guestfish remotely (Matt Booth).
- Remove requi...
2018 Aug 12
13
[PATCH nbdkit 00/10] FreeBSD support.
With these patches, a majority of tests pass. The notable
things which are still broken:
- Because FreeBSD links /home -> /usr/home, $(pwd) gives a different
result from realpath(2). Therefore some tests which implicitly
rely on (eg) a plugin which calls nbdkit_realpath internally and
then checking that path against $(pwd) fail.
- Shebangs (#!) don't seem to work the same way
2015 Jun 23
0
Re: [PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...is it supposed to be used and its usage has been
forgotten?
> [["mkdir"; "/copyff2"];
> ["fill"; "0"; string_of_int size; "/copyff2/src"];
> ["touch"; "/copyff2/dest"];
> ["truncate_size"; "/copyff2/dest"; string_of_int size];
> - ["copy_file_to_file"; "/copyff2/src"; "/copyff2/dest"; ""; ""; ""; "true"];
> - ["is_zero"; "/copyff2/dest"]]), []
> +...
2019 May 17
0
[nbdkit PATCH 3/3] filters: Use only .thread_model, not THREAD_MODEL
...ncate/truncate.c
index 38b1cd9..64be839 100644
--- a/filters/truncate/truncate.c
+++ b/filters/truncate/truncate.c
@@ -46,8 +46,6 @@
#include "iszero.h"
#include "rounding.h"
-#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
-
/* These are the parameters. */
static int64_t truncate_size = -1;
static unsigned round_up = 0, round_down = 0;
diff --git a/filters/xz/xz.c b/filters/xz/xz.c
index 8ada294..51ac919 100644
--- a/filters/xz/xz.c
+++ b/filters/xz/xz.c
@@ -246,7 +246,10 @@ xz_pread (struct nbdkit_next_ops *next_ops, void *nxdata,
return 0;
}
-#define THREAD_MODEL NBDKIT_...
2018 Sep 17
4
[PATCH nbdkit 0/3] Add partitioning plugin.
nbdkit partitioning boot.img swap.img root.img
... creates a virtual disk by adding a partition table.
In ancient times Xen used to do this.
Rich.
2018 Sep 17
7
[PATCH nbdkit v3 0/3] Add partitioning plugin.
The partitioning plugin patch is the same (except for rebasing).
However I have changed the first two patches based on feedback
received. In particular this fixes a very serious bug found by Eric
Blake in the current truncate filter.
Rich.
2019 May 17
4
[nbdkit PATCH 0/3] Add noparallel filter
Being able to programmatically force nbdkit to be less parallel can be
useful during testing. I was less sure about patch 3, but if you like
it, I'm inclined to instead squash it into patch 1. This patch is
written to apply after my NBD_CMD_CACHE work (since I touched the
nocache filter); but can be rearranged if we think this series should
go in first while that one undergoes any adjustments
2012 Jan 12
1
Libguestfs gobject bindings
I'm currently working on gobject bindings for libguestfs. I haven't got
as far as compiling anything yet, but I've attached the C header for
initial review.
Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team
GPG ID: D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
-------------- next part --------------
An embedded and
2017 Feb 21
1
[PATCH] generator: Put all the daemon procedure numbers (proc_nr)
This is a follow-up to the other generator changes in:
https://www.redhat.com/archives/libguestfs/2017-February/msg00217.html
Rich.
2017 Feb 18
8
[PATCH 0/6] generator: Split up generator/actions.ml
Split up the huge generator/actions.ml into several smaller files.
Rich.
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...RErr, [String (Pathname, "path")], [];
tests = [
InitScratchFS, Always, TestResult (
[["write"; "/truncate"; "some stuff so size is not zero"];
@@ -4901,7 +4901,7 @@ file must exist already." };
{ defaults with
name = "truncate_size"; added = (1, 0, 77);
- style = RErr, [Pathname "path"; Int64 "size"], [];
+ style = RErr, [String (Pathname, "path"); Int64 "size"], [];
tests = [
InitScratchFS, Always, TestResult (
[["touch"; "/truncate_size&q...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator.
Rich.