Re: [PATCH] bugzillaID:329091

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

 



S.Sakamoto wrote:
> Hi
> 
> I make a patch of BugzillaID-329091.
> https://bugzilla.redhat.com/show_bug.cgi?id=329091
> 
> Thanks,
> Shigeki Sakamoto.
> 
> ----------------------------------------------------------------------
> diff -r 531b73491ac2 virt-install
> --- a/virt-install	Wed Oct 10 14:24:48 2007 -0400
> +++ b/virt-install	Tue Oct 16 16:01:29 2007 +0900
> @@ -15,6 +15,7 @@
>  
>  
>  import os, sys, string
> +from stat import *
>  from optparse import OptionParser, OptionValueError
>  import subprocess
>  import logging
> @@ -48,10 +49,10 @@ def get_disk(disk, size, sparse, guest, 
>          if not size is None:
>              msg = _("Please enter the path to the file you would like to use for storage. It will have size %sGB.") %(size,)
>          disk = cli.prompt_for_input(msg, disk)
> -        if os.path.exists(disk) and os.path.isfile(disk):
> +        if os.path.exists(disk) and ( S_ISBLK(os.stat(disk)[ST_MODE]) or S_ISREG(os.stat(disk)[ST_MODE]) ):
>              while 1:
>                  retryFlg = False
> -                warnmsg = _("You are going to overwrite file '%s'!\n") % disk
> +                warnmsg = _("You are going to overwrite '%s'!\n") % disk
>                  res = cli.prompt_for_input(warnmsg + _("Do you really want to use the file (yes or no)? "))
>                  try:
>                      if cli.yes_or_no(res) is True:
> ----------------------------------------------------------------------

Hello,

I don't think this is the right approach. From the bug report, I agree
that we shouldn't make it so easy to ruin a block device without some
kind of precaution, but the right way to do it would be to have something
that would require the user to explicitly specify the type of storage
desired. Such as --file be just for file based storage, and add a --blkdev
or some such option to specify device based storage. Or maintain --file as
the storage location and add a --disktype option.

Unfortunately this would break the existing interface, but so would
this patch, which would require interaction anytime someone wanted
to specify a device for storage.

Anyone else have an opinion on the right direction to go? I think
having an explicit way to specify storage would be handy anyways.

- Cole

-- 
Cole Robinson
crobinso@xxxxxxxxxx

_______________________________________________
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