* [Qemu-trivial] [PATCH 0/1] qemu-img: Cannot create fixed vhdx image @ 2014-09-18 15:17 Adelina Tuvenie 2014-09-18 15:17 ` [Qemu-trivial] [PATCH 1/1] " Adelina Tuvenie 0 siblings, 1 reply; 6+ messages in thread From: Adelina Tuvenie @ 2014-09-18 15:17 UTC (permalink / raw) To: qemu-trivial; +Cc: Adelina Tuvenie, aliguori [-- Attachment #1: Type: text/plain, Size: 166 bytes --] *** BLURB HERE *** Adelina Tuvenie (1): qemu-img: Cannot create fixed vhdx image block/vhdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-trivial] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image 2014-09-18 15:17 [Qemu-trivial] [PATCH 0/1] qemu-img: Cannot create fixed vhdx image Adelina Tuvenie @ 2014-09-18 15:17 ` Adelina Tuvenie 2014-09-20 13:53 ` [Qemu-devel] " Michael Tokarev 0 siblings, 1 reply; 6+ messages in thread From: Adelina Tuvenie @ 2014-09-18 15:17 UTC (permalink / raw) To: qemu-trivial; +Cc: Adelina Tuvenie, aliguori [-- Attachment #1: Type: text/plain, Size: 637 bytes --] When trying to create a fixed vhd image qemu-img will return the following error: qemu-img: test.vhdx: Could not create image: Cannot allocate memory This happens because of a incorrect check in vhdx.c. Specifficaly, in vhdx_create_bat(), after allocating memory for the BAT entry, there is a check to determine if the allocation was unsuccsessful. The error comes from the fact that it checks if s->bat isn't NULL, which is true in case of succsessful allocation, and exits with error ENOMEM. Signed-off-by: Adelina Tuvenie <atuvenie@cloudbasesolutions.com> --- block/vhdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-qemu-img-Cannot-create-fixed-vhdx-image.patch --] [-- Type: text/x-patch; name="0001-qemu-img-Cannot-create-fixed-vhdx-image.patch", Size: 499 bytes --] diff --git a/block/vhdx.c b/block/vhdx.c index 796b7bd..5bf292e 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1593,7 +1593,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, bdrv_has_zero_init(bs) == 0) { /* for a fixed file, the default BAT entry is not zero */ s->bat = g_try_malloc0(length); - if (length && s->bat != NULL) { + if (length && s->bat == NULL) { ret = -ENOMEM; goto exit; } ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image 2014-09-18 15:17 ` [Qemu-trivial] [PATCH 1/1] " Adelina Tuvenie @ 2014-09-20 13:53 ` Michael Tokarev 0 siblings, 0 replies; 6+ messages in thread From: Michael Tokarev @ 2014-09-20 13:53 UTC (permalink / raw) To: Adelina Tuvenie, qemu-trivial Cc: Kevin Wolf, Adelina Tuvenie, qemu-devel, Stefan Hajnoczi 18.09.2014 19:17, Adelina Tuvenie wrote: > > When trying to create a fixed vhd image qemu-img will return the > following error: > > qemu-img: test.vhdx: Could not create image: Cannot allocate memory > > This happens because of a incorrect check in vhdx.c. Specifficaly, > in vhdx_create_bat(), after allocating memory for the BAT entry, > there is a check to determine if the allocation was unsuccsessful. > The error comes from the fact that it checks if s->bat isn't NULL, > which is true in case of succsessful allocation, and exits with > error ENOMEM. Applying to -trivial, as it is an obvious trivial one-liner, hopefully it's okay for kwolf@ and stefanha@. But please, - Cc qemu-devel and the subsystem maintainers (Cc'ed) - do not send an "intro" email for single patches - do not attach the patch, place it inline if possible (Since the original patch was in an attachment, I copy it here for completness: diff --git a/block/vhdx.c b/block/vhdx.c index 796b7bd..5bf292e 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1593,7 +1593,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, bdrv_has_zero_init(bs) == 0) { /* for a fixed file, the default BAT entry is not zero */ s->bat = g_try_malloc0(length); - if (length && s->bat != NULL) { + if (length && s->bat == NULL) { ret = -ENOMEM; goto exit; } ) I also modified the subject line, to read: block: allow creation of fixed vhdx images Thanks, /mjt ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image @ 2014-09-20 13:53 ` Michael Tokarev 0 siblings, 0 replies; 6+ messages in thread From: Michael Tokarev @ 2014-09-20 13:53 UTC (permalink / raw) To: Adelina Tuvenie, qemu-trivial Cc: Kevin Wolf, Adelina Tuvenie, qemu-devel, Stefan Hajnoczi 18.09.2014 19:17, Adelina Tuvenie wrote: > > When trying to create a fixed vhd image qemu-img will return the > following error: > > qemu-img: test.vhdx: Could not create image: Cannot allocate memory > > This happens because of a incorrect check in vhdx.c. Specifficaly, > in vhdx_create_bat(), after allocating memory for the BAT entry, > there is a check to determine if the allocation was unsuccsessful. > The error comes from the fact that it checks if s->bat isn't NULL, > which is true in case of succsessful allocation, and exits with > error ENOMEM. Applying to -trivial, as it is an obvious trivial one-liner, hopefully it's okay for kwolf@ and stefanha@. But please, - Cc qemu-devel and the subsystem maintainers (Cc'ed) - do not send an "intro" email for single patches - do not attach the patch, place it inline if possible (Since the original patch was in an attachment, I copy it here for completness: diff --git a/block/vhdx.c b/block/vhdx.c index 796b7bd..5bf292e 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1593,7 +1593,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, bdrv_has_zero_init(bs) == 0) { /* for a fixed file, the default BAT entry is not zero */ s->bat = g_try_malloc0(length); - if (length && s->bat != NULL) { + if (length && s->bat == NULL) { ret = -ENOMEM; goto exit; } ) I also modified the subject line, to read: block: allow creation of fixed vhdx images Thanks, /mjt ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image 2014-09-20 13:53 ` [Qemu-devel] " Michael Tokarev @ 2014-09-22 7:55 ` Kevin Wolf -1 siblings, 0 replies; 6+ messages in thread From: Kevin Wolf @ 2014-09-22 7:55 UTC (permalink / raw) To: Michael Tokarev Cc: qemu-trivial, Adelina Tuvenie, Adelina Tuvenie, qemu-devel, Stefan Hajnoczi Am 20.09.2014 um 15:53 hat Michael Tokarev geschrieben: > 18.09.2014 19:17, Adelina Tuvenie wrote: > > > > When trying to create a fixed vhd image qemu-img will return the > > following error: > > > > qemu-img: test.vhdx: Could not create image: Cannot allocate memory > > > > This happens because of a incorrect check in vhdx.c. Specifficaly, > > in vhdx_create_bat(), after allocating memory for the BAT entry, > > there is a check to determine if the allocation was unsuccsessful. > > The error comes from the fact that it checks if s->bat isn't NULL, > > which is true in case of succsessful allocation, and exits with > > error ENOMEM. > > Applying to -trivial, as it is an obvious trivial one-liner, hopefully > it's okay for kwolf@ and stefanha@. But please, > > - Cc qemu-devel and the subsystem maintainers (Cc'ed) > - do not send an "intro" email for single patches > - do not attach the patch, place it inline if possible > > (Since the original patch was in an attachment, I copy it here for > completness: > > diff --git a/block/vhdx.c b/block/vhdx.c > index 796b7bd..5bf292e 100644 > --- a/block/vhdx.c > +++ b/block/vhdx.c > @@ -1593,7 +1593,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, > bdrv_has_zero_init(bs) == 0) { > /* for a fixed file, the default BAT entry is not zero */ > s->bat = g_try_malloc0(length); > - if (length && s->bat != NULL) { > + if (length && s->bat == NULL) { > ret = -ENOMEM; > goto exit; > } > ) Whoops, this is what happens when you make mechanical changes manually. And I fooled two reviewers with this code. :-) Acked-by: Kevin Wolf <kwolf@redhat.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image @ 2014-09-22 7:55 ` Kevin Wolf 0 siblings, 0 replies; 6+ messages in thread From: Kevin Wolf @ 2014-09-22 7:55 UTC (permalink / raw) To: Michael Tokarev Cc: qemu-trivial, Adelina Tuvenie, Adelina Tuvenie, qemu-devel, Stefan Hajnoczi Am 20.09.2014 um 15:53 hat Michael Tokarev geschrieben: > 18.09.2014 19:17, Adelina Tuvenie wrote: > > > > When trying to create a fixed vhd image qemu-img will return the > > following error: > > > > qemu-img: test.vhdx: Could not create image: Cannot allocate memory > > > > This happens because of a incorrect check in vhdx.c. Specifficaly, > > in vhdx_create_bat(), after allocating memory for the BAT entry, > > there is a check to determine if the allocation was unsuccsessful. > > The error comes from the fact that it checks if s->bat isn't NULL, > > which is true in case of succsessful allocation, and exits with > > error ENOMEM. > > Applying to -trivial, as it is an obvious trivial one-liner, hopefully > it's okay for kwolf@ and stefanha@. But please, > > - Cc qemu-devel and the subsystem maintainers (Cc'ed) > - do not send an "intro" email for single patches > - do not attach the patch, place it inline if possible > > (Since the original patch was in an attachment, I copy it here for > completness: > > diff --git a/block/vhdx.c b/block/vhdx.c > index 796b7bd..5bf292e 100644 > --- a/block/vhdx.c > +++ b/block/vhdx.c > @@ -1593,7 +1593,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, > bdrv_has_zero_init(bs) == 0) { > /* for a fixed file, the default BAT entry is not zero */ > s->bat = g_try_malloc0(length); > - if (length && s->bat != NULL) { > + if (length && s->bat == NULL) { > ret = -ENOMEM; > goto exit; > } > ) Whoops, this is what happens when you make mechanical changes manually. And I fooled two reviewers with this code. :-) Acked-by: Kevin Wolf <kwolf@redhat.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-09-22 7:56 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-18 15:17 [Qemu-trivial] [PATCH 0/1] qemu-img: Cannot create fixed vhdx image Adelina Tuvenie 2014-09-18 15:17 ` [Qemu-trivial] [PATCH 1/1] " Adelina Tuvenie 2014-09-20 13:53 ` Michael Tokarev 2014-09-20 13:53 ` [Qemu-devel] " Michael Tokarev 2014-09-22 7:55 ` [Qemu-trivial] " Kevin Wolf 2014-09-22 7:55 ` [Qemu-devel] " Kevin Wolf
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.