Skip to contentSkip to conversation

posting patches in pull requests (was Re: [PATCH 08/29] cpu: Add qemu_for_each_cpu())

Qemu-devel Michael S. Tsirkin 8 participants 21 messages May 2, 2013 – May 3, 2013

lore
Share & tools
lore
#0 lore raw

Anthony, can we please make it a rule that
all patches in pull request are tagged specially?

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

Maybe you could teach your scripts to ignore [PULL X/Y] where X>0?

This way people could tag all resent patches
as PULL.

Further,
PULL 0/2
PULL 1/2
PULL 2/2

aligns better than

PULL 0/2
PATCH 1/2
PATCH 2/2

Quoted 56 lines · Andreas Färber

From: "Michael S. Tsirkin" <[email protected]>

Wrapper to avoid open-coded loops and to make CPUState iteration independent of CPUArchState.

---
 exec.c            | 10 ++++++++++
 include/qom/cpu.h |  9 +++++++++
 2 files changed, 19 insertions(+)
exec.c +10 -0
index fa1e0c3..19725db 100644
@@ -265,6 +265,16 @@ CPUState *qemu_get_cpu(int index)
     return env ? cpu : NULL;
 }
 
+void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data)
+{
+    CPUArchState *env = first_cpu;
+
+    while (env) {
+        func(ENV_GET_CPU(env), data);
+        env = env->next_cpu;
+    }
+}
+
 void cpu_exec_init(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
include/qom/cpu.h +9 -0
index 1b4de17..a28e5ff 100644
@@ -216,6 +216,15 @@ bool cpu_is_stopped(CPUState *cpu);
 void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data);
 
 /**
+ * qemu_for_each_cpu:
+ * @func: The function to be executed.
+ * @data: Data to pass to the function.
+ *
+ * Executes @func for each CPU.
+ */
+void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data);
+
+/**
  * qemu_get_cpu:
  * @index: The CPUState@cpu_index value of the CPU to obtain.
  *
Signature · 1 line
1.8.1.4
#2 lore raw
In reply to Peter Maydell
Quoted 11 lines · Peter Maydell
Quoted 3 lines · Michael S. Tsirkin

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

You need to fix patchwork to have some conception of a patch series. Then you can just select the whole series which is the pull request and say "ignore this" and you're done. Any patch-handling tool that doesn't let you operate at the level of a complete series is always going to mean you're doing huge amounts of busywork sometimes.

Sometimes I'm Cc'd on 1 patch out of series.
I might not want to go dig out the series only to check if it actually needs review.

Quoted 6 lines

I don't particularly object to suggesting that pullreq patches are all tagged 'PULL'; I don't think it's very likely that you'll get 100% consistency out of everybody though.

-- PMM

As there's one person that does the merges, it's pretty easy to get consistency. If you are not sending a patch for review it's just wrong to say PATCH in a subject. Or should I now ignore everything that doesn't explicitly say [PATCH pleasereview] ?

Signature · 1 line
MST
#1 lore raw
In reply to Michael S. Tsirkin
Quoted 3 lines · Michael S. Tsirkin

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

You need to fix patchwork to have some conception of a patch series. Then you can just select the whole series which is the pull request and say "ignore this" and you're done. Any patch-handling tool that doesn't let you operate at the level of a complete series is always going to mean you're doing huge amounts of busywork sometimes.

I don't particularly object to suggesting that pullreq patches are all tagged 'PULL'; I don't think it's very likely that you'll get 100% consistency out of everybody though.

-- PMM

#3 lore raw
In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin

On Thu, May 02, 2013 at 03:09:04PM +0100, Peter Maydell wrote:

Sometimes I'm Cc'd on 1 patch out of series.
I might not want to go dig out the series only to check if it actually needs review.

I think cc'ing somebody on half a pullrequest or series is a bit odd, personally.

Quoted 7 lines
Quoted 4 lines

I don't particularly object to suggesting that pullreq patches are all tagged 'PULL'; I don't think it's very likely that you'll get 100% consistency out of everybody though.

As there's one person that does the merges, it's pretty easy to get consistency.

Every submaintainer sends pullrequests, so there's a relatively large body of people sending these emails.

-- PMM

#4 lore raw
Quoted 15 lines · Peter Maydell
Quoted 5 lines · Michael S. Tsirkin

On Thu, May 02, 2013 at 03:09:04PM +0100, Peter Maydell wrote:

Sometimes I'm Cc'd on 1 patch out of series.
I might not want to go dig out the series only to check if it actually needs review.

I think cc'ing somebody on half a pullrequest or series is a bit odd, personally.

Quoted 4 lines
Quoted 4 lines

I don't particularly object to suggesting that pullreq patches are all tagged 'PULL'; I don't think it's very likely that you'll get 100% consistency out of everybody though.

Quoted 7 lines
Quoted 2 lines

As there's one person that does the merges, it's pretty easy to get consistency.

Every submaintainer sends pullrequests, so there's a relatively large body of people sending these emails.

-- PMM

Well everyone used to send requests without patches. We managed to change that we can change the format too :)

#5 lore raw
In reply to Peter Maydell
Quoted 9 lines · Peter Maydell
Quoted 5 lines · Michael S. Tsirkin

On Thu, May 02, 2013 at 03:09:04PM +0100, Peter Maydell wrote:

Sometimes I'm Cc'd on 1 patch out of series.
I might not want to go dig out the series only
to check if it actually needs review.

I think cc'ing somebody on half a pullrequest or series is a bit odd, personally.

Not uncommon if you do this ...

[sendemail]
to = [email protected]
cccmd = scripts/get_maintainer.pl --nogit-fallback

... in .git/config.

cheers,
Gerd

#6 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 2 lines · Peter Maydell

I think cc'ing somebody on half a pullrequest or series is a bit odd, personally.

Not uncommon if you do this ...

[sendemail]
to = [email protected]
cccmd = scripts/get_maintainer.pl --nogit-fallback

Wow, you trust get_maintainer.pl that much? IME it tends to give a huge pile of useless cc suggestions.

-- PMM

#12 lore raw
In reply to Michael S. Tsirkin
Quoted 17 lines · Michael S. Tsirkin

Anthony, can we please make it a rule that
all patches in pull request are tagged specially?

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

Maybe you could teach your scripts to ignore [PULL X/Y] where X>0?

This way people could tag all resent patches
as PULL.

Further,
PULL 0/2
PULL 1/2
PULL 2/2

Quoted 5 lines

aligns better than

PULL 0/2
PATCH 1/2
PATCH 2/2

Seems like a nice idea. I'm also occassionally hit by a stray PATCH email that's actually part of a larger pull request.

Stefan

#13 lore raw
In reply to Michael S. Tsirkin

Il 02/05/2013 15:51, Michael S. Tsirkin ha scritto:

Quoted 17 lines

Anthony, can we please make it a rule that
all patches in pull request are tagged specially?

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

Maybe you could teach your scripts to ignore [PULL X/Y] where X>0?

This way people could tag all resent patches
as PULL.

Further,
PULL 0/2
PULL 1/2
PULL 2/2

Quoted 5 lines

aligns better than

PULL 0/2
PATCH 1/2
PATCH 2/2

Sure, I was just following others for example.

/me changes his scripts...

-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);

Yes, Perl...

Paolo

#14 lore raw
Quoted 6 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

(I really must put my random scripts into git.)

-- PMM

#15 lore raw
Quoted 11 lines · Peter Maydell
Quoted 6 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

You can also just do git format-patch --subject-prefix=PULL and avoid any fixups...

Regards,

Anthony Liguori

Quoted 4 lines

(I really must put my random scripts into git.)

-- PMM

#16 lore raw
Quoted 7 lines · Anthony Liguori
Quoted 3 lines · Peter Maydell

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

You can also just do git format-patch --subject-prefix=PULL and avoid any fixups...

I do (now), in fact -- the sed is still needed to make the cover letter subject say '"arm-devs" queue'.

-- PMM

#7 lore raw
In reply to Peter Maydell

Am 02.05.2013 16:57, schrieb Peter Maydell:

Quoted 5 lines · Gerd Hoffmann
Quoted 4 lines · Peter Maydell
Quoted 2 lines

I think cc'ing somebody on half a pullrequest or series is a bit odd, personally.

Quoted 8 lines
Quoted 5 lines

Not uncommon if you do this ...

[sendemail]
to = [email protected]
cccmd = scripts/get_maintainer.pl --nogit-fallback

Wow, you trust get_maintainer.pl that much? IME it tends to give a huge pile of useless cc suggestions.

Useless? It's based on MAINTAINERS, which I expect maintainers to keep up-to-date if they no longer want to maintain something. It's rather that new files don't get entries and thus too few CCs at times IME.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#17 lore raw
In reply to Anthony Liguori
Quoted 14 lines · Anthony Liguori
Quoted 11 lines · Peter Maydell
Quoted 6 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

Quoted 6 lines

You can also just do git format-patch --subject-prefix=PULL and avoid any fixups...

Regards,

Anthony Liguori

Don't forget -M please, especially if you are Paolo :)

Quoted 4 lines
Quoted 4 lines

(I really must put my random scripts into git.)

-- PMM

#8 lore raw
In reply to Andreas Färber
Quoted 7 lines · Andreas Färber

Am 02.05.2013 16:57, schrieb Peter Maydell:

Quoted 2 lines

Wow, you trust get_maintainer.pl that much? IME it tends to give a huge pile of useless cc suggestions.

Useless? It's based on MAINTAINERS, which I expect maintainers to keep up-to-date if they no longer want to maintain something. It's rather that new files don't get entries and thus too few CCs at times IME.

The ccs based on MAINTAINERS are fine -- it's the random extras it picks based on other people who've made patches to the same files in the past that are usually wrong. For example I tried running it on a patch to MAINTAINERS itself, and it suggested ccing you, Alex, Stefan H, Peter Crosthwaite and Edgar, which is a random mishmash and doesn't include the key person you actually need to CC, ie Anthony.

The actual rule as far as I can tell for CCs is "if file is explicitly listed in MAINTAINERS, cc those people; otherwise CC either Blue and Aurelien [if a random target-* patch] or Anthony [everything else]; cc trivial if sufficiently small; also for bugfixes CC whoever wrote the commit you're fixing". get_maintainer.pl doesn't do that, so I just write CCs manually.

thanks
-- PMM

#9 lore raw
Quoted 5 lines · Peter Maydell
Quoted 4 lines · Andreas Färber

Am 02.05.2013 16:57, schrieb Peter Maydell:

Quoted 2 lines

Wow, you trust get_maintainer.pl that much? IME it tends to give a huge pile of useless cc suggestions.

Quoted 7 lines
Quoted 3 lines

Useless? It's based on MAINTAINERS, which I expect maintainers to keep up-to-date if they no longer want to maintain something. It's rather that new files don't get entries and thus too few CCs at times IME.

The ccs based on MAINTAINERS are fine -- it's the random extras it picks based on other people who've made patches to the same files in the past that are usually wrong.

Just add --nogit then?

Quoted 14 lines

For example I tried running it on a patch to MAINTAINERS itself, and it suggested ccing you, Alex, Stefan H, Peter Crosthwaite and Edgar, which is a random mishmash and doesn't include the key person you actually need to CC, ie Anthony.

The actual rule as far as I can tell for CCs is "if file is explicitly listed in MAINTAINERS, cc those people; otherwise CC either Blue and Aurelien [if a random target-* patch] or Anthony [everything else]; cc trivial if sufficiently small; also for bugfixes CC whoever wrote the commit you're fixing". get_maintainer.pl doesn't do that, so I just write CCs manually.

Quoted 2 lines

thanks
-- PMM

You could also try to make get_maintainer.pl do what you want. Well maybe beside trivial.

#18 lore raw
In reply to Michael S. Tsirkin

Il 02/05/2013 18:06, Michael S. Tsirkin ha scritto:

Quoted 9 lines · Anthony Liguori
Quoted 8 lines
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

You can also just do git format-patch --subject-prefix=PULL and avoid any fixups...

I still want to avoid any mistakes in case I override the subject prefix (e.g. to include 1.5)... Keeping the substitution is cheap and a nice safety net.

Quoted 1 line

Don't forget -M please, especially if you are Paolo :)

Or

[diff]
renames = true
renamelimit = 2000

Paolo

#10 lore raw
In reply to Peter Maydell

Am 02.05.2013 18:08, schrieb Peter Maydell:

Quoted 9 lines · Andreas Färber
Quoted 7 lines

Am 02.05.2013 16:57, schrieb Peter Maydell:

Quoted 2 lines

Wow, you trust get_maintainer.pl that much? IME it tends to give a huge pile of useless cc suggestions.

Useless? It's based on MAINTAINERS, which I expect maintainers to keep up-to-date if they no longer want to maintain something. It's rather that new files don't get entries and thus too few CCs at times IME.

Quoted 8 lines

The ccs based on MAINTAINERS are fine -- it's the random extras it picks based on other people who've made patches to the same files in the past that are usually wrong. For example I tried running it on a patch to MAINTAINERS itself, and it suggested ccing you, Alex, Stefan H, Peter Crosthwaite and Edgar, which is a random mishmash and doesn't include the key person you actually need to CC, ie Anthony.

That's why Gerd correctly wrote scripts/get_maintainer.pl --nogit-fallback - it doesn't do what you claim, although the default does.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#11 lore raw
In reply to Peter Maydell
Quoted 11 lines · Peter Maydell
Quoted 3 lines · Michael S. Tsirkin

As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time.

You need to fix patchwork to have some conception of a patch series. Then you can just select the whole series which is the pull request and say "ignore this" and you're done. Any patch-handling tool that doesn't let you operate at the level of a complete series is always going to mean you're doing huge amounts of busywork sometimes.

patches solves this problem. It just requires someone to write a bridge that updates patchwork based on the information that patches mines.

Quoted 4 lines

I don't particularly object to suggesting that pullreq patches are all tagged 'PULL'; I don't think it's very likely that you'll get 100% consistency out of everybody though.

Ack.

Regards,

Anthony Liguori

Quoted 2 lines

-- PMM

#19 lore raw
In reply to Paolo Bonzini
Quoted 23 lines · Paolo Bonzini

Il 02/05/2013 18:06, Michael S. Tsirkin ha scritto:

Quoted 9 lines · Anthony Liguori
Quoted 8 lines
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

You can also just do git format-patch --subject-prefix=PULL and avoid any fixups...

I still want to avoid any mistakes in case I override the subject prefix (e.g. to include 1.5)... Keeping the substitution is cheap and a nice safety net.

Quoted 7 lines
Quoted 1 line

Don't forget -M please, especially if you are Paolo :)

Or

[diff]
renames = true
renamelimit = 2000

BTW, this is all great stuff to put in a SubmitAPullRequest page on the wiki. I don't send pull requests so I don't have a script to do this, but I'd encourage those that do to share their scripts on the wiki.

Regards,

Anthony Liguori

Quoted 2 lines

Paolo

#20 lore raw
In reply to Peter Maydell

Hi Peter,

Quoted 6 lines · Peter Maydell
Quoted 5 lines · Paolo Bonzini

/me changes his scripts...

(quoted diff) +1 -1
-s/PATCH/PULL/ if (/PATCH 0+\\//);
+s/PATCH/PULL/ if (/^Subject:/);
Quoted 8 lines
Quoted 1 line

Yes, Perl...

Heh, I use sed for this bit:
sed -i -e 's/^Subject: \[PULL\(.*\)].*/Subject: [PULL\1] '"$BRANCHPFX"' queue/;/^$/q' "$COVERLETTER"

(I really must put my random scripts into git.)

Intending to publish them? (or commit some of them to QEMU /scripts even). I'm currently maintaining scripts to do some of this which will be different to everyone elses, but perhaps committing the PULL req script to the git satisfies the variation problem?

Regards,
Peter

Quoted 2 lines

-- PMM