All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Yanqiangjun <yanqiangjun@huawei.com>,
	Luonengjun <luonengjun@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Fabio Fantoni <fabio.fantoni@m2r.biz>,
	Jan Beulich <JBeulich@suse.com>,
	"anthony.perard@citrix.com" <anthony.perard@citrix.com>,
	"Hanweidong (Randy)" <hanweidong@huawei.com>,
	"Gaowei (UVP)" <gao.gaowei@huawei.com>,
	"Huangweidong (Hardware)" <huangweidong@huawei.com>
Subject: Re: [Qemu-devel] [Xen-devel] Hvmloader: Modify ACPI to only supply _EJ0 methods for PCIslots that support hotplug by runtime patching
Date: Wed, 16 Oct 2013 13:10:55 +0200	[thread overview]
Message-ID: <87txghii80.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1381921102.21901.73.camel@kazak.uk.xensource.com> (Ian Campbell's message of "Wed, 16 Oct 2013 11:58:22 +0100")

Ian Campbell <Ian.Campbell@citrix.com> writes:

> On Wed, 2013-10-16 at 12:49 +0200, Markus Armbruster wrote:
>> Ian Campbell <Ian.Campbell@citrix.com> writes:
>> 
>> > On Wed, 2013-10-16 at 10:54 +0100, Jan Beulich wrote:
>> >> >>> On 16.10.13 at 08:30, "Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:
>> >> > --- hvmloader/acpi/Makefile	2013-10-16 11:51:53.000000000 +0800
>> >> > +++ hvmloader_new//acpi/Makefile	2013-10-16 11:51:58.000000000 +0800
>> >> > @@ -36,18 +36,34 @@
>> >> >  
>> >> >  dsdt_anycpu_qemu_xen.asl: dsdt.asl mk_dsdt
>> >> >  	awk 'NR > 1 {print s} {s=$$0}' $< > $@
>> >> > -	./mk_dsdt --dm-version qemu-xen >> $@
>> >> > +	sed -i 's/AmlCode/dsdt_anycpu_qemu_xen/g' $@
>> >> 
>> >> This must never be done - if someone hits Ctrl-C in the middle of
>> >> this, you'll have a modified but incomplete generated file. You
>> >> either need to use properly chained rules, or do all output to a
>> >> temporary file which you rename as the last step.
>> >> 
>> >> I realize that the problem existed before your change, but you
>> >> making it worse requires doing it properly now.
>> >
>> > The correct way to do this is to generate to a temporary file and then
>> > use $(call move-if-changed,$@.tmp,$@). There are a bunch of examples in
>> > tools/libxl/Makefile and elsewhere.
>> 
>> Quoting the GNU make manual[*]:
>> 
>>     So generally the right thing to do is to delete the target file if
>>     the recipe fails after beginning to change the file.  make will do
>>     this if .DELETE_ON_ERROR appears as a target.  This is almost always
>>     what you want make to do, but it is not historical practice; so for
>>     compatibility, you must explicitly request it.
>> 
>> In my opinion, every Makefile should request it.
>> 
>> [*] https://www.gnu.org/software/make/manual/html_node/Errors.html
>
> I think this is somewhat orthogonal to the use of move-if-changed which
> is there to ensure that the timestamp doesn't change gratuitously and
> cause a load of knock on rebuilds even though the regenerated content is
> identical.

Yes.  I was latching onto the "if someone hits Ctrl-C in the middle of
this, you'll have a modified but incomplete generated file" phrase.

  parent reply	other threads:[~2013-10-16 11:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  6:30 [Qemu-devel] Hvmloader: Modify ACPI to only supply _EJ0 methods for PCIslots that support hotplug by runtime patching Gonglei (Arei)
2013-10-16  9:13 ` Fabio Fantoni
2013-10-16  9:13 ` Fabio Fantoni
2013-10-16  9:19 ` Ian Campbell
2013-10-16  9:19 ` [Qemu-devel] [Xen-devel] " Ian Campbell
2013-10-16  9:54 ` Jan Beulich
2013-10-16  9:54 ` [Qemu-devel] [Xen-devel] " Jan Beulich
2013-10-16 10:04   ` Ian Campbell
2013-10-16 10:49     ` Markus Armbruster
2013-10-16 10:58       ` Ian Campbell
2013-10-16 11:10         ` [Qemu-devel] " Markus Armbruster
2013-10-16 11:10         ` Markus Armbruster [this message]
2013-10-16 12:03           ` [Qemu-devel] [Xen-devel] " Jan Beulich
2013-10-22  4:08             ` [Qemu-devel] " Gonglei (Arei)
2013-10-22  4:08             ` [Qemu-devel] [Xen-devel] " Gonglei (Arei)
2013-10-22  8:06               ` Jan Beulich
2013-10-24 12:17                 ` [Qemu-devel] " Gonglei (Arei)
2013-10-24 12:17                 ` [Qemu-devel] [Xen-devel] " Gonglei (Arei)
2013-10-24 12:57                   ` Fabio Fantoni
2013-10-24 13:16                     ` Gonglei (Arei)
2013-10-24 13:16                     ` [Qemu-devel] " Gonglei (Arei)
2013-10-24 12:57                   ` Fabio Fantoni
2013-10-28  9:38                   ` Jan Beulich
2013-10-28  9:38                   ` [Qemu-devel] [Xen-devel] " Jan Beulich
2014-01-22 14:32                     ` Fabio Fantoni
2014-04-28 10:14                       ` [Qemu-devel] " Fabio Fantoni
     [not found]                       ` <535E2A18.9040504@m2r.biz>
2014-04-28 10:21                         ` Ian Campbell
     [not found]                         ` <1398680460.29700.34.camel@kazak.uk.xensource.com>
2014-04-28 12:04                           ` Gonglei (Arei)
     [not found]                           ` <33183CC9F5247A488A2544077AF19020815E325F@SZXEMA503-MBS.china.huawei.com>
2014-04-28 13:58                             ` Fabio Fantoni
     [not found]                             ` <535E5E82.40102@m2r.biz>
2014-04-29  3:27                               ` Gonglei (Arei)
2014-01-22 14:32                     ` Fabio Fantoni
2013-10-28  7:14                 ` Gonglei (Arei)
2013-10-28  7:14                 ` [Qemu-devel] [Xen-devel] " Gonglei (Arei)
2013-10-22  8:06               ` [Qemu-devel] " Jan Beulich
2013-10-16 12:03           ` Jan Beulich
2013-10-16 10:58       ` Ian Campbell
2013-10-16 10:49     ` Markus Armbruster
2013-10-16 10:04   ` Ian Campbell

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=87txghii80.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=arei.gonglei@huawei.com \
    --cc=fabio.fantoni@m2r.biz \
    --cc=gao.gaowei@huawei.com \
    --cc=hanweidong@huawei.com \
    --cc=huangweidong@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yanqiangjun@huawei.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.