Re: [virt-manager] Reset Guest.domain to None on domain creation error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 13, 2017 at 07:04:13AM -0400, Xiaodai Wang wrote:
> 
> 
> 
> 
> ----- Original Message -----
> > From: "Christophe Fergeau" <cfergeau@xxxxxxxxxx>
> > To: virt-tools-list@xxxxxxxxxx
> > Sent: Thursday, April 13, 2017 5:18:46 PM
> > Subject:  [virt-manager] Reset Guest.domain to None on	domain creation error
> > 
> > When an error occurs when the VM creation wizard tries to start the VM,
> > it's then not possible to press again the "Finish" button to try again
> > to start it, as this errors out with:
> > 
> > Traceback (most recent call last):
> >   File "/home/teuf/redhat/virt/virt-manager/virtManager/asyncjob.py", line
> >   88, in cb_wrapper
> >     callback(asyncjob, *args, **kwargs)
> >   File "/home/teuf/redhat/virt/virt-manager/virtManager/create.py", line
> >   2341, in _do_async_install
> >     guest.start_install(meter=meter)
> >   File "/home/teuf/redhat/virt/virt-manager/virtinst/guest.py", line 457, in
> >   start_install
> >     raise RuntimeError(_("Domain has already been started!"))
> > RuntimeError: Domain has already been started!
> > 
> > This is caused by code introduced in commit fc6778 which does not reset
> > self.domain to None when an exception is caught.
> > 
> > Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> > ---
> >  virtinst/guest.py | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/virtinst/guest.py b/virtinst/guest.py
> > index c8c3d14..3997519 100644
> > --- a/virtinst/guest.py
> > +++ b/virtinst/guest.py
> > @@ -408,6 +408,7 @@ class Guest(XMLBuilder):
> >                      exc_info = sys.exc_info()
> >                      try:
> >                          self.domain.undefine()
> > +                        self.domain = None
> 
> 
> This will still have other problems. Since the guest has already been created, if you begin installation again,
> some conflict like "The Mac address 'xxx' is in use by another virtual machine" will occur.

Ah? I did not notice that problem with my testing, but maybe that's
because I only used default parameters in virt-manager wizard?

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux