* [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c
@ 2008-06-03 5:49 Marc Bevand
2008-06-03 13:22 ` Vegard Nossum
2008-06-03 16:57 ` [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Anthony Liguori
0 siblings, 2 replies; 6+ messages in thread
From: Marc Bevand @ 2008-06-03 5:49 UTC (permalink / raw)
To: qemu-devel
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: qemu-devel@nongnu.org
List-Id: qemu-devel.nongnu.org
List-Unsubscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
<mailto:qemu-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Jun 2008 05:49:44 -0000
"if (allocate == 1)" is always true because the value of "allocate" is
checked a few lines above.
Patch made against SVN's rev 4622.
Signed-off-by: Marc Bevand <m.bevand <at> gmail.com>
Please see:
http://etud.epita.fr/~bevand_m/pub/qemu-qcow-remove-dead-code.patch
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c
2008-06-03 5:49 [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Marc Bevand
@ 2008-06-03 13:22 ` Vegard Nossum
2008-06-05 22:51 ` [Qemu-devel] Off-topic (mailman bug) Marc Bevand
2008-06-03 16:57 ` [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Anthony Liguori
1 sibling, 1 reply; 6+ messages in thread
From: Vegard Nossum @ 2008-06-03 13:22 UTC (permalink / raw)
To: Marc Bevand; +Cc: qemu-devel
On Tue, Jun 3, 2008 at 7:49 AM, Marc Bevand <m.bevand@gmail.com> wrote:
> X-BeenThere: qemu-devel@nongnu.org
> X-Mailman-Version: 2.1.5
> Precedence: list
> Reply-To: qemu-devel@nongnu.org
> List-Id: qemu-devel.nongnu.org
> List-Unsubscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
> <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
> List-Archive: <http://lists.gnu.org/pipermail/qemu-devel>
> List-Post: <mailto:qemu-devel@nongnu.org>
> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
> List-Subscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
> <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
> Sender: qemu-devel-bounces+vegard.nossum=gmail.com@nongnu.org
> Errors-To: qemu-devel-bounces+vegard.nossum=gmail.com@nongnu.org
>
> "if (allocate == 1)" is always true because the value of "allocate" is
> checked a few lines above.
>
> Patch made against SVN's rev 4622.
>
> Signed-off-by: Marc Bevand <m.bevand <at> gmail.com>
>
> Please see:
> http://etud.epita.fr/~bevand_m/pub/qemu-qcow-remove-dead-code.patch
Uhm, what funny thing is this and why is my name in there? O.o
(Did mailman mess up?)
Vegard
--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c
2008-06-03 5:49 [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Marc Bevand
2008-06-03 13:22 ` Vegard Nossum
@ 2008-06-03 16:57 ` Anthony Liguori
2008-06-03 19:55 ` Marc Bevand
1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2008-06-03 16:57 UTC (permalink / raw)
To: Marc Bevand; +Cc: qemu-devel
Marc Bevand wrote:
> X-BeenThere: qemu-devel@nongnu.org
> X-Mailman-Version: 2.1.5
> Precedence: list
> Reply-To: qemu-devel@nongnu.org
> List-Id: qemu-devel.nongnu.org
> List-Unsubscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
> <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
> List-Archive: <http://lists.gnu.org/pipermail/qemu-devel>
> List-Post: <mailto:qemu-devel@nongnu.org>
> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
> List-Subscribe: <http://lists.nongnu.org/mailman/listinfo/qemu-devel>,
> <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
> Sender: qemu-devel-bounces+anthony=codemonkey.ws@nongnu.org
> Errors-To: qemu-devel-bounces+anthony=codemonkey.ws@nongnu.org
>
> "if (allocate == 1)" is always true because the value of "allocate" is
> checked a few lines above.
>
> Patch made against SVN's rev 4622.
>
> Signed-off-by: Marc Bevand <m.bevand <at> gmail.com>
>
> Please see:
> http://etud.epita.fr/~bevand_m/pub/qemu-qcow-remove-dead-code.patch
>
Please send the patch as an attachment or inlined.
Regards,
Anthony Liguori
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c
2008-06-03 16:57 ` [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Anthony Liguori
@ 2008-06-03 19:55 ` Marc Bevand
2008-06-03 20:15 ` Anthony Liguori
0 siblings, 1 reply; 6+ messages in thread
From: Marc Bevand @ 2008-06-03 19:55 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Vegard Nossum, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
On Tue, Jun 3, 2008 at 9:57 AM, Anthony Liguori <anthony@codemonkey.ws> wrote:
>
> Please send the patch as an attachment or inlined.
Here it is. (I originally wanted to inline it but I am currently stuck
with MUAs that cannot be configured to NOT wrap text lines.)
To answer Vegard's question, It's gmane that corrupted my email.
--
Marc Bevand
[-- Attachment #2: qemu-remove-dead-code.patch --]
[-- Type: application/octet-stream, Size: 3204 bytes --]
[PATCH] Remove dead-code (else-block) from block-qcow.c
"if (allocate == 1)" is always true because the value of "allocate" is
checked a few lines above.
Patch made against SVN's rev 4622.
Signed-off-by: Marc Bevand <m.bevand <at> gmail.com>
Index: block-qcow.c
===================================================================
--- block-qcow.c (revision 4622)
+++ block-qcow.c (working copy)
@@ -339,33 +339,28 @@
return -1;
} else {
cluster_offset = bdrv_getlength(s->hd);
- if (allocate == 1) {
- /* round to cluster size */
- cluster_offset = (cluster_offset + s->cluster_size - 1) &
- ~(s->cluster_size - 1);
- bdrv_truncate(s->hd, cluster_offset + s->cluster_size);
- /* if encrypted, we must initialize the cluster
- content which won't be written */
- if (s->crypt_method &&
- (n_end - n_start) < s->cluster_sectors) {
- uint64_t start_sect;
- start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
- memset(s->cluster_data + 512, 0x00, 512);
- for(i = 0; i < s->cluster_sectors; i++) {
- if (i < n_start || i >= n_end) {
- encrypt_sectors(s, start_sect + i,
- s->cluster_data,
- s->cluster_data + 512, 1, 1,
- &s->aes_encrypt_key);
- if (bdrv_pwrite(s->hd, cluster_offset + i * 512,
- s->cluster_data, 512) != 512)
- return -1;
- }
+ /* round to cluster size */
+ cluster_offset = (cluster_offset + s->cluster_size - 1) &
+ ~(s->cluster_size - 1);
+ bdrv_truncate(s->hd, cluster_offset + s->cluster_size);
+ /* if encrypted, we must initialize the cluster
+ content which won't be written */
+ if (s->crypt_method &&
+ (n_end - n_start) < s->cluster_sectors) {
+ uint64_t start_sect;
+ start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
+ memset(s->cluster_data + 512, 0x00, 512);
+ for(i = 0; i < s->cluster_sectors; i++) {
+ if (i < n_start || i >= n_end) {
+ encrypt_sectors(s, start_sect + i,
+ s->cluster_data,
+ s->cluster_data + 512, 1, 1,
+ &s->aes_encrypt_key);
+ if (bdrv_pwrite(s->hd, cluster_offset + i * 512,
+ s->cluster_data, 512) != 512)
+ return -1;
}
}
- } else {
- cluster_offset |= QCOW_OFLAG_COMPRESSED |
- (uint64_t)compressed_size << (63 - s->cluster_bits);
}
}
/* update L2 table */
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c
2008-06-03 19:55 ` Marc Bevand
@ 2008-06-03 20:15 ` Anthony Liguori
0 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2008-06-03 20:15 UTC (permalink / raw)
To: Marc Bevand; +Cc: Vegard Nossum, qemu-devel
Marc Bevand wrote:
> On Tue, Jun 3, 2008 at 9:57 AM, Anthony Liguori <anthony@codemonkey.ws> wrote:
>
>> Please send the patch as an attachment or inlined.
>>
>
> Here it is. (I originally wanted to inline it but I am currently stuck
> with MUAs that cannot be configured to NOT wrap text lines.)
>
Looks good to me.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
> To answer Vegard's question, It's gmane that corrupted my email.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] Off-topic (mailman bug)
2008-06-03 13:22 ` Vegard Nossum
@ 2008-06-05 22:51 ` Marc Bevand
0 siblings, 0 replies; 6+ messages in thread
From: Marc Bevand @ 2008-06-05 22:51 UTC (permalink / raw)
To: qemu-devel
Vegard Nossum <vegard.nossum <at> gmail.com> writes:
>
> > Sender: qemu-devel-bounces+vegard.nossum=gmail.com <at> nongnu.org
> > Errors-To: qemu-devel-bounces+vegard.nossum=gmail.com <at> nongnu.org
>
> Uhm, what funny thing is this and why is my name in there? O.o
>
> (Did mailman mess up?)
Actually I think what happened is a combination of 2 bugs in gmane and mailman.
When I sent the email via gmane.org, a bug in gmane made it accidently included
a header fragment in my message, then when mailman tried to forward it to each
subscriber, it must have used a bad rewrite rule (supposed to rewrite Sender:
and Errors-To: headers in a way unique to each subscriber), but this rule failed
to notice that these lines where part of the email body instead of the headers.
That would explain why subscribers see a portion of their email address in these
lines.
-marc
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-06-05 22:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03 5:49 [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Marc Bevand
2008-06-03 13:22 ` Vegard Nossum
2008-06-05 22:51 ` [Qemu-devel] Off-topic (mailman bug) Marc Bevand
2008-06-03 16:57 ` [Qemu-devel] [PATCH] Remove dead-code (else-block) from block-qcow.c Anthony Liguori
2008-06-03 19:55 ` Marc Bevand
2008-06-03 20:15 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).