Merge lp:~jk0/nova/lp827373 into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Dan Prince
Approved revision: 1449
Merged at revision: 1447
Proposed branch: lp:~jk0/nova/lp827373
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 42 lines (+10/-3)
2 files modified
nova/compute/manager.py (+8/-1)
nova/virt/libvirt/connection.py (+2/-2)
To merge this branch: bzr merge lp:~jk0/nova/lp827373
Reviewer Review Type Date Requested Status
Dan Prince (community) Approve
Ed Leafe (community) Approve
Review via email: mp+71759@code.launchpad.net

Description of the change

Allow local_gb size to be 0. libvirt uses local_gb as a secondary drive, but XenServer uses it as the root partition's size. Now we support both.

Include some random PEP8 fixes.

To post a comment you must log in.
Revision history for this message
Ed Leafe (ed-leafe) wrote :

Lines 10-12: Either indent these comments, or better yet, move them above the 'if' statement.

review: Needs Fixing
lp:~jk0/nova/lp827373 updated
1447. By Josh Kearney

Updated note.

1448. By Josh Kearney

Review feedback.

Revision history for this message
Ed Leafe (ed-leafe) wrote :

looks good now.

review: Approve
Revision history for this message
Dan Prince (dan-prince) wrote :

Hey Josh,

This looks good.

I'm getting conflicts when merging this to trunk:

Text conflict in nova/compute/manager.py
Text conflict in nova/virt/libvirt/connection.py

review: Needs Fixing
Revision history for this message
Josh Kearney (jk0) wrote :

> Hey Josh,
>
> This looks good.
>
> I'm getting conflicts when merging this to trunk:
>
> Text conflict in nova/compute/manager.py
> Text conflict in nova/virt/libvirt/connection.py

Fixed.

lp:~jk0/nova/lp827373 updated
1449. By Josh Kearney

Merged trunk.

Revision history for this message
Dan Prince (dan-prince) wrote :

Looks good now. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/compute/manager.py'
2--- nova/compute/manager.py 2011-08-16 14:23:38 +0000
3+++ nova/compute/manager.py 2011-08-16 19:23:39 +0000
4@@ -359,6 +359,13 @@
5 instance_type = self.db.instance_type_get(context,
6 instance_type_id)
7 allowed_size_gb = instance_type['local_gb']
8+
9+ # NOTE(jk0): Since libvirt uses local_gb as a secondary drive, we
10+ # need to handle potential situations where local_gb is 0. This is
11+ # the default for m1.tiny.
12+ if allowed_size_gb == 0:
13+ return
14+
15 allowed_size_bytes = allowed_size_gb * 1024 * 1024 * 1024
16
17 LOG.debug(_("image_id=%(image_id)d, image_size_bytes="
18@@ -1369,7 +1376,7 @@
19 # In addition, this method is creating filtering rule
20 # onto destination host.
21 self.driver.ensure_filtering_rules_for_instance(instance_ref,
22- network_info)
23+ network_info)
24
25 # Preparation for block migration
26 if block_migration:
27
28=== modified file 'nova/virt/libvirt/connection.py'
29--- nova/virt/libvirt/connection.py 2011-08-15 21:48:28 +0000
30+++ nova/virt/libvirt/connection.py 2011-08-16 19:23:39 +0000
31@@ -1538,9 +1538,9 @@
32 # If any instances never launch at destination host,
33 # basic-filtering must be set here.
34 self.firewall_driver.setup_basic_filtering(instance_ref, network_info)
35- # setting up n)ova-instance-instance-xx mainly.
36+ # setting up nova-instance-instance-xx mainly.
37 self.firewall_driver.prepare_instance_filter(instance_ref,
38- network_info)
39+ network_info)
40
41 # wait for completion
42 timeout_count = range(FLAGS.live_migration_retry_count)