[libvirt] [PATCH] Use gcc style for structure fields declaration

Hi, This patch uses gcc style to declare fields in virDriver structures. This also makes it easier to spot bugs. $ diffstat fix3.patch lxc_driver.c | 118 ++++++++++++++++++++++++++-------------------------- openvz_driver.c | 118 ++++++++++++++++++++++++++-------------------------- qemu_driver.c | 126 ++++++++++++++++++++++++++++---------------------------- test.c | 118 ++++++++++++++++++++++++++-------------------------- 4 files changed, 240 insertions(+), 240 deletions(-) Thanks, Quynh

Hi, Quynh Good catch! +1 Thanks Atsushi SAKAI "Nguyen Anh Quynh" <aquynh@gmail.com> wrote:
Hi,
This patch uses gcc style to declare fields in virDriver structures. This also makes it easier to spot bugs.
$ diffstat fix3.patch lxc_driver.c | 118 ++++++++++++++++++++++++++-------------------------- openvz_driver.c | 118 ++++++++++++++++++++++++++-------------------------- qemu_driver.c | 126 ++++++++++++++++++++++++++++---------------------------- test.c | 118 ++++++++++++++++++++++++++-------------------------- 4 files changed, 240 insertions(+), 240 deletions(-)
Thanks, Quynh

Hmm there are some typos (listDomain -> listDefinedDomain, numOfDomains -> numOfDefineDomains) Please take this patch instead. Thanks, Quynh On Thu, Aug 28, 2008 at 2:09 PM, Atsushi SAKAI <sakaia@jp.fujitsu.com> wrote:
Hi, Quynh
Good catch! +1
Thanks Atsushi SAKAI
"Nguyen Anh Quynh" <aquynh@gmail.com> wrote:
Hi,
This patch uses gcc style to declare fields in virDriver structures. This also makes it easier to spot bugs.
$ diffstat fix3.patch lxc_driver.c | 118 ++++++++++++++++++++++++++-------------------------- openvz_driver.c | 118 ++++++++++++++++++++++++++-------------------------- qemu_driver.c | 126 ++++++++++++++++++++++++++++---------------------------- test.c | 118 ++++++++++++++++++++++++++-------------------------- 4 files changed, 240 insertions(+), 240 deletions(-)
Thanks, Quynh

On Thu, Aug 28, 2008 at 05:09:15PM +0900, Nguyen Anh Quynh wrote:
Hmm there are some typos (listDomain -> listDefinedDomain, numOfDomains -> numOfDefineDomains)
Please take this patch instead.
+1. Best if the OpenVZ or LXC devs commit this. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

"Nguyen Anh Quynh" <aquynh@gmail.com> wrote:
Hmm there are some typos (listDomain -> listDefinedDomain, numOfDomains -> numOfDefineDomains)
Please take this patch instead. static virDriver lxcDriver = { - VIR_DRV_LXC, /* the number virDrvNo */ - "LXC", /* the name of the driver */ - LIBVIR_VERSION_NUMBER, /* the version of the backend */ - lxcProbe, /* probe */ ... + .no = VIR_DRV_LXC, /* the number virDrvNo */ + .name = "LXC", /* the name of the driver */ + .ver = LIBVIR_VERSION_NUMBER, /* the version of the backend */ + .probe = lxcProbe, ...
Thank you. That looks like a fine improvement. Have you already compared the pre- and post-patch .o files? This patch appears to be one that would evoke no change in any recompiled .o file. If so, and if you can report that all four pre/post .o-file pairs are identical, we can be sure this improvement does not hide a subtle bug.

On Fri, Aug 29, 2008 at 3:02 PM, Jim Meyering <jim@meyering.net> wrote:
"Nguyen Anh Quynh" <aquynh@gmail.com> wrote:
Hmm there are some typos (listDomain -> listDefinedDomain, numOfDomains -> numOfDefineDomains)
Please take this patch instead. static virDriver lxcDriver = { - VIR_DRV_LXC, /* the number virDrvNo */ - "LXC", /* the name of the driver */ - LIBVIR_VERSION_NUMBER, /* the version of the backend */ - lxcProbe, /* probe */ ... + .no = VIR_DRV_LXC, /* the number virDrvNo */ + .name = "LXC", /* the name of the driver */ + .ver = LIBVIR_VERSION_NUMBER, /* the version of the backend */ + .probe = lxcProbe, ...
Thank you. That looks like a fine improvement.
Have you already compared the pre- and post-patch .o files? This patch appears to be one that would evoke no change in any recompiled .o file. If so, and if you can report that all four pre/post .o-file pairs are identical, we can be sure this improvement does not hide a subtle bug.
I tried, and saw nothing wrong. Could you confirm that? Thanks, Quynh
participants (4)
-
Atsushi SAKAI
-
Jim Meyering
-
Nguyen Anh Quynh
-
Richard W.M. Jones