[libvirt] [PATCH 9/13] Add virsh support for new CLI commands

This patch adds virsh support for the five new CLI commands to manage network filters. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>

On Thu, Mar 11, 2010 at 08:09:13AM -0500, Stefan Berger wrote:
This patch adds virsh support for the five new CLI commands to manage network filters.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
--- tools/virsh.c | 349 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+)
Index: libvirt-acl/tools/virsh.c =================================================================== --- libvirt-acl.orig/tools/virsh.c +++ libvirt-acl/tools/virsh.c @@ -252,6 +252,14 @@ static virNetworkPtr vshCommandOptNetwor vshCommandOptNetworkBy(_ctl, _cmd, _name, \ VSH_BYUUID|VSH_BYNAME)
+static virNWFilterPtr vshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, + char **name, int flag); + +/* default is lookup by Name and UUID */ +#define vshCommandOptNWFilter(_ctl, _cmd, _name) \ + vshCommandOptNWFilterBy(_ctl, _cmd, _name, \ + VSH_BYUUID|VSH_BYNAME) + static virInterfacePtr vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, char **name, int flag);
@@ -3808,6 +3816,300 @@ cmdInterfaceDestroy(vshControl *ctl, con return ret; }
+ +/* + * "nwfilter-define" command + */ +static const vshCmdInfo info_nwfilter_define[] = { + {"help", gettext_noop("define or update a network filter from an XML file")}, + {"desc", gettext_noop("Define a new network filter or update an existing one.")}, + {NULL, NULL} +};
Since you wrote this, we've decide to replace 'gettext_noop' with 'N_' in all virsh code. 'make syntax-check' should warn about this now, i believe Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

"Daniel P. Berrange" <berrange@redhat.com> wrote on 03/17/2010 07:52:53 AM:
On Thu, Mar 11, 2010 at 08:09:13AM -0500, Stefan Berger wrote:
This patch adds virsh support for the five new CLI commands to manage network filters.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
--- tools/virsh.c | 349 ++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++ 1 file changed, 349 insertions(+)
Index: libvirt-acl/tools/virsh.c =================================================================== --- libvirt-acl.orig/tools/virsh.c +++ libvirt-acl/tools/virsh.c @@ -252,6 +252,14 @@ static virNetworkPtr vshCommandOptNetwor vshCommandOptNetworkBy(_ctl, _cmd, _name, \ VSH_BYUUID|VSH_BYNAME)
+static virNWFilterPtr vshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, + char **name, int
flag);
+ +/* default is lookup by Name and UUID */ +#define vshCommandOptNWFilter(_ctl, _cmd, _name) \ + vshCommandOptNWFilterBy(_ctl, _cmd, _name, \ + VSH_BYUUID|VSH_BYNAME) + static virInterfacePtr vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, char **name, int flag);
@@ -3808,6 +3816,300 @@ cmdInterfaceDestroy(vshControl *ctl, con return ret; }
+ +/* + * "nwfilter-define" command + */ +static const vshCmdInfo info_nwfilter_define[] = { + {"help", gettext_noop("define or update a network filter from an XML file")}, + {"desc", gettext_noop("Define a new network filter or update an existing one.")}, + {NULL, NULL} +};
Since you wrote this, we've decide to replace 'gettext_noop' with 'N_' in all virsh code. 'make syntax-check' should warn about this now, i believe
Thanks for pointing this out -- fixed. Unfortunately 'make syntax-check' does not report the warning. Also, what package provides the 'cppi' tool that is being used during the syntax check? Thanks and regards, Stefan
Regards, Daniel -- |: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/:|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 03/17/2010 06:47 AM, Stefan Berger wrote:
Since you wrote this, we've decide to replace 'gettext_noop' with 'N_' in all virsh code. 'make syntax-check' should warn about this now, i believe
Thanks for pointing this out -- fixed. Unfortunately 'make syntax-check' does not report the warning.
Yes, it should, but no, it does not yet do so. I'm working on that patch to cfg.mk.
Also, what package provides the 'cppi' tool that is being used during the syntax check?
Unfortunately, nothing in Fedora yet. But there is a candidate rpm here: https://bugzilla.redhat.com/show_bug.cgi?id=570627 -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Stefan Berger