[libvirt] PATCH : Opennebula, adding xen i686 domain capability and updating some error messages

Hi, this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains. Thanks for the patches, --- one_driver.c.bak 2009-06-30 15:02:28.000000000 +0200 +++ one_driver.c 2009-06-30 15:02:29.000000000 +0200 @@ -505,7 +505,7 @@ static int oneDomainShutdown(virDomainPt ret= 0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } @@ -541,7 +541,7 @@ static int oneDomainDestroy(virDomainPtr if(c_oneCancel(vm->pid)) { /* VM not running, delete the instance at ONE DB */ if(c_oneFinalize(vm->pid)){ - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } @@ -576,11 +576,11 @@ static int oneDomainSuspend(virDomainPtr ret=0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } - oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED, + oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID, _("domain is not running")); } else { oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN, @@ -609,11 +609,11 @@ static int oneDomainResume(virDomainPtr ret=0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } - oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED, + oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID, _("domain is not paused ")); } else { oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN, --- one_conf.c.bak 2009-06-30 15:01:06.000000000 +0200 +++ one_conf.c 2009-06-30 15:00:58.000000000 +0200 @@ -94,6 +94,27 @@ virCapsPtr oneCapsInit(void) { goto no_memory; } + if ((guest = virCapabilitiesAddGuest(caps, + "xen", + "i686", + 32, + NULL, + NULL, + 0, + NULL)) == NULL) + { + goto no_memory; + } + if (virCapabilitiesAddGuestDomain(guest, + "one", + NULL, + NULL, + 0, + NULL) == NULL) + { + goto no_memory; + } + return caps; Abel Miguez Rodriguez ---- Distributed System Architecture Group (http://dsa-research.org) GridWay, http://www.gridway.org OpenNEbula, http://www.opennebula.org

On Tue, Jun 30, 2009 at 03:28:45PM +0200, "Abel M?guez Rodr?guez" wrote:
Hi,
this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains.
Thanks for the patches,
--- one_driver.c.bak 2009-06-30 15:02:28.000000000 +0200 +++ one_driver.c 2009-06-30 15:02:29.000000000 +0200 @@ -505,7 +505,7 @@ static int oneDomainShutdown(virDomainPt ret= 0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } @@ -541,7 +541,7 @@ static int oneDomainDestroy(virDomainPtr if(c_oneCancel(vm->pid)) { /* VM not running, delete the instance at ONE DB */ if(c_oneFinalize(vm->pid)){ - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } @@ -576,11 +576,11 @@ static int oneDomainSuspend(virDomainPtr ret=0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } - oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED, + oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID, _("domain is not running")); } else { oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN, @@ -609,11 +609,11 @@ static int oneDomainResume(virDomainPtr ret=0; goto return_point; } - oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED, + oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID, _("Wrong state to perform action")); goto return_point; } - oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED, + oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID, _("domain is not paused ")); } else { oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
--- one_conf.c.bak 2009-06-30 15:01:06.000000000 +0200 +++ one_conf.c 2009-06-30 15:00:58.000000000 +0200 @@ -94,6 +94,27 @@ virCapsPtr oneCapsInit(void) { goto no_memory; } + if ((guest = virCapabilitiesAddGuest(caps, + "xen", + "i686", + 32, + NULL, + NULL, + 0, + NULL)) == NULL) + { + goto no_memory; + } + if (virCapabilitiesAddGuestDomain(guest, + "one", + NULL, + NULL, + 0, + NULL) == NULL) + { + goto no_memory; + } +
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Tue, Jun 30, 2009 at 03:28:45PM +0200, "Abel Míguez Rodríguez" wrote:
Hi,
this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains.
Tha patch makes sense, but I don't know what combination of mail agent or patch program you're using but the patch was complete garbage, impossible to apply it and with a bunch of non-ascii characters generating a few hundred lines of errors like ./opennebula/one_conf.c:97: error: stray ‘\302’ in program ./opennebula/one_conf.c:97: error: stray ‘\240’ in program after copying the changes by hand because patch refused to process it. In the future, please send your patches as attachment so the mailer and mail proxies won't mess with it, and you should really check your mail agent, there is really something wrong ongoing. That said I manually rewrote the full patch and commited the change, but please fix this in the future ! thanks, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Wed, Jul 01, 2009 at 12:42:15PM +0200, Daniel Veillard wrote:
On Tue, Jun 30, 2009 at 03:28:45PM +0200, "Abel Míguez Rodríguez" wrote:
Hi,
this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains.
Tha patch makes sense, but I don't know what combination of mail agent or patch program you're using but the patch was complete garbage, impossible to apply it and with a bunch of non-ascii characters generating a few hundred lines of errors like ./opennebula/one_conf.c:97: error: stray ‘\302’ in program ./opennebula/one_conf.c:97: error: stray ‘\240’ in program after copying the changes by hand because patch refused to process it.
In the future, please send your patches as attachment so the mailer and mail proxies won't mess with it, and you should really check your mail agent, there is really something wrong ongoing.
Well it's likely to be the mailman mailing list processing which made it severely broken looking at the headers: Content-type: text/plain; charset=iso-8859-1 Content-language: es Content-disposition: inline X-Accept-Language: es [...] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listman.util.phx.redhat.com id n5UDT4c9007050 I would guess that you sent as quoted-printable, and mailman barfed and converted it automatically to iso-8859-1/8bit leading to some serious garbage. Still the best is to put patches as attachment (and text/plain mime type so it gets rendered), agents and proxies won't mess with the patch the only thing they will usually do is base64 encode it which is an operation which can be safely undone by the receiving end, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Jun 30, 2009 at 03:28:45PM +0200, "Abel Míguez Rodríguez" wrote:
Hi,
this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains.
Tha patch makes sense, but I don't know what combination of mail agent or patch program you're using but the patch was complete garbage, impossible to apply it and with a bunch of non-ascii characters generating a few hundred lines of errors like ./opennebula/one_conf.c:97: error: stray ‘\302’ in
after copying the changes by hand because patch refused to
On Wed, Jul 01, 2009 at 12:42:15PM +0200, Daniel Veillard wrote: program> ./opennebula/one_conf.c:97: error: stray ‘\240’ in program process it.
In the future, please send your patches as
attachment so the mailer
and mail proxies won't mess with it, and you should really check your mail agent, there is really something wrong ongoing.
Well it's likely to be the mailman mailing list processing which made it severely broken looking at the headers:
Content-type: text/plain; charset=iso-8859-1 Content-language: es Content-disposition: inline X-Accept-Language: es [...] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listman.util.phx.redhat.com id n5UDT4c9007050
I would guess that you sent as quoted-printable, and mailman barfed and converted it automatically to iso-8859-1/8bit leading to some serious garbage. Still the best is to put patches as attachment (and text/plainmime type so it gets rendered), agents and proxies won't mess with the patch the only thing they will usually do is base64 encode it which is an operation which can be safely undone by the receiving end,
thanks !
Daniel
--
Hi, I'll send following patches as attachments and also in the mail body just for reviewing. Thanks Abel Miguez Rodriguez ---- Distributed System Architecture Group (http://dsa-research.org) GridWay, http://www.gridway.org OpenNEbula, http://www.opennebula.org
participants (3)
-
"Abel Míguez Rodríguez"
-
Daniel P. Berrange
-
Daniel Veillard