Re: [libvirt] [PATCH 08/10] list: Change MATCH for common use in virsh

2012-09-06 Thread Osier Yang

On 2012年09月06日 00:30, Eric Blake wrote:

On 09/04/2012 09:16 AM, Osier Yang wrote:

Move definition of MATCH from virsh-domain-monitor.c into
virsh.h for further use.
---
  tools/virsh-domain-monitor.c |2 --
  tools/virsh.h|2 ++
  2 files changed, 2 insertions(+), 2 deletions(-)



Not quite right.


+++ b/tools/virsh.h
@@ -47,6 +47,8 @@

  # define GETTIMEOFDAY(T) gettimeofday(T, NULL)

+# define MATCH(FLAG) (flags  (FLAG))


If you're going to make the macro reusable, I think it would be better
to put it in the VSH_ namespace, and update all existing callers.



Changed to VSH_MATCH when pushing, with all MATCH replaced by VSH_MATCH
in virsh-domain-monitor.c.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 08/10] list: Change MATCH for common use in virsh

2012-09-05 Thread Eric Blake
On 09/04/2012 09:16 AM, Osier Yang wrote:
 Move definition of MATCH from virsh-domain-monitor.c into
 virsh.h for further use.
 ---
  tools/virsh-domain-monitor.c |2 --
  tools/virsh.h|2 ++
  2 files changed, 2 insertions(+), 2 deletions(-)
 

Not quite right.

 +++ b/tools/virsh.h
 @@ -47,6 +47,8 @@
  
  # define GETTIMEOFDAY(T) gettimeofday(T, NULL)
  
 +# define MATCH(FLAG) (flags  (FLAG))

If you're going to make the macro reusable, I think it would be better
to put it in the VSH_ namespace, and update all existing callers.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 08/10] list: Change MATCH for common use in virsh

2012-09-04 Thread Osier Yang
Move definition of MATCH from virsh-domain-monitor.c into
virsh.h for further use.
---
 tools/virsh-domain-monitor.c |2 --
 tools/virsh.h|2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 7e252d2..e599159 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1290,7 +1290,6 @@ vshDomainListFree(vshDomainListPtr domlist)
 VIR_FREE(domlist);
 }
 
-#define MATCH(FLAG) (flags  (FLAG))
 static vshDomainListPtr
 vshDomainListCollect(vshControl *ctl, unsigned int flags)
 {
@@ -1509,7 +1508,6 @@ cleanup:
 VIR_FREE(ids);
 return list;
 }
-#undef MATCH
 
 static const vshCmdOptDef opts_list[] = {
 {inactive, VSH_OT_BOOL, 0, N_(list inactive domains)},
diff --git a/tools/virsh.h b/tools/virsh.h
index 2a9c6a2..2758d37 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -47,6 +47,8 @@
 
 # define GETTIMEOFDAY(T) gettimeofday(T, NULL)
 
+# define MATCH(FLAG) (flags  (FLAG))
+
 /**
  * The log configuration
  */
-- 
1.7.7.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list