From: Michael Tokarev <mjt@tls.msk.ru>
To: Adelina Tuvenie <adelinatuvenie@gmail.com>, qemu-trivial@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Adelina Tuvenie <atuvenie@cloudbasesolutions.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-trivial] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image
Date: Sat, 20 Sep 2014 17:53:32 +0400 [thread overview]
Message-ID: <541D86DC.9060701@msgid.tls.msk.ru> (raw)
In-Reply-To: <1411053464-12666-2-git-send-email-atuvenie@cloudbasesolutions.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Adelina Tuvenie <adelinatuvenie@gmail.com>, qemu-trivial@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Adelina Tuvenie <atuvenie@cloudbasesolutions.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-img: Cannot create fixed vhdx image
Date: Sat, 20 Sep 2014 17:53:32 +0400 [thread overview]
Message-ID: <541D86DC.9060701@msgid.tls.msk.ru> (raw)
In-Reply-To: <1411053464-12666-2-git-send-email-atuvenie@cloudbasesolutions.com>
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
next prev parent reply other threads:[~2014-09-20 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=541D86DC.9060701@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=adelinatuvenie@gmail.com \
--cc=atuvenie@cloudbasesolutions.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.