Re: [PATCH] Added a --replace option to virt-image which allows it to replace an existing machine if it is current running or defined

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

 



Daniel P. Berrange wrote:
On Thu, Jun 26, 2008 at 12:47:27PM -0400, "Bryan M. Kearney <bkearney@xxxxxxxxxx>"@redhat.com wrote:
+                    if vm.ID() == -1:
+                        logging.info("Removing old definition for image %s" %(self.name))
+                        vm.undefine()
+                    else:
+ logging.info("Destroying image %s" %(self.name)) + vm.destroy()

You don't want this to be an either / or conditional. If the VM exists
you should *always* attempt to undefine it - a running VM may or may
not have a config file

So you want something closer to

     if vm.ID() != -1:
        vm.destroy()

     try:
        vm.undefine()
     except:
        pass

Daniel

I thought destroy did an undefine. I have made the change, will resend the patch.

-- bk

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

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux