Change in vdsm[master]: Fixed scratchpad hook's image permissions and virtio device ...
fromani at redhat.com
fromani at redhat.com
Mon Jun 22 09:02:58 UTC 2015
Francesco Romani has posted comments on this change.
Change subject: Fixed scratchpad hook's image permissions and virtio device name
......................................................................
Patch Set 2: Code-Review-1
(2 comments)
-1 is for visibility and for questions inside.
I understand and I agree this needs to be fixed, so I'm more than fine with the concept. Let's discuss a bit about long-term fixes.
https://gerrit.ovirt.org/#/c/42573/2/vdsm_hooks/scratchpad/before_vm_start.py
File vdsm_hooks/scratchpad/before_vm_start.py:
Line 38: if retcode != 0:
Line 39: sys.stderr.write('scratchpad: error running command %s, err = %s\n' %
Line 40: (' '.join(command), err))
Line 41: sys.exit(2)
Line 42: os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP)
fixing umask, maybe with a context manager, seems a bit safer.
Line 43:
Line 44:
Line 45: def indexToDiskName(i):
Line 46: s = ''
Line 48: s = chr(ord('a') + i % 26) + s
Line 49: i = i / 26
Line 50: if i == 0:
Line 51: break
Line 52: return 'vd' + (s or 'a')
ok, this works now because we use virtio below. I wonder if it is OK to unconditionally add a virtio drive (e.g. VM configuration may be set to use SCSI emulation).
Line 53:
Line 54:
Line 55: def add_disk(domxml, path):
Line 56: '''
--
To view, visit https://gerrit.ovirt.org/42573
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4e0e2b09eddeb020ac380bfb9b5d9be73ce5377b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Anton Marchukov <amarchuk at redhat.com>
Gerrit-Reviewer: Amador Pahim <apahim at redhat.com>
Gerrit-Reviewer: Anton Marchukov <amarchuk at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck at redhat.com>
Gerrit-Reviewer: Eyal Edri <eedri at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Wenyi Gao <wenyi at linux.vnet.ibm.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list