Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora/Linux Management Tools (http://www.linux-archive.org/fedora-linux-management-tools/)
-   -   Add error message when it connects to the stopping domain. (http://www.linux-archive.org/fedora-linux-management-tools/108128-add-error-message-when-connects-stopping-domain.html)

Hiroyuki Kaguchi 06-17-2008 05:54 AM

Add error message when it connects to the stopping domain.
 
On 2008/05/29 14:44, Hiroyuki Kaguchi wrote:
> Hi,
>
> When the guest domain is stopping, virt-viewer exits without error message.
> The patch adds error message when it fails to connect stopping domain.
>
> Thanks,
> Signed-off-by: Hiroyuki Kaguchi <fj7025cf@aa.jp.fujitsu.com>
>
> diff -r 5299a3aaebb5 src/main.c
> --- a/src/main.c Sun Apr 27 23:41:26 2008 -0400
> +++ b/src/main.c Thu May 29 13:58:00 2008 +0900
> @@ -785,6 +785,7 @@ viewer_start (const char *uri, const cha
> GtkWidget *vnc;
> virConnectPtr conn = NULL;
> virDomainPtr dom = NULL;
> + virDomainInfo domInfo;
> char *host = NULL;
> char *vncport = NULL;
> char *transport = NULL;
> @@ -813,11 +814,24 @@ viewer_start (const char *uri, const cha
> usleep(500*1000);
> } while (!dom);
>
> - viewer_extract_vnc_graphics(dom, &vncport);
> - if (!vncport && !waitvnc) {
> - fprintf(stderr, "unable to find vnc graphics for %s
", name);
> - return 4;
> + if (virDomainGetInfo(dom, &domInfo) != 0) {
> + fprintf(stderr, "unable to get information for %s
", name);
> + return 6;
> }
> +
> + if (domInfo.state == VIR_DOMAIN_SHUTOFF && !waitvnc) {
> + fprintf(stderr, "%s is not running
", name);
> + return 7;
> + }
> +
> + if (domInfo.state != VIR_DOMAIN_SHUTOFF) {
> + viewer_extract_vnc_graphics(dom, &vncport);
> + if (!vncport) {
> + fprintf(stderr, "unable to find vnc graphics for %s
", name);
> + return 4;
> + }
> + }
> +
> if (!vncport) {
> virDomainFree(dom);
> usleep(300*1000);
>

Could you apply this patch if there is no problem in this patch, Dan ?

Thanks,
Hiroyuki Kaguchi

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

"Daniel P. Berrange" 06-17-2008 08:03 AM

Add error message when it connects to the stopping domain.
 
On Thu, May 29, 2008 at 02:44:30PM +0900, Hiroyuki Kaguchi wrote:
> Hi,
>
> When the guest domain is stopping, virt-viewer exits without error message.
> The patch adds error message when it fails to connect stopping domain.
>
> Thanks,
> Signed-off-by: Hiroyuki Kaguchi <fj7025cf@aa.jp.fujitsu.com>


Sorry for delay in applying this - its committed now.

Regards,
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 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


All times are GMT. The time now is 04:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.